This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
PCREL preinit/init/fini arrays?
- From: Matt Thomas <matt at 3am-software dot com>
- To: binutils at sourceware dot org
- Date: Mon, 18 Aug 2014 13:47:28 -0700
- Subject: PCREL preinit/init/fini arrays?
- Authentication-results: sourceware.org; auth=none
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? :)