bug-binutils
[Top][All Lists]
Advanced

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

[Bug gold/10125] New: Fail to link "chained" shared objects


From: bugmenot at mailinator dot com
Subject: [Bug gold/10125] New: Fail to link "chained" shared objects
Date: 3 May 2009 23:09:36 -0000

See this simple example (with the old GNU ld):

$ cat a.c

#include <stdio.h>

void hello(void)
{
        printf("hello\n");
}

$ cat b.c

void hello(void);

void say_hello(void)
{
        hello();
}

$ cat c.c

void say_hello(void);

int main()
{
        say_hello();
        return 0;
}

$ gcc -fPIC -shared -o liba.so a.c
$ gcc -fPIC -shared -L. -la -o liba.so a.c
$ LD_LIBRARY_PATH=. gcc -lb -L. -o c c.c
$ LD_LIBRARY_PATH=. ./c
hello


Now when using gold, it fails to link the "c" program because it can't find the
reference to 'hello', found in liba.so:

$ gcc -fPIC -shared -o liba.so a.c
$ gcc -fPIC -shared -L. -la -o liba.so a.c
$ LD_LIBRARY_PATH=. gcc -lb -L. -o c c.c
/usr/bin/ld: ./libb.so: undefined reference to 'hello'
collect2: ld returned 1 exit status

Thanks.

-- 
           Summary: Fail to link "chained" shared objects
           Product: binutils
           Version: 2.19
            Status: NEW
          Severity: normal
          Priority: P2
         Component: gold
        AssignedTo: ian at airs dot com
        ReportedBy: bugmenot at mailinator dot com
                CC: bug-binutils at gnu dot org


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

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.




reply via email to

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