[PATCH] D31888: [LLD][ELF] Always use Script::assignAddresses()

Rafael Avila de Espindola via llvm-commits llvm-commits at lists.llvm.org
Mon May 15 14:00:42 PDT 2017


>> We need to either be "pessimistic" or iterate. If we start without
>> allocating the headers and then find out that there is space, we will
>> add a PT_PHDR, making the headers bigger and will have to assign
>> addresses again.
>>
>>
> I was more thinking that we don't need to create the PHDRs early and then
> edit them. We only need to know the size of the program header table early
> - we can create the actual table later when writing out the elf?

As long as we leave space for a PT_PHDR and a RO PT_LOAD, that should be
possible. Not sure it would actually be easier.

> In terms of being pessimistic or iterating, 2 solutions:
> - Force the user to be explicit about whether they want the headers
> allocated or not.
> - Iterate on the layout. Is iterating on the layout a problem? It seems
> that adding thunk support will require iteration.

Only when thunks are added.

Cheers,
Rafael


More information about the llvm-commits mailing list