http://sourceware.org/bugzilla/show_bug.cgi?id=12694

           Summary: Local IFUNC symbol causes TEXTREL
           Product: binutils
           Version: 2.22 (HEAD)
            Status: NEW
          Severity: normal
          Priority: P2
         Component: ld
        AssignedTo: unassig...@sources.redhat.com
        ReportedBy: hjl.to...@gmail.com


[hjl@gnu-6 ifunc-textrel]$ make clean
rm -f *.o *.so
[hjl@gnu-6 ifunc-textrel]$ cat foo.c
static int
zero (int x) 
{
  return 0;
}

void * foo_ifunc (void) __asm__ ("foo");
void * foo_ifunc (void) { return zero; }
__asm__(".type foo, %gnu_indirect_function");
[hjl@gnu-6 ifunc-textrel]$ cat bar.c
extern int foo (void) __attribute__ ((visibility ("hidden")));

int
bar (void)
{
  return foo ();
}

int
bar2 ()
{
  return foo () + 3;
}
[hjl@gnu-6 ifunc-textrel]$ make
gcc -m32 -O2 -fPIC   -c -o bar.o bar.c
gcc -m32 -O2 -fPIC   -c -o foo.o foo.c
./ld -m elf_i386 -z nocombreloc -shared -o libfoo.so bar.o foo.o
--version-script=libfoo.map
readelf -d libfoo.so | grep TEXTREL
 0x00000016 (TEXTREL)                    0x0

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

_______________________________________________
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils

Reply via email to