[PATCH] D22516: [ELF] - Fix an issue when 2 output sections were created from single declaration in script

Rafael EspĂ­ndola via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 22 08:29:17 PDT 2016


So, I think my example was broken

The script was matching sections named .foo.*, but the sections in the
.s file were missing the second dot.

If I expand the example to

SECTIONS {
 .bar1 : { *(.foo1) *(.foo2) }
 .bar2 : { *(.foo) }
}

and input files

.section .foo1, "aw"
.long 1
.section .foo2, "aT"
.long 2
.section .foo, "aw"
.long 3
.section .zed, "aw"
.long 4


and

 .section .foo, "aT"
.long 5
.section .zed, "aT"
.long 5


What I get is

bfd concatenates the sections by name only and we end with 3 sections
(.bar1, .bar2 and .zed).

gold produces two .zed section (which I think is a good thing) but
only one .bar1 and one .bar2. It also eats the T flag from the bar
sections.

Given the inconsistency we can probably keep the current behaviour,
but I just want to rectify the experiment.

Cheers,
Rafael


More information about the llvm-commits mailing list