This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: RFC: Should .strtab and .shstrtab sections have the SHF_STRINGS flag ?
- From: Nick Clifton <nickc at redhat dot com>
- To: Cary Coutant <ccoutant at gmail dot com>
- Cc: Binutils <binutils at sourceware dot org>
- Date: Wed, 13 Apr 2016 17:29:28 +0100
- Subject: Re: RFC: Should .strtab and .shstrtab sections have the SHF_STRINGS flag ?
- Authentication-results: sourceware.org; auth=none
- References: <87k2k36joe dot fsf at redhat dot com> <CAJimCsF5-zOrgzgbwnX9OrbatjNtUPL=nA5GuQmH-1nSeWhG_w at mail dot gmail dot com>
Hi Cary,
> SHF_STRINGS *is* part of the ELF spec (yes, it was an extension, but
> it was adopted in the gABI 17 years ago).
>
> http://www.sco.com/developers/gabi/latest/contents.html
Ah - thanks for the pointer.
> Perhaps the gABI could use some clarification to the effect that
> SHF_MERGE and SHF_STRINGS are intended for SHT_PROGBITS sections only,
> or that the flags are optional (and implied) for SHT_STRTAB sections.
> (The former would invalidate what Solaris is doing, while the latter
> would allow it.)
Well I think that it would be nice to have a decision, and if it could
be compatible with the current Solaris linker that would be even better.
In the meantime I have modified my original patch so that it allows
individual targets to decide what flag bits should be set for these
sections. The default is none - ie the current behaviour - but for
Solaris based targets the patch changes this to be SHF_STRINGS. This
seems to me like the best compromise - no change for non-Solaris
targets for now, but allowing the possibility of change in the future.
Cheers
Nick