Block &BlockToFix) {
using Base = ELFLinkGraphBuilder<ELFT>;
+ auto ELFReloc = Rel.getType(false);
+
+ // R_X86_64_NONE is a no-op.
+ if (LLVM_UNLIKELY(ELFReloc == ELF::R_X86_64_NONE))
+ return Error::success();
+
uint32_t SymbolIndex = Rel.getSymbol(false);
auto ObjSymbol = Base::Obj.getRelocationSymbol(Rel, Base::SymTabSec);
if (!ObjSymbol)
int64_t Addend = Rel.r_addend;
Edge::Kind Kind = Edge::Invalid;
- auto ELFReloc = Rel.getType(false);
switch (ELFReloc) {
case ELF::R_X86_64_PC32:
Kind = x86_64::Delta32;
--- /dev/null
+# RUN: yaml2obj -o %t.o %s
+# RUN: llvm-jitlink -noexec -check=%s %t.o
+#
+# Check that R_X86_64_NONE relocations are handled without modifying the fixup
+# location.
+
+# jitlink-check: *{8}P = 42
+
+--- !ELF
+FileHeader:
+ Class: ELFCLASS64
+ Data: ELFDATA2LSB
+ Type: ET_REL
+ Machine: EM_X86_64
+ SectionHeaderStringTable: .strtab
+Sections:
+ - Name: .text
+ Type: SHT_PROGBITS
+ Flags: [ SHF_ALLOC, SHF_EXECINSTR ]
+ AddressAlign: 0x4
+ - Name: .text.main
+ Type: SHT_PROGBITS
+ Flags: [ SHF_ALLOC, SHF_EXECINSTR ]
+ AddressAlign: 0x10
+ Content: 31C0C3
+ - Name: .data
+ Type: SHT_PROGBITS
+ Flags: [ SHF_WRITE, SHF_ALLOC ]
+ AddressAlign: 0x8
+ Content: '2A00000000000000'
+ - Name: .rela.data
+ Type: SHT_RELA
+ Flags: [ SHF_INFO_LINK ]
+ Link: .symtab
+ AddressAlign: 0x8
+ Info: .data
+ Relocations:
+ - Symbol: P
+ Type: R_X86_64_NONE
+ - Type: SectionHeaderTable
+ Sections:
+ - Name: .strtab
+ - Name: .text
+ - Name: .text.main
+ - Name: .data
+ - Name: .rela.data
+ - Name: .symtab
+Symbols:
+ - Name: main
+ Type: STT_FUNC
+ Section: .text.main
+ Binding: STB_GLOBAL
+ Size: 0x3
+ - Name: P
+ Type: STT_OBJECT
+ Section: .data
+ Binding: STB_GLOBAL
+ Size: 0x8
+...