[PATCH] [PECOFF][Writer] Implement the writer that can emit text section.

Shankar Kalpathi Easwaran shankarke at gmail.com
Thu May 30 12:26:00 PDT 2013


  I think the whole patch has to be made clean and data members should be assigned from TargetInfo, because the patch has lot of cleanup items. Just my views.

  Bigcheese can possibly decide.


================
Comment at: lib/ReaderWriter/PECOFF/WriterPECOFF.cpp:69
@@ +68,3 @@
+    // Make the DOS stub occupy the first 128 bytes of an exe. Technically
+    // this can be as small as 64 bytes, but GNU binutil's objdump cannot
+    // parse such irregular header.
----------------
Rui Ueyama wrote:
> Shankar Kalpathi Easwaran wrote:
> > Is this a binutils requirement, is llvm-objdump able to print ?
> I think it's binutil's bug. llmv-objdump can parse such file.
Then that constant should be 64 bytes.

================
Comment at: lib/ReaderWriter/PECOFF/WriterPECOFF.cpp:117-119
@@ +116,5 @@
+
+    // The address of entry point relative to ImageBase. Windows executable
+    // usually starts at address 0x401000.
+    _peHeader.AddressOfEntryPoint = 0x1000;
+    _peHeader.BaseOfCode = 0x1000;
----------------
Rui Ueyama wrote:
> Shankar Kalpathi Easwaran wrote:
> > The comment is misleading. All these should come from TargetInfo.
> Right. It should be set by command line option. It's also to-do.
The comment says 0x401000 and you are setting to 0x1000. Same with few other comments below.


http://llvm-reviews.chandlerc.com/D892

BRANCH
  coff3

ARCANIST PROJECT
  lld



More information about the llvm-commits mailing list