summaryrefslogtreecommitdiff
path: root/contrib/llvm/tools/lld/ELF/Thunks.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2017-06-10 19:17:14 +0000
committerDimitry Andric <dim@FreeBSD.org>2017-06-10 19:17:14 +0000
commitdb17bf38c59bc172953ed66cfe1b10c03c6bc383 (patch)
tree2712281fec99b99c2fcafd5b46439dfdd93261aa /contrib/llvm/tools/lld/ELF/Thunks.cpp
parent686fb94a00297bf9ff49d93b948925552a2ce8e0 (diff)
parent7ab83427af0f77b59941ceba41d509d7d097b065 (diff)
Notes
Diffstat (limited to 'contrib/llvm/tools/lld/ELF/Thunks.cpp')
-rw-r--r--contrib/llvm/tools/lld/ELF/Thunks.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/contrib/llvm/tools/lld/ELF/Thunks.cpp b/contrib/llvm/tools/lld/ELF/Thunks.cpp
index da2b13677513..752a881d7867 100644
--- a/contrib/llvm/tools/lld/ELF/Thunks.cpp
+++ b/contrib/llvm/tools/lld/ELF/Thunks.cpp
@@ -30,8 +30,8 @@
#include "Symbols.h"
#include "SyntheticSections.h"
#include "Target.h"
+#include "llvm/BinaryFormat/ELF.h"
#include "llvm/Support/Casting.h"
-#include "llvm/Support/ELF.h"
#include "llvm/Support/Endian.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/MathExtras.h"
@@ -143,7 +143,7 @@ void ThumbV7ABSLongThunk::writeTo(uint8_t *Buf, ThunkSection &IS) const {
void ThumbV7ABSLongThunk::addSymbols(ThunkSection &IS) {
ThunkSym = addSyntheticLocal(
Saver.save("__Thumbv7ABSLongThunk_" + Destination.getName()), STT_FUNC,
- Offset, size(), &IS);
+ Offset | 0x1, size(), &IS);
addSyntheticLocal("$t", STT_NOTYPE, Offset, 0, &IS);
}
@@ -176,7 +176,7 @@ void ThumbV7PILongThunk::writeTo(uint8_t *Buf, ThunkSection &IS) const {
0x60, 0x47, // bx r12
};
uint64_t S = getARMThunkDestVA(Destination);
- uint64_t P = ThunkSym->getVA();
+ uint64_t P = ThunkSym->getVA() & ~0x1;
memcpy(Buf, Data, sizeof(Data));
Target->relocateOne(Buf, R_ARM_THM_MOVW_PREL_NC, S - P - 12);
Target->relocateOne(Buf + 4, R_ARM_THM_MOVT_PREL, S - P - 8);
@@ -185,7 +185,7 @@ void ThumbV7PILongThunk::writeTo(uint8_t *Buf, ThunkSection &IS) const {
void ThumbV7PILongThunk::addSymbols(ThunkSection &IS) {
ThunkSym = addSyntheticLocal(
Saver.save("__ThumbV7PILongThunk_" + Destination.getName()), STT_FUNC,
- Offset, size(), &IS);
+ Offset | 0x1, size(), &IS);
addSyntheticLocal("$t", STT_NOTYPE, Offset, 0, &IS);
}