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

H.J. Lu <hjl.tools at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |hjl.tools at gmail dot com

--- Comment #8 from H.J. Lu <hjl.tools at gmail dot com> ---
(In reply to Ali Bahrami from comment #7)
> 
> As you've said at the start, and as I've mentioned at every
> opportunity, the symbol show_undef_weak is an external *reference*,
> and not a *definition*. REFerences should not be assigned to
> a verDEF index, and so show_undef_weak should not be assigned to
> BASE. It should be set to version index 0.

I didn't see it:

[hjl@gnu-tgl-3 pr33577]$ cat x.c
extern void show_undef_weak (void) __attribute__((weak));

void
foo (void)
{
  if (show_undef_weak)
    show_undef_weak ();
}
[hjl@gnu-tgl-3 pr33577]$ make
ld -shared --version-script=x.map -o libx.so x.o
readelf -s -D -W -V libx.so

Symbol table for image contains 4 entries:
   Num:    Value          Size Type    Bind   Vis      Ndx Name
     0: 0000000000000000     0 NOTYPE  LOCAL  DEFAULT  UND 
     1: 0000000000000000     0 NOTYPE  WEAK   DEFAULT  UND show_undef_weak
     2: 0000000000000220    17 FUNC    GLOBAL DEFAULT    3 foo@@VERS_1
     3: 0000000000000000     0 OBJECT  GLOBAL DEFAULT  ABS VERS_1

Version symbols section '.gnu.version' contains 4 entries:
 Addr: 0x00000000000010ac  Offset: 0x000010ac  Link: 5 (.dynsym)
  000:   0 (*local*)       1 (*global*)      2 (VERS_1)        2 (VERS_1)     

Version definition section '.gnu.version_d' contains 2 entries:
 Addr: 0x00000000000010b8  Offset: 0x000010b8  Link: 6 (.dynstr)
  000000: Rev: 1  Flags: BASE  Index: 1  Cnt: 1  Name: libx.so
  0x001c: Rev: 1  Flags: none  Index: 2  Cnt: 1  Name: VERS_1
[hjl@gnu-tgl-3 pr33577]$

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Reply via email to