[RFA] Linker script extension SECTION_FLAGS
Ian Lance Taylor
Thu May 19 00:07:00 GMT 2011
Catherine Moore <email@example.com> writes:
> This patch extends the linker script language to include SECTION_FLAGS
> on an output section statement. The purpose of the flags is to ensure
> that all input sections assigned to the output section either have the
> flags set or cleared.
> This version of the patch sets the infrastructure but does not define
> a backend implementation. I will provide that along with additional
> testcases when I contribute the Powerpc VLE port.
> This patch was originally discussed in the thread beginning here:
> Does this look okay to install?
I didn't look at the patch, but I think the documentation needs to use
some real section flags, and ideally the set of valid flags should be
defined somewhere. It's not obvious what the valid values are.
I'm also not sure about the way it appears in a linker script. You have
SECTION_FLAGS, which describes a constraint on the input sections
attached to an output section, next to things like AT, ALIGN, and
SUBALIGN, which describe characteristics of the output section. That is
OK, but I think that somebody looking at a linker script is likely to
think that SECTION_FLAGS is setting flags for the output section, much
as ALIGN sets the alignment of the output section. But that's not what
happens at all. So perhaps the name should be something like
INPUT_SECTION_FLAGS or perhaps the constraint should be expressed
somehow inside the output section definition, in the list of input
sections, rather than outside.
More information about the Binutils