[llvm-commits] [lld] r173299 - in /lld/trunk: lib/Driver/CoreOptions.td lib/ReaderWriter/ELF/AtomsELF.h test/elf/Inputs/ifunc.S test/elf/Inputs/ifunc.x86-64 test/elf/ifunc.test
Michael J. Spencer
bigcheesegs at gmail.com
Wed Jan 23 14:08:46 PST 2013
Author: mspencer
Date: Wed Jan 23 16:08:46 2013
New Revision: 173299
URL: http://llvm.org/viewvc/llvm-project?rev=173299&view=rev
Log:
[ELF] Read IFUNC symbols correctly as typeResolver.
Added:
lld/trunk/test/elf/Inputs/ifunc.S
lld/trunk/test/elf/Inputs/ifunc.x86-64
lld/trunk/test/elf/ifunc.test
Modified:
lld/trunk/lib/Driver/CoreOptions.td
lld/trunk/lib/ReaderWriter/ELF/AtomsELF.h
Modified: lld/trunk/lib/Driver/CoreOptions.td
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/Driver/CoreOptions.td?rev=173299&r1=173298&r2=173299&view=diff
==============================================================================
--- lld/trunk/lib/Driver/CoreOptions.td (original)
+++ lld/trunk/lib/Driver/CoreOptions.td Wed Jan 23 16:08:46 2013
@@ -1,5 +1,6 @@
include "llvm/Option/OptParser.td"
+def core : Flag<["-"], "core">;
def flavor : Separate<["-"], "flavor">;
def target : Separate<["-"], "target">, HelpText<"Target triple to link for">;
def mllvm : Separate<["-"], "mllvm">, HelpText<"Options to pass to LLVM">;
Modified: lld/trunk/lib/ReaderWriter/ELF/AtomsELF.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/AtomsELF.h?rev=173299&r1=173298&r2=173299&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/ELF/AtomsELF.h (original)
+++ lld/trunk/lib/ReaderWriter/ELF/AtomsELF.h Wed Jan 23 16:08:46 2013
@@ -236,6 +236,9 @@
ContentType ret = typeUnknown;
uint64_t flags = _section->sh_flags;
+ if (_symbol->getType() == llvm::ELF::STT_GNU_IFUNC)
+ return typeResolver;
+
if (_symbol->st_shndx == llvm::ELF::SHN_COMMON)
return typeZeroFill;
Added: lld/trunk/test/elf/Inputs/ifunc.S
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf/Inputs/ifunc.S?rev=173299&view=auto
==============================================================================
--- lld/trunk/test/elf/Inputs/ifunc.S (added)
+++ lld/trunk/test/elf/Inputs/ifunc.S Wed Jan 23 16:08:46 2013
@@ -0,0 +1,14 @@
+ .text
+ .globl hey;
+ .type hey, @function;
+hey:
+ .type hey, @gnu_indirect_function;
+ leaq __hey_1(%rip), %rax
+ ret
+
+ .text
+ .type __hey_1, @function;
+ .globl __hey_1;
+__hey_1:
+ movq $42, %rax
+ ret
Added: lld/trunk/test/elf/Inputs/ifunc.x86-64
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf/Inputs/ifunc.x86-64?rev=173299&view=auto
==============================================================================
Binary files lld/trunk/test/elf/Inputs/ifunc.x86-64 (added) and lld/trunk/test/elf/Inputs/ifunc.x86-64 Wed Jan 23 16:08:46 2013 differ
Added: lld/trunk/test/elf/ifunc.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf/ifunc.test?rev=173299&view=auto
==============================================================================
--- lld/trunk/test/elf/ifunc.test (added)
+++ lld/trunk/test/elf/ifunc.test Wed Jan 23 16:08:46 2013
@@ -0,0 +1,6 @@
+RUN: lld -core -target x86_64-linux -emit-yaml -output=- %p/Inputs/ifunc.x86-64 \
+RUN: | FileCheck %s
+
+CHECK: name: hey
+CHECK: scope: global
+CHECK: type: resolver
More information about the llvm-commits
mailing list