[PECOFF] Fixed base images now have the IMAGE_FILE_RELOCS_STRIPPED flag

Patch by Ron Ofir.

llvm-svn: 188187
This commit is contained in:
Rui Ueyama 2013-08-12 18:11:35 +00:00
parent e23147bbd4
commit 43e5fd224a
2 changed files with 9 additions and 4 deletions

View File

@ -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.

View File

@ -19,12 +19,14 @@ NOBASEREL-SECTION-NOT: Contents of section .reloc:
# 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
BASEREL2: IMAGE_FILE_RELOCS_STRIPPED
BASEREL2-NOT: IMAGE_DLL_CHARACTERISTICS_DYNAMIC_BASE