[patch] stop objcopy breaking group sections

Alan Modra amodra@bigpond.net.au
Sat Sep 27 01:45:00 GMT 2008


On Fri, Sep 26, 2008 at 07:52:40AM -0700, Ian Lance Taylor wrote:
> Whether or not it is acceptable ELF, it's inefficient, because it
> means that the group signature string gets stored in the section name
> string table.  Since there is usually a symbol with the name of the
> group signature, the string is already stored in the symbol name
> string table.  The purpose of the little dance to find the signature
> string is to permit storing it only once, in the symbol name string
> table.  This matters because those signature strings can be very long
> for C++ programs--e.g., 1K bytes--and duplicating them is wasteful.

gas knows this, and uses a symbol if one exists.  I agree that
objcopy should do the same, for efficiency reasons if no other.
Preferably not by scanning the symbols, but by setting up elf_group_id
in bfd_section_from_shdr when reading the input file.

However, I still think it isn't broken to use the section symbol (and
if it is, then gas needs to change to never use a section symbol
too).

-- 
Alan Modra
Australia Development Lab, IBM



More information about the Binutils mailing list