diff options
| author | Martin Storsjo <martin@martin.st> | 2017-12-20 06:50:45 +0000 |
|---|---|---|
| committer | Martin Storsjo <martin@martin.st> | 2017-12-20 06:50:45 +0000 |
| commit | 6528fb8691730673a8e3483437a8a6dca55d1805 (patch) | |
| tree | cef0b2abda966144d2314bbf3d2d43e56bf14cbc /lld/COFF/DLL.cpp | |
| parent | 158d54d9545f5fd54aea587732a9cbf7360d6b0e (diff) | |
| download | bcm5719-llvm-6528fb8691730673a8e3483437a8a6dca55d1805.tar.gz bcm5719-llvm-6528fb8691730673a8e3483437a8a6dca55d1805.zip | |
[COFF] Don't set the thumb bit in address table entries for data symbols
The thumb bit should only be set for executable code.
Differential Revision: https://reviews.llvm.org/D41379
llvm-svn: 321149
Diffstat (limited to 'lld/COFF/DLL.cpp')
| -rw-r--r-- | lld/COFF/DLL.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lld/COFF/DLL.cpp b/lld/COFF/DLL.cpp index 847d15d8594..19583913967 100644 --- a/lld/COFF/DLL.cpp +++ b/lld/COFF/DLL.cpp @@ -362,12 +362,12 @@ public: size_t getSize() const override { return Size * 4; } void writeTo(uint8_t *Buf) const override { - uint32_t Bit = 0; - // Pointer to thumb code must have the LSB set, so adjust it. - if (Config->Machine == ARMNT) - Bit = 1; - for (Export &E : Config->Exports) { + for (const Export &E : Config->Exports) { uint8_t *P = Buf + OutputSectionOff + E.Ordinal * 4; + uint32_t Bit = 0; + // Pointer to thumb code must have the LSB set, so adjust it. + if (Config->Machine == ARMNT && !E.Data) + Bit = 1; if (E.ForwardChunk) { write32le(P, E.ForwardChunk->getRVA() | Bit); } else { |

