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

Rafael Avila de Espindola via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 1 10:26:54 PST 2017


George Rimar <grimar at accesssoftek.com> writes:
>>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


More information about the llvm-commits mailing list