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

Peter Collingbourne via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 27 17:40:08 PDT 2018


pcc added inline comments.


================
Comment at: lld/COFF/Writer.cpp:1050
+  for (const auto &C : AddressTakenSyms)
+    if (C.InputChunk->Alignment < 16 || (C.InputChunk->Alignment & 15))
+      C.InputChunk->Alignment = (C.InputChunk->Alignment + 16) & ~15;
----------------
inglorion wrote:
> pcc wrote:
> > I think this can be simplified: the alignment should always be a power of 2.
> So just if (Alignment < 16) Alignment = 16 would do it?
Yes.


https://reviews.llvm.org/D48690





More information about the llvm-commits mailing list