[PATCH] D54495: [LLD] [COFF] Remove empty sections before calculating the size of section headers

Martin Storsjö via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 14 02:15:04 PST 2018


mstorsjo added a comment.

In https://reviews.llvm.org/D54495#1298076, @ruiu wrote:

> Makes sense. LGTM.
>
> Thank you for doing this.


Actually, it turns out this doesn't work like this, sorry I hadn't run the full testsuite on this change before now.

It turns out that this change removes the base reloc section. That section is empty up until `assignAddresses` where it is populated, and afaik it does have to be re-updated every time we adjust addresses (for thunks).

So basically, we should remove all empty sections except for the reloc section, and reserve space for it. After `finalizeAddresses`, if it turns out the reloc section really is empty, we could remove that one as well.

This turned into something much more complicated than I had originally intended...


https://reviews.llvm.org/D54495





More information about the llvm-commits mailing list