summaryrefslogtreecommitdiffstats
path: root/lld/COFF/DLL.cpp
diff options
context:
space:
mode:
authorMartin Storsjo <martin@martin.st>2017-12-20 06:50:45 +0000
committerMartin Storsjo <martin@martin.st>2017-12-20 06:50:45 +0000
commit6528fb8691730673a8e3483437a8a6dca55d1805 (patch)
treecef0b2abda966144d2314bbf3d2d43e56bf14cbc /lld/COFF/DLL.cpp
parent158d54d9545f5fd54aea587732a9cbf7360d6b0e (diff)
downloadbcm5719-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.cpp10
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 {
OpenPOWER on IntegriCloud