[lld] r188187 - [PECOFF] Fixed base images now have the IMAGE_FILE_RELOCS_STRIPPED flag
Rui Ueyama
ruiu at google.com
Mon Aug 12 11:11:35 PDT 2013
Author: ruiu
Date: Mon Aug 12 13:11:35 2013
New Revision: 188187
URL: http://llvm.org/viewvc/llvm-project?rev=188187&view=rev
Log:
[PECOFF] Fixed base images now have the IMAGE_FILE_RELOCS_STRIPPED flag
Patch by Ron Ofir.
Modified:
lld/trunk/lib/ReaderWriter/PECOFF/WriterPECOFF.cpp
lld/trunk/test/pecoff/base-reloc.test
Modified: lld/trunk/lib/ReaderWriter/PECOFF/WriterPECOFF.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/PECOFF/WriterPECOFF.cpp?rev=188187&r1=188186&r2=188187&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/PECOFF/WriterPECOFF.cpp (original)
+++ lld/trunk/lib/ReaderWriter/PECOFF/WriterPECOFF.cpp Mon Aug 12 13:11:35 2013
@@ -155,6 +155,9 @@ public:
llvm::COFF::IMAGE_FILE_EXECUTABLE_IMAGE;
if (context.getLargeAddressAware())
characteristics |= llvm::COFF::IMAGE_FILE_LARGE_ADDRESS_AWARE;
+ if (!context.getBaseRelocationEnabled())
+ characteristics |= llvm::COFF::IMAGE_FILE_RELOCS_STRIPPED;
+
_coffHeader.Characteristics = characteristics;
// 0x10b indicates a normal PE32 executable. For PE32+ it should be 0x20b.
Modified: lld/trunk/test/pecoff/base-reloc.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/pecoff/base-reloc.test?rev=188187&r1=188186&r2=188187&view=diff
==============================================================================
--- lld/trunk/test/pecoff/base-reloc.test (original)
+++ lld/trunk/test/pecoff/base-reloc.test Mon Aug 12 13:11:35 2013
@@ -19,12 +19,14 @@ NOBASEREL-SECTION-NOT: Contents of secti
# RUN: lld -flavor link /out:%t1 /subsystem:console /force -- %t.obj \
# RUN: && llvm-readobj -file-headers %t1 \
-# RUN: | FileCheck %s --check-prefix=BASEREL-HEADER
+# RUN: | FileCheck %s --check-prefix=BASEREL1
#
# RUN: lld -flavor link /out:%t1 /subsystem:console /force /fixed -- %t.obj \
# RUN: && llvm-readobj -file-headers %t1 \
-# RUN: | FileCheck %s --check-prefix=NOBASEREL-HEADER
+# RUN: | FileCheck %s --check-prefix=BASEREL2
-BASEREL-HEADER: IMAGE_DLL_CHARACTERISTICS_DYNAMIC_BASE
+BASEREL1-NOT: IMAGE_FILE_RELOCS_STRIPPED
+BASEREL1: IMAGE_DLL_CHARACTERISTICS_DYNAMIC_BASE
-NOBASEREL-HEADER-NOT: IMAGE_DLL_CHARACTERISTICS_DYNAMIC_BASE
\ No newline at end of file
+BASEREL2: IMAGE_FILE_RELOCS_STRIPPED
+BASEREL2-NOT: IMAGE_DLL_CHARACTERISTICS_DYNAMIC_BASE
More information about the llvm-commits
mailing list