bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug ld/14591] New: Wrong symbol type with common symbol and weak functi


From: hjl.tools at gmail dot com
Subject: [Bug ld/14591] New: Wrong symbol type with common symbol and weak function
Date: Mon, 17 Sep 2012 16:16:13 +0000

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

             Bug #: 14591
           Summary: Wrong symbol type with common symbol and weak function
           Product: binutils
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: ld
        AssignedTo: address@hidden
        ReportedBy: address@hidden
    Classification: Unclassified


address@hidden pr14590]$ cat x.c 
#include <stdio.h>

int foo;
int
main ()
{
  foo = getchar ();
  return foo != 0;
}
address@hidden pr14590]$ cat y.c
void alt (void) { }

void foo (void);
void * foo_ifunc (void) __asm__ ("foo");
//__asm__(".type foo, %gnu_indirect_function");
__asm__(".weak foo");

void *
foo_ifunc (void)
{
  return alt;
}
address@hidden pr14590]$ make
gcc -B./ -g   -c -o x.o x.c
gcc -B./ -g   -c -o y.o y.c
gcc -B./ -static -o x x.o y.o
readelf -s --wide x | grep foo
  1793: 00000000006b4f70     4 FUNC    GLOBAL DEFAULT   26 foo
echo 0 | ./x
make: *** [all] Error 1
address@hidden pr14590]$ 

"foo" should be marked as OBJECT, not FUNC.

-- 
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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]