bug-binutils
[Top][All Lists]
Advanced

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

[Bug ld/20828] GC-ed DSO symbols make corresponding symbols defined by a


From: james410 at cowgill dot org.uk
Subject: [Bug ld/20828] GC-ed DSO symbols make corresponding symbols defined by a linker script local
Date: Sat, 28 Jan 2017 12:56:06 +0000

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

James Cowgill <james410 at cowgill dot org.uk> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|FIXED                       |---

--- Comment #30 from James Cowgill <james410 at cowgill dot org.uk> ---
Hi Maciej,

Unfortunately this bug doesn't seem completely fixed. It still affects "symbol
version" symbols (maybe they have a better name?).

See:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=844227#260

I can reproduce this if I compile both libstubs.so and liboutput.so from my
original testcase with this version script:

== test.ver ===
TEST { global: a; };

$ gcc -shared -Wl,--version-script=test.ver libstubs.c -o libstubs.so
$ gcc -c stubs.c
$ ld -shared --version-script=test.ver --gc-sections -o liboutput.so stubs.o
libstubs.so

======
$ readelf --dyn-sym libstubs.so 

Symbol table '.dynsym' contains 18 entries:
   Num:    Value  Size Type    Bind   Vis      Ndx Name
     0: 00000000     0 NOTYPE  LOCAL  DEFAULT  UND 
     1: 0000056c     0 SECTION LOCAL  DEFAULT   12 
     2: 000107bc     0 NOTYPE  GLOBAL DEFAULT   20 _edata
     3: 00000740     0 FUNC    GLOBAL DEFAULT   14 _fini
     4: 00000710    36 FUNC    GLOBAL DEFAULT   13 alpha
     5: 00010780     0 NOTYPE  GLOBAL DEFAULT   19 _fdata
     6: 00000000     0 OBJECT  GLOBAL DEFAULT  ABS TEST
     7: 000107d0     0 NOTYPE  GLOBAL DEFAULT   21 _end
     8: 000107bc     0 NOTYPE  GLOBAL DEFAULT   21 __bss_start
     9: 00018770     0 SECTION GLOBAL DEFAULT  ABS _gp_disp
    10: 000005b0     0 NOTYPE  GLOBAL DEFAULT   13 _ftext
    11: 000107bc     0 NOTYPE  GLOBAL DEFAULT   21 _fbss
    12: 0000056c     0 FUNC    GLOBAL DEFAULT   12 _init
    13: 00000000     0 NOTYPE  WEAK   DEFAULT  UND _ITM_registerTMCloneTable
    14: 00000000     0 NOTYPE  WEAK   DEFAULT  UND _Jv_RegisterClasses
    15: 00000000     0 FUNC    WEAK   DEFAULT  UND __gmon_start__
    16: 00000000     0 NOTYPE  WEAK   DEFAULT  UND _ITM_deregisterTMCloneTab
    17: 00000000     0 FUNC    WEAK   DEFAULT  UND address@hidden (3)

$ readelf --dyn-sym liboutput.so 

Symbol table '.dynsym' contains 11 entries:
   Num:    Value  Size Type    Bind   Vis      Ndx Name
     0: 00000000     0 NOTYPE  LOCAL  DEFAULT  UND 
     1: 00000340     0 SECTION LOCAL  DEFAULT    8 
     2: 00010390     0 NOTYPE  GLOBAL DEFAULT    9 _fdata
     3: 00000340    36 FUNC    GLOBAL DEFAULT    8 psi
     4: 00000000     0 OBJECT  LOCAL  DEFAULT  ABS TEST
     5: 00000340     0 NOTYPE  GLOBAL DEFAULT    8 _ftext
     6: 00010398     0 NOTYPE  GLOBAL DEFAULT    9 __bss_start
     7: 00000364    36 FUNC    GLOBAL DEFAULT    8 omega
     8: 00010398     0 NOTYPE  GLOBAL DEFAULT    9 _edata
     9: 00010398     0 NOTYPE  GLOBAL DEFAULT    9 _end
    10: 00010398     0 NOTYPE  GLOBAL DEFAULT    9 _fbss

As you can see, there is a misplaced LOCAL symbol in liboutput.so.

Thanks,
James

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