[PATCH] D83138: [ELF][ARM] Represent R_ARM_LDO32 as R_DTPREL instead of R_ABS
Fangrui Song via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Jul 3 10:12:43 PDT 2020
MaskRay created this revision.
MaskRay added reviewers: grimar, psmith, ruiu.
Herald added subscribers: llvm-commits, danielkiss, kristof.beyls, arichardson, emaste.
Herald added a reviewer: espindola.
Herald added a project: LLVM.
Follow-up to D82899 <https://reviews.llvm.org/D82899>. Note, we need to disable R_DTPREL relaxation
because ARM psABI does not define TLS relaxation.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D83138
Files:
lld/ELF/Arch/ARM.cpp
lld/ELF/Relocations.cpp
lld/test/ELF/debug-dead-reloc-tls-arm.s
Index: lld/test/ELF/debug-dead-reloc-tls-arm.s
===================================================================
--- lld/test/ELF/debug-dead-reloc-tls-arm.s
+++ lld/test/ELF/debug-dead-reloc-tls-arm.s
@@ -7,8 +7,7 @@
# RUN: llvm-objdump -s %t | FileCheck %s
# CHECK: Contents of section .debug_info:
-## FIXME: Use ffffffff
-# CHECK-NEXT: 0000 00000000
+# CHECK-NEXT: 0000 ffffffff
.globl _start
_start:
Index: lld/ELF/Relocations.cpp
===================================================================
--- lld/ELF/Relocations.cpp
+++ lld/ELF/Relocations.cpp
@@ -238,7 +238,7 @@
}
// Local-Dynamic relocs can be relaxed to Local-Exec.
- if (expr == R_DTPREL && !config->shared) {
+ if (expr == R_DTPREL && canRelax && !config->shared) {
c.relocations.push_back(
{target->adjustRelaxExpr(type, nullptr, R_RELAX_TLS_LD_TO_LE), type,
offset, addend, &sym});
Index: lld/ELF/Arch/ARM.cpp
===================================================================
--- lld/ELF/Arch/ARM.cpp
+++ lld/ELF/Arch/ARM.cpp
@@ -121,6 +121,8 @@
return R_TLSGD_PC;
case R_ARM_TLS_LDM32:
return R_TLSLD_PC;
+ case R_ARM_TLS_LDO32:
+ return R_DTPREL;
case R_ARM_BASE_PREL:
// B(S) + A - P
// FIXME: currently B(S) assumed to be .got, this may not hold for all
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D83138.275426.patch
Type: text/x-patch
Size: 1314 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200703/7ed7543f/attachment.bin>
More information about the llvm-commits
mailing list