[PATCH] D30458: [ELF] - Make Bss and BssRelRo sections to be synthetic by nature.

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 2 07:50:38 PST 2017


>>>Now that I think of it, I think your suggestion is probably
>>>better. Everything should just work if each synthetic section is added
>>>to the input section list.
>>
>> I also though about that when wrote patch, but doesn't it mean we would
>> need early scan of relocations before creating output sections (to find copy relocations) ?
>> Now we proccess all relocations including copy relocations after createSections().
>

Looks I understood next wrong earlier:

>I think it would require something similar to what we do with other
>synthetic sections:
>
>* Create a dummy .bss and a dummy .bss.rel.ro (just two empty input
>  sections)

Doesn't it what my patch already do ? It uses dummy CopyRelSection for that
purpose (because I want to use empty() for removing them later, so these
sections should be synthetic).

>* Create output sections as usual.
>* Process relocations, potentially adding CopyRelSections to those
>  output sections.

That what my patch do too. It adds CopyRelSections sections to output sections
pointed by dummy section from above.

>* Remove .bss and/or .bss.rel.ro if empty.
>

It also do that at the end.

What is the difference then?

George.


More information about the llvm-commits mailing list