[PATCH] COFF generator correction: SECTION relocation size changed to 16 bit from 32

Timur Iskhodzhanov timurrrr at google.com
Tue Oct 7 09:18:19 PDT 2014


Minor nits follow:

================
Comment at: lib/CodeGen/AsmPrinter/WinCodeViewLineTables.cpp:169
@@ -168,1 +168,3 @@
   Asm->OutStreamer.EmitCOFFSectionIndex(Fn);
+  // Padding after 16-bit section index
+  Asm->EmitInt16(0);
----------------
nit: `after a 16-bit section index`

================
Comment at: lib/MC/WinCOFFStreamer.cpp:165
@@ -164,2 +164,3 @@
   DF->getFixups().push_back(Fixup);
-  DF->getContents().resize(DF->getContents().size() + 4, 0);
+  // +2, not +4: unlike 32-bit SECREL, SECTION is 16-bit
+  DF->getContents().resize(DF->getContents().size() + 2, 0);
----------------
Wording: please use just
  // Unlike 32-bit SECREL, section index is just 16-bit.

================
Comment at: test/MC/COFF/secidx.s:7
@@ -6,3 +6,3 @@
 	.secidx	Lfoo
 	.secidx	Lbar
 
----------------
I suggest we add `.short 0` between these as we've yet to see a `.secidx` directive which is not 4-byte aligned (right?).

http://reviews.llvm.org/D5651






More information about the llvm-commits mailing list