[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug gas/25295] Gas should have way to define symbol version without exp
From: |
i at maskray dot me |
Subject: |
[Bug gas/25295] Gas should have way to define symbol version without exporting its target |
Date: |
Mon, 06 Apr 2020 23:18:40 +0000 |
https://sourceware.org/bugzilla/show_bug.cgi?id=25295
--- Comment #15 from Fangrui Song <i at maskray dot me> ---
(In reply to H.J. Lu from comment #14)
> Created attachment 12440 [details]
> The updated patch
>
> Also support
>
> [hjl@gnu-cfl-2 pr25295]$ cat a.s
> .global foo
> foo:
> ret
> .symver foo, bar@V1
> .symver foo, baz@V2
> [hjl@gnu-cfl-2 pr25295]$ make a.o
> ./as -o a.o a.s
> [hjl@gnu-cfl-2 pr25295]$ readelf -sW a.o
>
> Symbol table '.symtab' contains 7 entries:
> Num: Value Size Type Bind Vis Ndx Name
> 0: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND
> 1: 0000000000000000 0 SECTION LOCAL DEFAULT 1
> 2: 0000000000000000 0 SECTION LOCAL DEFAULT 2
> 3: 0000000000000000 0 SECTION LOCAL DEFAULT 3
> 4: 0000000000000000 0 NOTYPE GLOBAL DEFAULT 1 foo
> 5: 0000000000000000 0 NOTYPE GLOBAL DEFAULT 1 bar@V1
> 6: 0000000000000000 0 NOTYPE GLOBAL DEFAULT 1 baz@V2
> [hjl@gnu-cfl-2 pr25295]$
Thanks for your efforts to clean up .symver mess. In particular, I am very
happy that in 2000
(https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=79082ff0c6032d8e1e832fe35cc69b3b46d4bd91)
you invented @@@ to fix @@ deficiency.
Fundamentally I am not against the following
.symver foo,foo@v1
.symver foo,foo@v2
but I suspect it can make implementation difficult. The renaming semantics can
probably simplify GNU ld bfd_link_hash_indirect as well.
If the intention is to make a symbol available simultaneously as foo@v1 and
foo@v2, the renaming semantics can work with a .set directive:
globl foo_v1
.symver foo_v1, foo@v1
foo_v1:
.globl foo_v2
.set foo_v2, foo_v1
.symver foo_v2, foo@v2
> 4: 0000000000000000 0 NOTYPE GLOBAL DEFAULT 1 foo
I still hope we can remove `foo` from the symbol table, which is also Comment
#3's request.
It is just very inconvenient for an archive user if the symbol remains in the
symbol table.
--
You are receiving this mail because:
You are on the CC list for the bug.
- [Bug gas/25295] Gas should have way to define symbol version without exporting its target, (continued)
- [Bug gas/25295] Gas should have way to define symbol version without exporting its target, address@hidden, 2020/04/06
- [Bug gas/25295] Gas should have way to define symbol version without exporting its target, hjl.tools at gmail dot com, 2020/04/06
- [Bug gas/25295] Gas should have way to define symbol version without exporting its target, hjl.tools at gmail dot com, 2020/04/06
- [Bug gas/25295] Gas should have way to define symbol version without exporting its target, hjl.tools at gmail dot com, 2020/04/06
- [Bug gas/25295] Gas should have way to define symbol version without exporting its target, i at maskray dot me, 2020/04/06
- [Bug gas/25295] Gas should have way to define symbol version without exporting its target, hjl.tools at gmail dot com, 2020/04/06
- [Bug gas/25295] Gas should have way to define symbol version without exporting its target, i at maskray dot me, 2020/04/06
- [Bug gas/25295] Gas should have way to define symbol version without exporting its target, hjl.tools at gmail dot com, 2020/04/06
- [Bug gas/25295] Gas should have way to define symbol version without exporting its target, hjl.tools at gmail dot com, 2020/04/06
- [Bug gas/25295] Gas should have way to define symbol version without exporting its target, hjl.tools at gmail dot com, 2020/04/06
- [Bug gas/25295] Gas should have way to define symbol version without exporting its target,
i at maskray dot me <=
- [Bug gas/25295] Gas should have way to define symbol version without exporting its target, hjl.tools at gmail dot com, 2020/04/06
- [Bug gas/25295] Gas should have way to define symbol version without exporting its target, hjl.tools at gmail dot com, 2020/04/06
- [Bug gas/25295] Gas should have way to define symbol version without exporting its target, hjl.tools at gmail dot com, 2020/04/06
- [Bug gas/25295] Gas should have way to define symbol version without exporting its target, i at maskray dot me, 2020/04/06
- [Bug gas/25295] Gas should have way to define symbol version without exporting its target, i at maskray dot me, 2020/04/07
- [Bug gas/25295] Gas should have way to define symbol version without exporting its target, hjl.tools at gmail dot com, 2020/04/07
- [Bug gas/25295] Gas should have way to define symbol version without exporting its target, cvs-commit at gcc dot gnu.org, 2020/04/21
- [Bug gas/25295] Gas should have way to define symbol version without exporting its target, hjl.tools at gmail dot com, 2020/04/21