elf_link_check_versioned_symbol
H . J . Lu
hjl@lucon.org
Fri Jun 21 09:40:00 GMT 2002
On Fri, Jun 21, 2002 at 04:10:22PM +0930, Alan Modra wrote:
> Hi H.J.,
> I've tidied up one of your binutils patches that hasn't been
> applied to sourceware, and I'd like you to check that the changes
> are OK. The main functional difference I made is that
> elf_link_check_versioned_symbol now counts the number of matching
> versioned symbols, as ld.so does.
>
The change is wrong. Here is a testcase. Now I got
# make
gcc -B./ -c -o foo.o foo.c
gcc: file path prefix `./' never used
gcc -B./ -fPIC -c b.c
gcc: file path prefix `./' never used
gcc -B./ -fPIC -c a.c
gcc: file path prefix `./' never used
gcc -B./ -fPIC -c c.c
gcc: file path prefix `./' never used
gcc -B./ -shared -o lib-c.so c.o
gcc: file path prefix `./' never used
gcc -B./ -shared -o lib-a.so a.o lib-c.so
gcc: file path prefix `./' never used
gcc -B./ -shared -o lib-b.so b.o `pwd`/lib-a.so
gcc: file path prefix `./' never used
gcc -B./ -o foo foo.o -Wl,-rpath,. lib-b.so
gcc: file path prefix `./' never used
gcc -B./ -fPIC -c c1.c
gcc: file path prefix `./' never used
gcc -B./ -Wl,-soname,lib-c.so -Wl,--version-script=c.map -shared -o lib-c1.so
c1
.o
gcc: file path prefix `./' never used
gcc -B./ -fPIC -c c2.c
gcc: file path prefix `./' never used
gcc -B./ -Wl,-soname,lib-c.so -Wl,--version-script=c.map -shared -o lib-c2.so
c2
.o
gcc: file path prefix `./' never used
./foo
bar
cp lib-c1.so lib-c.so
gcc -B./ -o default foo.o -Wl,-rpath,. lib-b.so
gcc: file path prefix `./' never used
./foo
bar VERS.0
cp lib-c2.so lib-c.so
gcc -B./ -o default foo.o -Wl,-rpath,. lib-b.so
/home/hjl/bugs/gas/needed.3/lib-a.so: undefined reference to `bar'
collect2: ld returned 1 exit status
gcc: file path prefix `./' never used
You missed:
if ((verstab[symidx] & 0x7fff)
>= ((flags & DL_LOOKUP_RETURN_NEWEST) ? 2 : 3))
An unversioned reference can be resolved by the oldest version. The
rest of code is ok although I prefer to keep the error message instead
of abort () just in case. If you want, I can submit a new working
patch.
H.J.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bug.tar.gz
Type: application/x-gzip
Size: 848 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20020621/9557a8d0/attachment.bin>
More information about the Binutils
mailing list