[PATCH] D102986: [lld][ELF][SPARC] Emit RELA entries
LemonBoy via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sun May 23 09:52:05 PDT 2021
LemonBoy created this revision.
LemonBoy added reviewers: jrtc27, MaskRay.
Herald added subscribers: s.egerton, simoncook, fedor.sergeev, arichardson, emaste, jyknight.
LemonBoy requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
Emit RELA entries as specified by the V9 ABI.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D102986
Files:
lld/ELF/Driver.cpp
lld/test/ELF/sparcv9-rela.s
Index: lld/test/ELF/sparcv9-rela.s
===================================================================
--- /dev/null
+++ lld/test/ELF/sparcv9-rela.s
@@ -0,0 +1,8 @@
+// REQUIRES: sparc
+// RUN: llvm-mc --position-independent -filetype=obj -arch=sparcv9 %s -o %t.o
+// RUN: ld.lld %t.o -o %t.so -shared
+// RUN: llvm-readobj --dynamic-table %t.so | FileCheck %s
+
+sethi %hi(x), %o1
+
+// CHECK: 0x{{0+}}7 RELA
Index: lld/ELF/Driver.cpp
===================================================================
--- lld/ELF/Driver.cpp
+++ lld/ELF/Driver.cpp
@@ -926,7 +926,7 @@
// Otherwise use the psABI defined relocation entry format.
uint16_t m = config->emachine;
return m == EM_AARCH64 || m == EM_AMDGPU || m == EM_HEXAGON || m == EM_PPC ||
- m == EM_PPC64 || m == EM_RISCV || m == EM_X86_64;
+ m == EM_PPC64 || m == EM_RISCV || m == EM_SPARCV9 || m == EM_X86_64;
}
static void parseClangOption(StringRef opt, const Twine &msg) {
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D102986.347253.patch
Type: text/x-patch
Size: 958 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210523/25129129/attachment.bin>
More information about the llvm-commits
mailing list