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