This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

PCREL preinit/init/fini arrays?


I'm adding support for a few new architectures to NetBSD I'm planning on using
the preinit/init/fini arrays rather than .init/.fini/.ctors/.dtors.

Rather than emitting relocation entries for the arrays, I'm thinking about making
each entry PC-relative to itself.  This would allow them to move to the .text
PT_LOAD program section since they could be read-only.  Having to compute the
address of each entry shouldn't be any more expensive than doing the R_RELATIVE 
relocation that the PCREL eliminates.

I can't think of any downsides, except for getting binutils to support it, but
maybe I'm overlooking something.  Am I? :)

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]