[PATCH] D12436: [ELFv2] Implement R_X86_64_32 relocation

Davide Italiano via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 28 09:29:58 PDT 2015


davide created this revision.
davide added reviewers: rafael, Bigcheese.
davide added a subscriber: llvm-commits.

More to come.

http://reviews.llvm.org/D12436

Files:
  ELF/Writer.cpp
  test/elf2/relocation.s

Index: test/elf2/relocation.s
===================================================================
--- test/elf2/relocation.s
+++ test/elf2/relocation.s
@@ -14,4 +14,13 @@
 .global lulz
 lulz:
 
+.global bar
+.text
+bar:
+  movl $bar, %edx // R_X86_64_32
+
+// R_X86_64_32
+// CHECK: bar:
+// CHECK:    1000: ba 00 10 00 00 movl $4096, %edx
+
 // CHECK: e8 04 00 00 00  callq   4
Index: ELF/Writer.cpp
===================================================================
--- ELF/Writer.cpp
+++ ELF/Writer.cpp
@@ -259,6 +259,9 @@
           support::endian::write32le(Base + Offset,
                                      SymVA + (RI.r_addend - (P + Offset)));
           break;
+        case llvm::ELF::R_X86_64_32:
+          support::endian::write32le(Base + Offset, SymVA + RI.r_addend);
+          break;
         default:
           llvm::errs() << Twine("unrecognized reloc ") + Twine(Type) << '\n';
           break;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D12436.33435.patch
Type: text/x-patch
Size: 921 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150828/d6feca9f/attachment.bin>


More information about the llvm-commits mailing list