[PATCH] D22683: [ELF] Symbol assignment within input section list

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 26 12:18:39 PDT 2016


ruiu added a comment.

Not sure if the visitor pattern is a good choice, but there's a correctness issue with this patch so I'll send this comment now.


================
Comment at: ELF/LinkerScript.cpp:120-121
@@ -122,1 +119,4 @@
+    // .foo : { *(.foo.*) end_foo = .; }
+    SectionOffset = alignTo(SectionOffset, C->Alignment);
+    SectionOffset += C->getSize();
   };
----------------
This offset computation is not accurate. On MIPS or ARM, input sections may have additional pieces of data, or thunks, at their ends. Thunks are added to input sections in Writetr::finalizeSections, so in this function we don't know the exact size of input sections. So this is computing offsets too early.


https://reviews.llvm.org/D22683





More information about the llvm-commits mailing list