Skip to content

Commit a6cc36b

Browse files
committed
Revert "Partially revert "[llvm][lld] Support R_AARCH64_GOTPCREL32 (llvm#72584)""
This reverts commit f1cbfe9, which ended up causing other failures.
1 parent 0271f38 commit a6cc36b

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

llvm/lib/Target/AArch64/MCTargetDesc/AArch64ELFObjectWriter.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,10 @@ unsigned AArch64ELFObjectWriter::getRelocType(MCContext &Ctx,
206206
case FK_Data_2:
207207
return R_CLS(ABS16);
208208
case FK_Data_4:
209-
return R_CLS(ABS32);
209+
return (!IsILP32 &&
210+
Target.getAccessVariant() == MCSymbolRefExpr::VK_GOTPCREL)
211+
? ELF::R_AARCH64_GOTPCREL32
212+
: R_CLS(ABS32);
210213
case FK_Data_8: {
211214
bool IsAuth = (RefKind == AArch64MCExpr::VK_AUTH ||
212215
RefKind == AArch64MCExpr::VK_AUTHADDR);

llvm/test/MC/AArch64/elf-reloc-gotpcrel32.s

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// XFAIL: !rdar135050296
2-
31
// RUN: llvm-mc -triple=aarch64 -filetype=obj %s -o - | \
42
// RUN: llvm-readobj -r - | FileCheck %s
53

0 commit comments

Comments
 (0)