Output section descriptions with the same name

Fangrui Song i@maskray.me
Tue Nov 24 05:32:28 GMT 2020


I mentioned one discrepancy between GNU ld and gold in
https://sourceware.org/pipermail/binutils/2020-November/114125.html
That topic is mainly about DWARF64, so I am creating a separate topic
here.

For output section descriptions with the same name, currently GNU ld
concatenates the contents while gold (and LLD) create multiple output sections.

   SECTIONS {
     .debug_info 0 : { a.o(.debug_info) }
     .debug_info 0 : { b.o(.debug_info) }
   }

I slightly prefer the gold behavior.

The decision here should ideally align with future linker script
extension: https://sourceware.org/bugzilla/show_bug.cgi?id=26404


More information about the Binutils mailing list