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

Re: binutils-gold and symbols files

Michael Biebl wrote:
> Apart from the addition end@base symbol, binutils-gold also doesn't seem to
> honor the -export-symbols-regex linker flag, which is most likely the cause
>  for the other additional symbols I see.
> Is this a known issue? If not, could you please forward that to upstream.
I checked it and it seems to work with:

echo 'void testme(unsigned int t){}int main(){return 0;}' > test.c && \
echo "{ global:\nmain;\nlocal: *; };" > test.ver && \
gcc test.c -o test -Wl,-version-script,test.ver && \
readelf -s test|grep testme |grep GLOBAL

This should make testme local.... and it works.

-version-script is what does the work and -export-symbols-regex is just an 
option of libtool. I would guess that libtool-stuff is the problem here..... I 
looked through the code in dbus-glib and found the -version-script stuff in 
the configure script. It is enabled and disabled using 
supports_anon_versioning. The script to test for that support is:

    case `$LD -v 2>&1` in
      *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
      *\\ *) supports_anon_versioning=yes ;; # RH7.3 ...
      *\\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
      *\ 2.11.*) ;; # other 2.11 versions
      *) supports_anon_versioning=yes ;;

The output of `ld -v 2` is "GNU gold (GNU Binutils for Debian 2.20) 1.9". So 
it will catch the 1.9 here and just say "hey, i am sure that you are evil".... 
which is of course wrong. So auto* stuff must be updated here. I will create a 
bug for libtool.

Best regards,

Reply to: