[PATCH] D48690: lld-link: align sections to 16 bytes if referenced from the gfids table

Hans Wennborg via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 28 04:44:49 PDT 2018


hans added a comment.

Nice! I like how simple this turned out.

>From the commit message:
PR857012 is the Chromium bug number. LLVM hasn't had that many bugs :-p
Maybe just change to "See also https://crbug.com/857012" for details or something like that.



================
Comment at: lld/test/COFF/guardcf-align.s:11
+# CHECK: 0x{{[0-9A-Fa-f]+0$}}
+# CHECK-NOT: 0x{{[0-9A-Fa-f]+[^0]$}}
+# CHECK: ]
----------------
It would be good to have a comment about the intention of these checks, since it's not obvious from a quick read.

The regexes are a little tricky to read. Will there be more entries in the gfid than the one for foo? If not, could we just check that there's only one entry and that it's aligned?

Also it would be nice to check that it's really foo that's getting aligned. Maybe we could generate a map file  (/lldmap:file) and check foo's alignment there?

Oh, and could we be getting lucky and foo is aligned because it's first in the segment or something? Maybe there should be more than one function that we check the alignment of just to be sure?


https://reviews.llvm.org/D48690





More information about the llvm-commits mailing list