Bug 28243 - ld: Assigning a non-default symbol to a different version node should warn
Summary: ld: Assigning a non-default symbol to a different version node should warn
Status: UNCONFIRMED
Alias: None
Product: binutils
Classification: Unclassified
Component: ld (show other bugs)
Version: unspecified
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-08-18 07:51 UTC by Fangrui Song
Modified: 2023-08-07 09:49 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Fangrui Song 2021-08-18 07:51:09 UTC
cat > ./a.s <<eof
.symver foo, foo@v1
.globl foo
foo:
eof

cat > ./ver <<eof
v1 {};
v2 { foo; };
eof

# Note that v2 { foo; } is ignored.
ld/ld-new -shared --version-script=ver a.o -o a.so

.dynsym has foo@v1.
This is error-prone and it'd be nice to report a warning.

(The gold output has both foo@v1 and foo@@v2. You might call it a bug because you consider GNU ld the standard, but I'll insist that it's the design flaw of the assembler @ syntax.
Linkers wouldn't need indirection complexity or combining version complexity if the ",remove" semantics were used in the beginning.)