aboutsummaryrefslogtreecommitdiff
path: root/ELF/Target.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2017-01-04 22:11:50 +0000
committerDimitry Andric <dim@FreeBSD.org>2017-01-04 22:11:50 +0000
commit5d4d137132d719d0d20d119375b205d6a2c721ee (patch)
tree76f546a0733e158f9da39a4360937b4b59aa782d /ELF/Target.cpp
parentd93e1dfac8711cfed1a9d9cd1876a788b83945cd (diff)
Notes
Diffstat (limited to 'ELF/Target.cpp')
-rw-r--r--ELF/Target.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/ELF/Target.cpp b/ELF/Target.cpp
index edae7c65c1b4..d82e654b9c4c 100644
--- a/ELF/Target.cpp
+++ b/ELF/Target.cpp
@@ -1730,8 +1730,11 @@ void ARMTargetInfo::writePlt(uint8_t *Buf, uint64_t GotEntryAddr,
RelExpr ARMTargetInfo::getThunkExpr(RelExpr Expr, uint32_t RelocType,
const InputFile &File,
const SymbolBody &S) const {
- // If S is an undefined weak symbol we don't need a Thunk
- if (S.isUndefined())
+ // If S is an undefined weak symbol in an executable we don't need a Thunk.
+ // In a DSO calls to undefined symbols, including weak ones get PLT entries
+ // which may need a thunk.
+ if (S.isUndefined() && !S.isLocal() && S.symbol()->isWeak()
+ && !Config->Shared)
return Expr;
// A state change from ARM to Thumb and vice versa must go through an
// interworking thunk if the relocation type is not R_ARM_CALL or