summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lld/COFF/Chunks.cpp2
-rw-r--r--lld/test/COFF/locally-imported.test13
2 files changed, 13 insertions, 2 deletions
diff --git a/lld/COFF/Chunks.cpp b/lld/COFF/Chunks.cpp
index 0c4e99acdd7..873d2a7be0d 100644
--- a/lld/COFF/Chunks.cpp
+++ b/lld/COFF/Chunks.cpp
@@ -263,7 +263,7 @@ void ImportThunkChunk::writeTo(uint8_t *Buf) {
void LocalImportChunk::getBaserels(std::vector<uint32_t> *Res,
Defined *ImageBase) {
- Res->push_back(getRVA() + Config->ImageBase);
+ Res->push_back(getRVA());
}
size_t LocalImportChunk::getSize() const {
diff --git a/lld/test/COFF/locally-imported.test b/lld/test/COFF/locally-imported.test
index 7f985536e7a..406a4a66eed 100644
--- a/lld/test/COFF/locally-imported.test
+++ b/lld/test/COFF/locally-imported.test
@@ -1,13 +1,24 @@
# RUN: yaml2obj < %s > %t.obj
# RUN: lld -flavor link2 /out:%t.exe /entry:main %t.obj
# RUN: llvm-objdump -s %t.exe | FileCheck %s
+# RUN: llvm-readobj -coff-basereloc %t.exe | FileCheck -check-prefix=BASEREL %s
# CHECK: Contents of section .text:
# CHECK-NEXT: 1000 00200000
-
# CHECK: Contents of section .rdata:
# CHECK-NEXT: 2000 04100040 01000000
+# BASEREL: BaseReloc [
+# BASEREL-NEXT: Entry {
+# BASEREL-NEXT: Type: DIR64
+# BASEREL-NEXT: Address: 0x2000
+# BASEREL-NEXT: }
+# BASEREL-NEXT: Entry {
+# BASEREL-NEXT: Type: ABSOLUTE
+# BASEREL-NEXT: Address: 0x2000
+# BASEREL-NEXT: }
+# BASEREL-NEXT: ]
+
---
header:
Machine: IMAGE_FILE_MACHINE_AMD64
OpenPOWER on IntegriCloud