[patch] Support multiple comdat sections with the same name but different groups

Eric Christopher echristo at gmail.com
Tue Oct 22 14:51:19 PDT 2013


>> > Side note: the reason I'm not propagating the SHF_GROUP flag through
>> > when
>> > creating rel(a) sections is that GCC doesn't, it was the only major
>> > difference I could find when comparing output with my change to GCC's. I
>> > don't have any reason to believe it's harmful to do so, except for the
>> > wasted bytes - so we can leave that in if it's preferred/there's a
>> > reason to
>> > do so. I haven't found any wording in the ELF64 or other specs to
>> > clearly
>> > indicate which way that should go.
>>
>> I think this was an intentional change: r186034.
>
>
> Fair enough - I'll see if I can find some justification from Tim or the
> original contributor as to why that's needed, but it's pretty much
> orthogonal to my change, just something I noticed while comparing the
> integrated assembler's output to gas's.
>

I think it's general goodness to keep the sh_link section up to date,
for example gold will check that the group for the symbol table for
the relocation section matches. Of course, it's also probably a
largely untested path since gcc/gas don't emit it, but I'd rather err
on the side of being able to produce more data.

-eric



More information about the llvm-commits mailing list