diff options
author | Rui Ueyama <ruiu@google.com> | 2015-07-28 02:54:18 +0000 |
---|---|---|
committer | Rui Ueyama <ruiu@google.com> | 2015-07-28 02:54:18 +0000 |
commit | 7e387a68debc8b453811638b78edc0e0f525b7f5 (patch) | |
tree | f4925523a7332807c4d686f6f7cc0361763d2534 /lld/COFF/DLL.cpp | |
parent | cee4d85faf8abbfd29d707ddace1dd7990a0e92c (diff) | |
download | bcm5719-llvm-7e387a68debc8b453811638b78edc0e0f525b7f5.tar.gz bcm5719-llvm-7e387a68debc8b453811638b78edc0e0f525b7f5.zip |
COFF: Fix 32-bit delay-import address table.
The address table entry is 32-bit wide on 32-bit and 64-bit on 64-bit.
Previously, it was 64-bit even on 32-bit.
llvm-svn: 243372
Diffstat (limited to 'lld/COFF/DLL.cpp')
-rw-r--r-- | lld/COFF/DLL.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lld/COFF/DLL.cpp b/lld/COFF/DLL.cpp index 0e3c969c4f3..4bcec2430be 100644 --- a/lld/COFF/DLL.cpp +++ b/lld/COFF/DLL.cpp @@ -361,10 +361,14 @@ uint64_t DelayLoadContents::getDirSize() { class DelayAddressChunk : public Chunk { public: explicit DelayAddressChunk(Chunk *C) : Thunk(C) {} - size_t getSize() const override { return 8; } + size_t getSize() const override { return ptrSize(); } void writeTo(uint8_t *Buf) override { - write64le(Buf + FileOff, Thunk->getRVA() + Config->ImageBase); + if (Config->is64()) { + write64le(Buf + FileOff, Thunk->getRVA() + Config->ImageBase); + } else { + write32le(Buf + FileOff, Thunk->getRVA() + Config->ImageBase); + } } void getBaserels(std::vector<Baserel> *Res) override { |