[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 00:38:19 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().
>
>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)
>* Create output sections as usual.
>* Process relocations, potentially adding CopyRelSections to those
>  output sections.
>* Remove .bss and/or .bss.rel.ro if empty.
>
>Cheers,
>Rafael

Yeah, that what was "I was thinking of having a single synthetic section for all ro copy
relocations and a single synthetic section for all rw copy relocations.", that should work as
I mentioned.

Early scan of relocations would be needed if we want to add these sections to inputsections
list early. That probably not an option.

I'll update patch to use new dummy bss/bss.rel.ro synthetic sections.

George.


More information about the llvm-commits mailing list