<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/lld/test/ELF/linkerscript/version-script.s, branch main</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.
</subtitle>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/'/>
<entry>
<title>ELF: Use index 0 for unversioned undefined symbols (#168189)</title>
<updated>2025-11-22T20:54:50+00:00</updated>
<author>
<name>Fangrui Song</name>
<email>i@maskray.me</email>
</author>
<published>2025-11-22T20:54:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=d96a93ff00ac02bc523d36dd2e687d597a068ae1'/>
<id>d96a93ff00ac02bc523d36dd2e687d597a068ae1</id>
<content type='text'>
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.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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.</pre>
</div>
</content>
</entry>
<entry>
<title>[ELF][test] Change -o %t to -o /dev/null if the output is not needed</title>
<updated>2020-02-13T05:54:50+00:00</updated>
<author>
<name>Fangrui Song</name>
<email>maskray@google.com</email>
</author>
<published>2020-02-13T05:48:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=81cebfd0080e3873d0cef5ee5215b8c97332ff96'/>
<id>81cebfd0080e3873d0cef5ee5215b8c97332ff96</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[LLD][ELF] - Update test cases after llvm-readobj output format change.</title>
<updated>2019-10-17T10:23:59+00:00</updated>
<author>
<name>George Rimar</name>
<email>grimar@accesssoftek.com</email>
</author>
<published>2019-10-17T10:23:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=938db706fe73bb7308e54f5a9f5ade2396783fb4'/>
<id>938db706fe73bb7308e54f5a9f5ade2396783fb4</id>
<content type='text'>
The change was:

SHT_GNU_verdef { -&gt; VersionDefinitions [
SHT_GNU_verneed { -&gt; VersionRequirements [
Version symbols [ -&gt; VersionSymbols [
EH_FRAME Header [ -&gt; EHFrameHeader {

llvm-svn: 375096
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The change was:

SHT_GNU_verdef { -&gt; VersionDefinitions [
SHT_GNU_verneed { -&gt; VersionRequirements [
Version symbols [ -&gt; VersionSymbols [
EH_FRAME Header [ -&gt; EHFrameHeader {

llvm-svn: 375096
</pre>
</div>
</content>
</entry>
<entry>
<title>[LLD][ELF] - Update test cases after llvm-readobj change.</title>
<updated>2019-10-11T12:27:20+00:00</updated>
<author>
<name>George Rimar</name>
<email>grimar@accesssoftek.com</email>
</author>
<published>2019-10-11T12:27:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=a8346cee8a48a8a45b508997f75d40d25860854d'/>
<id>a8346cee8a48a8a45b508997f75d40d25860854d</id>
<content type='text'>
https://reviews.llvm.org/D68704 changed the output format.

llvm-svn: 374542
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://reviews.llvm.org/D68704 changed the output format.

llvm-svn: 374542
</pre>
</div>
</content>
</entry>
<entry>
<title>[ELF] Consistently prioritize non-* wildcards overs "*" in version scripts</title>
<updated>2019-08-05T14:31:39+00:00</updated>
<author>
<name>Fangrui Song</name>
<email>maskray@google.com</email>
</author>
<published>2019-08-05T14:31:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=e28a70daf4e685ed4b50619fb30983b4464fae1c'/>
<id>e28a70daf4e685ed4b50619fb30983b4464fae1c</id>
<content type='text'>
We prioritize non-* wildcards overs VER_NDX_LOCAL/VER_NDX_GLOBAL "*".
This patch generalizes the rule to "*" of other versions and thus fixes PR40176.
I don't feel strongly about this GNU linkers' behavior but the
generalization simplifies code.

Delete `config-&gt;defaultSymbolVersion` which was used to special case
VER_NDX_LOCAL/VER_NDX_GLOBAL "*".

In `SymbolTable::scanVersionScript`, custom versions are handled the same
way as VER_NDX_LOCAL/VER_NDX_GLOBAL. So merge
`config-&gt;versionScript{Locals,Globals}` into `config-&gt;versionDefinitions`.
Overall this seems to simplify the code.

In `SymbolTable::assign{Exact,Wildcard}Versions`,
`sym-&gt;verdefIndex == config-&gt;defaultSymbolVersion` is changed to
`verdefIndex == UINT32_C(-1)`.
This allows us to give duplicate assignment diagnostics for
`{ global: foo; };` `V1 { global: foo; };`

In test/linkerscript/version-script.s:
  vs_index of an undefined symbol changes from 0 to 1. This doesn't matter (arguably 1 is better because the binding is STB_GLOBAL) because vs_index of an undefined symbol is ignored.

Reviewed By: ruiu

Differential Revision: https://reviews.llvm.org/D65716

llvm-svn: 367869
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We prioritize non-* wildcards overs VER_NDX_LOCAL/VER_NDX_GLOBAL "*".
This patch generalizes the rule to "*" of other versions and thus fixes PR40176.
I don't feel strongly about this GNU linkers' behavior but the
generalization simplifies code.

Delete `config-&gt;defaultSymbolVersion` which was used to special case
VER_NDX_LOCAL/VER_NDX_GLOBAL "*".

In `SymbolTable::scanVersionScript`, custom versions are handled the same
way as VER_NDX_LOCAL/VER_NDX_GLOBAL. So merge
`config-&gt;versionScript{Locals,Globals}` into `config-&gt;versionDefinitions`.
Overall this seems to simplify the code.

In `SymbolTable::assign{Exact,Wildcard}Versions`,
`sym-&gt;verdefIndex == config-&gt;defaultSymbolVersion` is changed to
`verdefIndex == UINT32_C(-1)`.
This allows us to give duplicate assignment diagnostics for
`{ global: foo; };` `V1 { global: foo; };`

In test/linkerscript/version-script.s:
  vs_index of an undefined symbol changes from 0 to 1. This doesn't matter (arguably 1 is better because the binding is STB_GLOBAL) because vs_index of an undefined symbol is ignored.

Reviewed By: ruiu

Differential Revision: https://reviews.llvm.org/D65716

llvm-svn: 367869
</pre>
</div>
</content>
</entry>
<entry>
<title>[ELF] Remove checking for spurious '@' at the end of dynamic sym names</title>
<updated>2019-01-08T10:50:59+00:00</updated>
<author>
<name>James Henderson</name>
<email>jh7370@my.bristol.ac.uk</email>
</author>
<published>2019-01-08T10:50:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=4ba1777a2da7a0104baf63a2f28005577039324b'/>
<id>4ba1777a2da7a0104baf63a2f28005577039324b</id>
<content type='text'>
llvm-readobj currently has a bug (see PR40097) where it prints '@' at
the end of unversioned dynamic symbols. This bug will be fixed in a
separate later commit, but these tests need fixing first.

Reviewed by: ruiu, Higuoxing

Differential Revision: https://reviews.llvm.org/D56388

llvm-svn: 350614
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
llvm-readobj currently has a bug (see PR40097) where it prints '@' at
the end of unversioned dynamic symbols. This bug will be fixed in a
separate later commit, but these tests need fixing first.

Reviewed by: ruiu, Higuoxing

Differential Revision: https://reviews.llvm.org/D56388

llvm-svn: 350614
</pre>
</div>
</content>
</entry>
<entry>
<title>[ELF] Process linker scripts deeper when declaring symbols.</title>
<updated>2018-02-28T05:55:56+00:00</updated>
<author>
<name>Igor Kudrin</name>
<email>ikudrin@accesssoftek.com</email>
</author>
<published>2018-02-28T05:55:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=c844524e46555737fd0870e78fcfcb93925ad723'/>
<id>c844524e46555737fd0870e78fcfcb93925ad723</id>
<content type='text'>
We should process symbols inside output section declarations the same way as top-level ones.

Differential Revision: https://reviews.llvm.org/D43008

llvm-svn: 326305
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We should process symbols inside output section declarations the same way as top-level ones.

Differential Revision: https://reviews.llvm.org/D43008

llvm-svn: 326305
</pre>
</div>
</content>
</entry>
<entry>
<title>[ELF] - Define linkerscript symbols early.</title>
<updated>2018-01-30T09:04:27+00:00</updated>
<author>
<name>George Rimar</name>
<email>grimar@accesssoftek.com</email>
</author>
<published>2018-01-30T09:04:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=c4ccfb5d932909e64511bcfdc995ab20a80b2a89'/>
<id>c4ccfb5d932909e64511bcfdc995ab20a80b2a89</id>
<content type='text'>
Currently symbols assigned or created by linkerscript are not processed early
enough. As a result it is not possible to version them or assign any other flags/properties.

Patch creates Defined symbols for -defsym and linkerscript symbols early,
so that issue from above can be addressed.

It is based on Rafael Espindola's version of D38239 patch.

Fixes PR34121.

Differential revision: https://reviews.llvm.org/D41987

llvm-svn: 323729
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Currently symbols assigned or created by linkerscript are not processed early
enough. As a result it is not possible to version them or assign any other flags/properties.

Patch creates Defined symbols for -defsym and linkerscript symbols early,
so that issue from above can be addressed.

It is based on Rafael Espindola's version of D38239 patch.

Fixes PR34121.

Differential revision: https://reviews.llvm.org/D41987

llvm-svn: 323729
</pre>
</div>
</content>
</entry>
</feed>
