Need for an additional flag

Ian Lance Taylor ian@airs.com
Fri Sep 19 15:29:00 GMT 2003


Michael Matz <matz@suse.de> writes:

> I have a need for introducing something like a new flag to ELF sections.
> It would only apply to SHF_MERGE|SHF_STRINGS.  There is space in the SHF_
> namespace.  But I can't map it to any bfd SEC_xxx, because there're no
> bits left.  Currently I'm thinking about reusing SEC_ROM for that flag,
> because it doesn't seem to be handled in very many places, so special
> casing SEC_STRING section with SEC_ROM attribute is feasible.
> 
> Of course that's ugly.  Is there a better way to communicate some ELF
> section flag to the linker (this is where I actually need this)?

It depends upon what it does.  There isn't a correct generic answer.

In general the BFD SEC_* flags are overloaded to support the ELF SHF_*
flags, the ELF SHT_* section type, and the sh_entsize field.  Actually
the BFD section name is mixed in as well to determine the ELF flags.
So the current situation is rather messy.

We might also be able to get rid of a BFD SEC_* flag.
SEC_COFF_SHARED_LIBRARY looks a bit suspicious (although I probably
introduced it myself).

Ian



More information about the Binutils mailing list