In some sense this is opposite of bug 24718. If an object defines a sequence of versions A, B, C, and does not associate any symbol versions with (say) version B, BFD ld sets VER_FLG_WEAK on that symbol version. It would be nice if this could be avoided. In glibc, to suppress the flag, we currently create an otherwise-unused placeholder symbol. If we had a way to avoid the flag, we would not need to do that.
Hi Florian, Do you have an example to demonstrate what you want to happen ? Ideally I would like to find a method that is compatible with the other linkers, rather than being ld.bfd specific. (This may not be possible however). Cheers Nick
Version definition section '.gnu.version_d' contains 4 entries: Addr: 0x00000000000004a8 Offset: 0x0004a8 Link: 5 (.dynstr) 000000: Rev: 1 Flags: BASE Index: 1 Cnt: 1 Name: a.out 0x001c: Rev: 1 Flags: none Index: 2 Cnt: 1 Name: VER_1 0x0038: Rev: 1 Flags: WEAK Index: 3 Cnt: 2 Name: VER_2 0x0054: Parent 1: VER_1 0x005c: Rev: 1 Flags: none Index: 4 Cnt: 2 Name: VER_3 0x0078: Parent 1: VER_2 a.out built from: $ head -v ex.c ex.lds ==> ex.c <== void f1(void) {} void f3(void) {} ==> ex.lds <== VER_1 { global: f1; local: *; }; VER_2 { } VER_1; VER_3 { global: f2; } VER_2; using: gcc -shared ex.c -Wl,--version-script=ex.lds
Mailing list thread: [PATCH] elf: Don't set VER_FLG_WEAK https://sourceware.org/pipermail/binutils/2022-January/119497.html