[PATCH] D35119: [ELF] Fix functionality treating IFunc definitions in DSOs as functions.

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 11 04:41:23 PDT 2017


This revision was automatically updated to reflect the committed changes.
Closed by commit rL307652: [ELF] - Fix functionality treating IFunc definitions in DSOs as functions. (authored by grimar).

Changed prior to commit:
  https://reviews.llvm.org/D35119?vs=105622&id=106003#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D35119

Files:
  lld/trunk/ELF/Symbols.h
  lld/trunk/test/ELF/Inputs/gnu-ifunc-dso.s
  lld/trunk/test/ELF/gnu-ifunc-dso.s


Index: lld/trunk/ELF/Symbols.h
===================================================================
--- lld/trunk/ELF/Symbols.h
+++ lld/trunk/ELF/Symbols.h
@@ -218,7 +218,7 @@
         Verdef(Verdef), ElfSym(ElfSym) {
     // IFuncs defined in DSOs are treated as functions by the static linker.
     if (isGnuIFunc())
-      Type = llvm::ELF::STT_FUNC;
+      this->Type = llvm::ELF::STT_FUNC;
     this->File = File;
   }
 
Index: lld/trunk/test/ELF/gnu-ifunc-dso.s
===================================================================
--- lld/trunk/test/ELF/gnu-ifunc-dso.s
+++ lld/trunk/test/ELF/gnu-ifunc-dso.s
@@ -0,0 +1,13 @@
+# REQUIRES: x86
+# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %S/Inputs/gnu-ifunc-dso.s -o %t1.o
+# RUN: ld.lld -shared %t1.o -o %t.so
+# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t2.o
+# RUN: ld.lld -shared %t2.o %t.so -o %t
+# RUN: llvm-readobj -dyn-relocations %t | FileCheck %s
+
+# CHECK:      Dynamic Relocations {
+# CHECK-NEXT:   0x1000 R_X86_64_64 foo 0x0
+# CHECK-NEXT: }
+
+.data
+ .quad foo
Index: lld/trunk/test/ELF/Inputs/gnu-ifunc-dso.s
===================================================================
--- lld/trunk/test/ELF/Inputs/gnu-ifunc-dso.s
+++ lld/trunk/test/ELF/Inputs/gnu-ifunc-dso.s
@@ -0,0 +1,3 @@
+.type foo STT_GNU_IFUNC
+.globl foo
+foo:


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D35119.106003.patch
Type: text/x-patch
Size: 1326 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170711/28196b53/attachment.bin>


More information about the llvm-commits mailing list