aboutsummaryrefslogtreecommitdiff
path: root/lld/ELF/InputSection.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2021-02-16 20:39:22 +0000
committerDimitry Andric <dim@FreeBSD.org>2021-02-16 20:39:22 +0000
commit9f93bc8bfd2690abd12a830e42a1c26038173ae5 (patch)
tree397432940f35d42b709d99d1d23523e7a24296c4 /lld/ELF/InputSection.cpp
parentb60736ec1405bb0a8dd40989f67ef4c93da068ab (diff)
Vendor import of llvm-project branch release/12.xvendor/llvm-project/llvmorg-12.0.0-rc1-109-gd5d089bf08c9
llvmorg-12.0.0-rc1-109-gd5d089bf08c9.
Diffstat (limited to 'lld/ELF/InputSection.cpp')
-rw-r--r--lld/ELF/InputSection.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/lld/ELF/InputSection.cpp b/lld/ELF/InputSection.cpp
index f40bb258b9af..6f16fc7abc48 100644
--- a/lld/ELF/InputSection.cpp
+++ b/lld/ELF/InputSection.cpp
@@ -901,7 +901,10 @@ void InputSection::relocateNonAlloc(uint8_t *buf, ArrayRef<RelTy> rels) {
continue;
}
- if (expr != R_ABS && expr != R_DTPREL && expr != R_RISCV_ADD) {
+ // R_ABS/R_DTPREL and some other relocations can be used from non-SHF_ALLOC
+ // sections.
+ if (expr != R_ABS && expr != R_DTPREL && expr != R_GOTPLTREL &&
+ expr != R_RISCV_ADD) {
std::string msg = getLocation<ELFT>(offset) +
": has non-ABS relocation " + toString(type) +
" against symbol '" + toString(sym) + "'";