[PATCH] D29983: [LLD][ELF] Calculate sizes of SHF_ALLOC Synthetic Sections early

Rafael Avila de Espindola via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 17 10:39:42 PST 2017


> Instead of adding a finalizeAllocSize() I'm thinking about the following pseudo-code:
>
>   // if need thunks ...
>   bool AddressesChanged = true;
>   do {
>     if (AddressesChanged)
>       updateSyntheticSectionAllocSizes();
>     AssignAddresses();
>     AddressesChanged = createThunks();
>   } while (AddressesChanged)

It should work as it is fully general. It is a pity that the size of a
section depends on the size of others, but if we have to handle it, so
be it.


> As an aside I've experimented a bit with LinkerScript address assignment and it is possible to re-run the address assignment if all the state in the class members such as LMAOffset, AlreadyOutputOS is reset to the initial value.

Would it still be necessary with the above structure?

Cheers,
Rafael



More information about the llvm-commits mailing list