[lld] r288485 - Ignore R_X86_64_NONE.
Rafael Espindola via llvm-commits
llvm-commits at lists.llvm.org
Fri Dec 2 00:00:10 PST 2016
Author: rafael
Date: Fri Dec 2 02:00:09 2016
New Revision: 288485
URL: http://llvm.org/viewvc/llvm-project?rev=288485&view=rev
Log:
Ignore R_X86_64_NONE.
It looks like the way dtrace works is
* The user creates .o files that reference magical symbol names.
* dtrace reads those files, collecs the info it needs and changes the
relocation to R_X86_64_NONE expecting the linker to ignore them.
Added:
lld/trunk/test/ELF/relocation-dtrace.test
Modified:
lld/trunk/ELF/Target.cpp
Modified: lld/trunk/ELF/Target.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Target.cpp?rev=288485&r1=288484&r2=288485&view=diff
==============================================================================
--- lld/trunk/ELF/Target.cpp (original)
+++ lld/trunk/ELF/Target.cpp Fri Dec 2 02:00:09 2016
@@ -595,6 +595,8 @@ RelExpr X86_64TargetInfo<ELFT>::getRelEx
case R_X86_64_REX_GOTPCRELX:
case R_X86_64_GOTTPOFF:
return R_GOT_PC;
+ case R_X86_64_NONE:
+ return R_HINT;
}
}
Added: lld/trunk/test/ELF/relocation-dtrace.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/relocation-dtrace.test?rev=288485&view=auto
==============================================================================
--- lld/trunk/test/ELF/relocation-dtrace.test (added)
+++ lld/trunk/test/ELF/relocation-dtrace.test Fri Dec 2 02:00:09 2016
@@ -0,0 +1,24 @@
+# RUN: yaml2obj %s -o %t.o
+# RUN: ld.lld -shared %t.o -o %t.so
+
+# Test that we can handle R_X86_64_NONE as produced by dtrace.
+
+!ELF
+FileHeader:
+ Class: ELFCLASS64
+ Data: ELFDATA2LSB
+ OSABI: ELFOSABI_FREEBSD
+ Type: ET_REL
+ Machine: EM_X86_64
+Sections:
+ - Name: .text
+ Type: SHT_PROGBITS
+ Flags: [ SHF_ALLOC ]
+ - Name: .rela.text
+ Type: SHT_RELA
+ Link: .symtab
+ Info: .text
+ Relocations:
+ - Offset: 0x0000000000000000
+ Symbol: ''
+ Type: R_X86_64_NONE
More information about the llvm-commits
mailing list