diff options
Diffstat (limited to 'COFF/DLL.cpp')
-rw-r--r-- | COFF/DLL.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/COFF/DLL.cpp b/COFF/DLL.cpp index 847d15d8594a2..195839139670b 100644 --- a/COFF/DLL.cpp +++ b/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 { |