Commit de57411
ELF: Use index 0 for unversioned undefined symbols (llvm#168189)
The GNU documentation is ambiguous about the version index for
unversioned undefined symbols. The current specification at
https://sourceware.org/gnu-gabi/program-loading-and-dynamic-linking.txt
defines VER_NDX_LOCAL (0) as "The symbol is private, and is not
available outside this object."
However, this naming is misleading for undefined symbols. As suggested
in
discussions, VER_NDX_LOCAL should conceptually be VER_NDX_NONE and apply
to unversioned undefined symbols as well.
GNU ld has used index 0 for unversioned undefined symbols both before
version 2.35 (see https://sourceware.org/PR26002) and in the upcoming
2.46 release (see https://sourceware.org/PR33577). This change aligns
with GNU ld's behavior by switching from index 1 to index 0.
While here, add a test to dso-undef-extract-lazy.s that undefined
symbols of index 0 in DSO are treated as unversioned symbols.1 parent 1cb5942 commit de57411
File tree
6 files changed
+12
-8
lines changed- lld
- ELF
- test/ELF
- linkerscript
- llvm/include/llvm/BinaryFormat
6 files changed
+12
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1676 | 1676 | | |
1677 | 1677 | | |
1678 | 1678 | | |
1679 | | - | |
1680 | | - | |
| 1679 | + | |
| 1680 | + | |
| 1681 | + | |
1681 | 1682 | | |
1682 | 1683 | | |
1683 | 1684 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
313 | 313 | | |
314 | 314 | | |
315 | 315 | | |
| 316 | + | |
| 317 | + | |
316 | 318 | | |
317 | 319 | | |
318 | 320 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3784 | 3784 | | |
3785 | 3785 | | |
3786 | 3786 | | |
3787 | | - | |
| 3787 | + | |
3788 | 3788 | | |
3789 | | - | |
| 3789 | + | |
| 3790 | + | |
3790 | 3791 | | |
3791 | 3792 | | |
3792 | 3793 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1710 | 1710 | | |
1711 | 1711 | | |
1712 | 1712 | | |
1713 | | - | |
1714 | | - | |
| 1713 | + | |
| 1714 | + | |
1715 | 1715 | | |
1716 | 1716 | | |
1717 | 1717 | | |
| |||
0 commit comments