Your bfd & ld patch breaks --as-needed on SPARC (and some other targets)

Kaz Kojima
Wed Aug 17 04:09:00 GMT 2005

Alan Modra <> wrote:
> Thanks for looking into this.  I'm curious as to why you need to set
> rawsize, as there might be a generic bug somewhere.  Care to explain?

I don't look at it deeply.  There is a comment before the code in
problem (emultempl/sh64elf.em: 550):

  /* The .cranges section will have this size, no larger or smaller.
     Since relocs (if relocatable linking) will be emitted into the
     "extended" size, we must set the raw size to the total.  We have to
     keep track of the number of new .cranges entries.

     Sorting before writing is done by sh64_elf_final_write_processing.  */

In the erroneous case, the size and the rawsize of .cranges are
the different positive numbers and bfd_malloc_and_get_section
returns the data which is correct only up to rawsize bytes.  So I
thought that we must set the rawsize to the total size there,
though I could be wrong about this.


More information about the Binutils mailing list