bug-binutils
[Top][All Lists]
Advanced

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

[Bug ld/19553] linking against libs that require pthreads breaks due to


From: hjl.tools at gmail dot com
Subject: [Bug ld/19553] linking against libs that require pthreads breaks due to symbol changes
Date: Mon, 01 Feb 2016 16:20:57 +0000

https://sourceware.org/bugzilla/show_bug.cgi?id=19553

--- Comment #1 from H.J. Lu <hjl.tools at gmail dot com> ---
address@hidden pr19553]$ cat pr19553a.c
extern void foo (void);

int
main (void)
{
  foo ();
  return 0;
}
address@hidden pr19553]$ cat pr19553b.c
#include <stdio.h>

__attribute__ ((weak))
void
foo (void)
{
  printf ("pr19553b\n");
}
address@hidden pr19553]$ cat pr19553c.c
#include <stdio.h>

void
foo (void)
{
  printf ("pr19553c\n");
}

asm (".symver foo,address@hidden");
address@hidden pr19553]$ cat pr19553d.c
#include <stdio.h>

__attribute__ ((weak))
void
foo (void)
{
  printf ("pr19553d\n");
}
address@hidden pr19553]$ cat pr19553.map
FOO
{
global:
  foo;
};
address@hidden pr19553]$ make
gcc -B./ -O2 -O2 -c -o pr19553a.o pr19553a.c
gcc -B./ -O2 -fPIC -c -o pr19553d.o pr19553d.c
gcc -B./ -O2 -fPIC -c -o pr19553c.o pr19553c.c
gcc -B./ -shared -o libpr19553c.so pr19553c.o -Wl,--version-script=pr19553.map
gcc -B./ -shared -o libpr19553d.so pr19553d.o  libpr19553c.so
gcc -B./ -O2 -fPIC -c -o pr19553b.o pr19553b.c
gcc -B./ -shared -o libpr19553b.so pr19553b.o -Wl,--version-script=pr19553.map
gcc -B./ -o x pr19553a.o libpr19553d.so libpr19553b.so -Wl,-R.
./ld: libpr19553d.so: undefined reference to symbol 'address@hidden'
./libpr19553c.so: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
Makefile:23: recipe for target 'x' failed
make: *** [x] Error 1
address@hidden pr19553]$

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