[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
Tue Feb 28 18:58:12 PST 2017


Rui Ueyama <ruiu at google.com> writes:

> On Tue, Feb 28, 2017 at 5:04 PM, Rafael Avila de Espindola <
> rafael.espindola at gmail.com> wrote:
>
>> Rui Ueyama via Phabricator <reviews at reviews.llvm.org> writes:
>>
>> > ruiu added a comment.
>> >
>> > It doesn't seem like an improvement to me. Out::Bss and Out::BssRelRo
>> are containers of synthetic sections, thus they are output sections. You
>> could represent them as input sections, and we want to do if that
>> simplifies code/design, but this patch doesn't seem to simplify it.
>>
>> They are synthetic sections in the sense that a linker script can
>> put them in another output section:
>>
>>   aabb : { *(.bss.*) }
>>
>> Maybe we should revisit the idea of having one section per copy
>> relocation? We can do that if we add an offset to SharedSymbol or if we
>> replace the SharedSymbol with a DefinedRegular when a copy relocation is
>> created (I think I like the second option better).
>>
>
> Are you saying that, for each symbol that needs copy relocation, create a
> .bss (or .bss.rel.ro) synthetic section and add it to the input section
> list, so that a latter pass will aggregate them to a .bss (or .bss.rel.ro)
> output section?

I was thinking of having a single synthetic section for all ro copy
relocations and a single synthetic section for all rw copy relocations.

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.

Cheers,
Rafael


More information about the llvm-commits mailing list