Fix split stab section handling

Ian Lance Taylor ian@wasabisystems.com
Thu Sep 18 17:08:00 GMT 2003


Nathan Sidwell <nathan@codesourcery.com> writes:

> 2) The generated name of a split section uses the first 5 characters
> of the original name (why?). Thus causing a split .stab.excl etc not to
> be able to find their associated .stab.exclstr string section. Fixed by
> not truncating stab section names this way

In general I think your patches are good ones.

The reason a split section uses only the first five character of the
original name is that in general COFF targets have a strict limit on
the length of a section name--usually 8 characters.  And COFF targets
are the main ones which need split sections--other object file formats
generally have a sufficiently large field for the number of relocation
entries.  Using a longer name is OK if bfd_coff_long_filenames() is
true for the backend, or if it is ELF.  (Is there any reason you are
using --split-* for ELF?)

On a different note, I think !strncmp is a bad idiom.  It suggests the
opposite of what it means.  Use == 0 instead.

Ian



More information about the Binutils mailing list