Summary: | gold: --no-define-common is incompatible with GNU ld | ||
---|---|---|---|
Product: | binutils | Reporter: | Fangrui Song <i> |
Component: | gold | Assignee: | Cary Coutant <ccoutant> |
Status: | UNCONFIRMED --- | ||
Severity: | normal | CC: | ian |
Priority: | P2 | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Host: | Target: | ||
Build: | Last reconfirmed: |
Description
Fangrui Song
2022-02-08 08:57:02 UTC
https://sourceware.org/pipermail/binutils/2022-February/119689.html [PATCH] gold: Remove GNU ld incompatible --[no-]define-common [BZ #28871] I do not see how gold's --no-define-common is incompatible with ld's. According to the ld manual, and from looking at the original ld patch, they seem to do exactly the same thing, which is in fact the opposite of -d. If your complaint is that --define-common is accepted by gold but not by ld, I do not see that as sufficient grounds to remove it from gold. 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). |