[PATCH] Setting a symbol's type to function has no effect if its type is gnu_indirect_function.

Peter Collingbourne peter at pcc.me.uk
Mon Apr 1 18:44:54 PDT 2013


http://llvm-reviews.chandlerc.com/D607

Files:
  lib/MC/MCELFStreamer.cpp
  test/MC/ELF/type.s

Index: lib/MC/MCELFStreamer.cpp
===================================================================
--- lib/MC/MCELFStreamer.cpp
+++ lib/MC/MCELFStreamer.cpp
@@ -187,7 +187,8 @@
     break;
 
   case MCSA_ELF_TypeFunction:
-    MCELF::SetType(SD, ELF::STT_FUNC);
+    if (MCELF::GetType(SD) != ELF::STT_GNU_IFUNC)
+      MCELF::SetType(SD, ELF::STT_FUNC);
     break;
 
   case MCSA_ELF_TypeIndFunction:
Index: test/MC/ELF/type.s
===================================================================
--- test/MC/ELF/type.s
+++ test/MC/ELF/type.s
@@ -15,6 +15,7 @@
 ifunc:
         .global ifunc
         .type ifunc, at gnu_indirect_function
+        .type ifunc, at function
 
 // CHECK:      # Symbol 4
 // CHECK-NEXT: (('st_name', 0x00000005) # 'bar'
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D607.1.patch
Type: text/x-patch
Size: 746 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130401/5ab8302e/attachment.bin>


More information about the llvm-commits mailing list