This is the mail archive of the
mailing list for the binutils project.
RFC: Should .strtab and .shstrtab sections have the SHF_STRINGS flag ?
- From: Nick Clifton <nickc at redhat dot com>
- To: binutils at sourceware dot org
- Date: Tue, 12 Apr 2016 14:28:01 +0100
- Subject: RFC: Should .strtab and .shstrtab sections have the SHF_STRINGS flag ?
- Authentication-results: sourceware.org; auth=none
Should the ELF .strtab and .shstrtab sections be allowed to have the
SHF_STRINGS flag set ?
The Solaris linker currently does this, and I am wondering whether it
would be a good thing for our linker to do the same. The logic of the
change is that both of these sections do contain nul terminated
strings, so setting the flag bit makes sense. (It would also mean
that we could add an option to the strings program to only dump those
sections with the SHF_STRINGS flag bit set, thus possibly reducing the
amount of noise produced).
The counter argument as I see it, is that the current ELF spec says
that these sections do not have any flag bits set (.shstrtab) or just
the SHF_ALLOC bit (.strtab, when it is in a loadable segment).
But the SHF_STRINGS bit is an extension to the ELF specification, so
naturally its use would not be described in the spec. What worries me
though is whether a .strtab or .shstrtab section with the SHF_STRINGS
flag bit set would be considered to be non-conforming by some other