bug-binutils
[Top][All Lists]
Advanced

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

[Bug gold/28871] gold: --no-define-common is incompatible with GNU ld


From: i at maskray dot me
Subject: [Bug gold/28871] gold: --no-define-common is incompatible with GNU ld
Date: Wed, 09 Feb 2022 05:07:46 +0000

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

--- Comment #3 from Fangrui Song <i at maskray dot me> ---
The semantics are different.

% ld.bfd -r --no-define-common a.o -o a.ro && readelf -Ws a.ro
ld.bfd: --no-define-common may not be used without -shared

% ld.bfd -shared --no-define-common a.o -o a.so && readelf -Ws a.so

Symbol table '.dynsym' contains 2 entries:
   Num:    Value          Size Type    Bind   Vis      Ndx Name
     0: 0000000000000000     0 NOTYPE  LOCAL  DEFAULT  UND 
     1: 0000000000000000     0 OBJECT  GLOBAL DEFAULT  UND x

Symbol table '.symtab' contains 3 entries:
   Num:    Value          Size Type    Bind   Vis      Ndx Name
     0: 0000000000000000     0 NOTYPE  LOCAL  DEFAULT  UND 
     1: 0000000000002f40     0 OBJECT  LOCAL  DEFAULT    7 _DYNAMIC
     2: 0000000000000000     0 OBJECT  GLOBAL DEFAULT  UND x


See that x is undefined in GNU ld. In gold, --[no-]define-common controls
whether st_shndx is SHN_COMMON or not (allocated space or not).

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