Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
11de49f
[𝘀𝗽𝗿] changes to main this commit is based on
pcc Mar 28, 2025
d70efad
[𝘀𝗽𝗿] initial version
pcc Mar 28, 2025
dd8803d
[𝘀𝗽𝗿] changes introduced through rebase
pcc Apr 10, 2025
2d015de
Fix bugs and add test
pcc Apr 10, 2025
96e7da9
Undo unnecessary change
pcc Apr 10, 2025
cf11f92
[𝘀𝗽𝗿] changes introduced through rebase
pcc Apr 10, 2025
b7b6140
Add comments
pcc Apr 10, 2025
bd3f5d7
[𝘀𝗽𝗿] changes introduced through rebase
pcc May 13, 2025
6b8482a
Implement new proposal
pcc May 13, 2025
818d4ca
[𝘀𝗽𝗿] changes introduced through rebase
pcc May 24, 2025
38bbafd
Rebase
pcc May 24, 2025
e1922f6
[𝘀𝗽𝗿] changes introduced through rebase
pcc Jul 9, 2025
e137c55
Rebase
pcc Jul 9, 2025
914393d
[𝘀𝗽𝗿] changes introduced through rebase
pcc Jul 10, 2025
3b3df34
Fix test
pcc Jul 10, 2025
643eb35
[𝘀𝗽𝗿] changes introduced through rebase
pcc Jul 11, 2025
a0d52fa
Rebase
pcc Jul 11, 2025
a7ac801
[𝘀𝗽𝗿] changes introduced through rebase
pcc Jul 19, 2025
3b1139d
Update relocation type number
pcc Jul 19, 2025
3029464
[𝘀𝗽𝗿] changes introduced through rebase
pcc Jul 30, 2025
d5b7987
Rebase
pcc Jul 30, 2025
9fa7de1
[𝘀𝗽𝗿] changes introduced through rebase
pcc Aug 1, 2025
5668bff
Rebase
pcc Aug 1, 2025
b33113c
Fix build
pcc Aug 1, 2025
d0b8663
[𝘀𝗽𝗿] changes introduced through rebase
pcc Sep 3, 2025
7cb284e
Rebase
pcc Sep 3, 2025
1137b9e
Split out lld changes
pcc Sep 3, 2025
48a46e8
[𝘀𝗽𝗿] changes introduced through rebase
igorkudrin Oct 9, 2025
970703d
Rebase
pcc Oct 9, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions llvm/include/llvm/BinaryFormat/ELFRelocs/AArch64.def
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ ELF_RELOC(R_AARCH64_LD64_GOTPAGE_LO15, 0x139)
ELF_RELOC(R_AARCH64_PLT32, 0x13a)
ELF_RELOC(R_AARCH64_GOTPCREL32, 0x13b)
ELF_RELOC(R_AARCH64_PATCHINST, 0x13c)
ELF_RELOC(R_AARCH64_FUNCINIT64, 0x13d)
// General dynamic TLS relocations
ELF_RELOC(R_AARCH64_TLSGD_ADR_PREL21, 0x200)
ELF_RELOC(R_AARCH64_TLSGD_ADR_PAGE21, 0x201)
Expand Down
2 changes: 2 additions & 0 deletions llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8217,6 +8217,8 @@ bool AArch64AsmParser::parseDataExpr(const MCExpr *&Res) {
Spec = AArch64::S_GOTPCREL;
else if (Identifier == "plt")
Spec = AArch64::S_PLT;
else if (Identifier == "funcinit")
Spec = AArch64::S_FUNCINIT;
}
if (Spec == AArch64::S_None)
return Error(Loc, "invalid relocation specifier");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,8 @@ unsigned AArch64ELFObjectWriter::getRelocType(const MCFixup &Fixup,
}
if (RefKind == AArch64::S_AUTH || RefKind == AArch64::S_AUTHADDR)
return ELF::R_AARCH64_AUTH_ABS64;
if (RefKind == AArch64::S_FUNCINIT)
return ELF::R_AARCH64_FUNCINIT64;
return ELF::R_AARCH64_ABS64;
}
case AArch64::fixup_aarch64_add_imm12:
Expand Down
1 change: 1 addition & 0 deletions llvm/lib/Target/AArch64/MCTargetDesc/AArch64MCAsmInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ const MCAsmInfo::AtSpecifier ELFAtSpecifiers[] = {
{AArch64::S_GOT, "GOT"},
{AArch64::S_GOTPCREL, "GOTPCREL"},
{AArch64::S_PLT, "PLT"},
{AArch64::S_FUNCINIT, "FUNCINIT"},
};

const MCAsmInfo::AtSpecifier MachOAtSpecifiers[] = {
Expand Down
1 change: 1 addition & 0 deletions llvm/lib/Target/AArch64/MCTargetDesc/AArch64MCAsmInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ enum {
// ELF relocation specifiers in data directives:
S_PLT = 0x400,
S_GOTPCREL,
S_FUNCINIT,

// Mach-O @ relocation specifiers:
S_MACHO_GOT,
Expand Down
3 changes: 3 additions & 0 deletions llvm/test/MC/AArch64/data-directive-specifier.s
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ l:
# CHECK-NEXT: 0x8 R_AARCH64_PLT32 extern 0x4
# CHECK-NEXT: 0xC R_AARCH64_PLT32 g 0x8
# CHECK-NEXT: 0x10 R_AARCH64_PLT32 g 0x18
# CHECK-NEXT: 0x14 R_AARCH64_FUNCINIT64 .text 0x0
# CHECK-NEXT: }
.data
.word l@plt - .
Expand All @@ -21,6 +22,8 @@ l:
.word g@plt - . + 8
.word g@plt - .data + 8

.quad l@funcinit

# CHECK: Section ({{.*}}) .rela.data1 {
# CHECK-NEXT: 0x0 R_AARCH64_GOTPCREL32 data1 0x0
# CHECK-NEXT: 0x4 R_AARCH64_GOTPCREL32 extern 0x4
Expand Down
Loading