<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/lld/ELF/ScriptParser.cpp, 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>[ADT] Prepare to deprecate variadic `StringSwitch::Cases`. NFC. (#166020)</title>
<updated>2025-11-02T00:12:33+00:00</updated>
<author>
<name>Jakub Kuderski</name>
<email>jakub@nod-labs.com</email>
</author>
<published>2025-11-02T00:12:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=4c21d0cb14806fe1f5f42abd9d7e772013f625cb'/>
<id>4c21d0cb14806fe1f5f42abd9d7e772013f625cb</id>
<content type='text'>
Update all uses of variadic `.Cases` to use the initializer list
overload instead. I plan to mark variadic `.Cases` as deprecated in a
followup PR.

For more context, see https://github.com/llvm/llvm-project/pull/163117.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Update all uses of variadic `.Cases` to use the initializer list
overload instead. I plan to mark variadic `.Cases` as deprecated in a
followup PR.

For more context, see https://github.com/llvm/llvm-project/pull/163117.</pre>
</div>
</content>
</entry>
<entry>
<title>[ADT] Prepare for deprecation of StringSwitch cases with 4+ args. NFC. (#164173)</title>
<updated>2025-10-20T16:03:46+00:00</updated>
<author>
<name>Jakub Kuderski</name>
<email>jakub@nod-labs.com</email>
</author>
<published>2025-10-20T16:03:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=d86da4efee20cc11cd8f3a46f2483379cea6eca5'/>
<id>d86da4efee20cc11cd8f3a46f2483379cea6eca5</id>
<content type='text'>
Update `.Cases` and `.CasesLower` with 4+ args to use the
`initializer_list` overload. The deprecation of these functions will
come in a separate PR.

For more context, see: https://github.com/llvm/llvm-project/pull/163405.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Update `.Cases` and `.CasesLower` with 4+ args to use the
`initializer_list` overload. The deprecation of these functions will
come in a separate PR.

For more context, see: https://github.com/llvm/llvm-project/pull/163405.</pre>
</div>
</content>
</entry>
<entry>
<title>[LLD] Fix crash on parsing ':ALIGN' in linker script (#146723)</title>
<updated>2025-07-06T17:22:50+00:00</updated>
<author>
<name>Parth</name>
<email>partharora99160808@gmail.com</email>
</author>
<published>2025-07-06T17:22:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=923a3cc160a14e61bd2847f9b011bb4d6ce4fc71'/>
<id>923a3cc160a14e61bd2847f9b011bb4d6ce4fc71</id>
<content type='text'>
The linker was crashing due to stack overflow when parsing ':ALIGN' in
an output section description. This commit fixes the linker script
parser so that the crash does not happen.

The root cause of the stack overflow is how we parse expressions
(readExpr) in linker script and the behavior of ScriptLexer::expect(...)
utility. ScriptLexer::expect does not do anything if errors have already
been encountered during linker script parsing. In particular, it never
increments the current token position in the script file, even if the
current token is the same as the expected token. This causes an infinite
call cycle on parsing an expression such as '(4096)' when an error has
already been encountered.

readExpr() calls readPrimary()
readPrimary() calls readParenExpr()

readParenExpr():

  expect("("); // no-op, current token still points to '('
  Expression *E = readExpr(); // The cycle continues...

Closes #146722

Signed-off-by: Parth Arora &lt;partaror@qti.qualcomm.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The linker was crashing due to stack overflow when parsing ':ALIGN' in
an output section description. This commit fixes the linker script
parser so that the crash does not happen.

The root cause of the stack overflow is how we parse expressions
(readExpr) in linker script and the behavior of ScriptLexer::expect(...)
utility. ScriptLexer::expect does not do anything if errors have already
been encountered during linker script parsing. In particular, it never
increments the current token position in the script file, even if the
current token is the same as the expected token. This causes an infinite
call cycle on parsing an expression such as '(4096)' when an error has
already been encountered.

readExpr() calls readPrimary()
readPrimary() calls readParenExpr()

readParenExpr():

  expect("("); // no-op, current token still points to '('
  Expression *E = readExpr(); // The cycle continues...

Closes #146722

Signed-off-by: Parth Arora &lt;partaror@qti.qualcomm.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>[ELF] Postpone ASSERT error</title>
<updated>2025-05-29T03:56:13+00:00</updated>
<author>
<name>Fangrui Song</name>
<email>i@maskray.me</email>
</author>
<published>2025-05-29T03:56:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=5859863bab7fb1cd98b6028293cba6ba25f7d514'/>
<id>5859863bab7fb1cd98b6028293cba6ba25f7d514</id>
<content type='text'>
assignAddresses is executed more than once. When an ASSERT expression
evaluates to zero, we should only report an error for the last
assignAddresses. Make a change similar to #66854 and #96361.

This change might help https://github.com/ClangBuiltLinux/linux/issues/2094
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
assignAddresses is executed more than once. When an ASSERT expression
evaluates to zero, we should only report an error for the last
assignAddresses. Make a change similar to #66854 and #96361.

This change might help https://github.com/ClangBuiltLinux/linux/issues/2094
</pre>
</div>
</content>
</entry>
<entry>
<title>[lld] Remove unused includes (NFC) (#141421)</title>
<updated>2025-05-25T17:55:39+00:00</updated>
<author>
<name>Kazu Hirata</name>
<email>kazu@google.com</email>
</author>
<published>2025-05-25T17:55:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=19f00c0570582e93140642cbb62e5b820722c8f1'/>
<id>19f00c0570582e93140642cbb62e5b820722c8f1</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] Support OVERLAY NOCROSSREFS (#133807)</title>
<updated>2025-04-02T16:25:18+00:00</updated>
<author>
<name>Daniel Thornburgh</name>
<email>dthorn@google.com</email>
</author>
<published>2025-04-02T16:25:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=e84b57dfbf36626205d6cd4c8007a3e511b7a296'/>
<id>e84b57dfbf36626205d6cd4c8007a3e511b7a296</id>
<content type='text'>
This allows NOCROSSREFS to be specified in OVERLAY linker script
descriptions. This is a particularly useful part of the OVERLAY syntax,
since it's very rarely possible for one overlay section to sensibly
reference another.

Closes #128790</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This allows NOCROSSREFS to be specified in OVERLAY linker script
descriptions. This is a particularly useful part of the OVERLAY syntax,
since it's very rarely possible for one overlay section to sensibly
reference another.

Closes #128790</pre>
</div>
</content>
</entry>
<entry>
<title>[LLD][ELF] Allow memory region in OVERLAY (#133540)</title>
<updated>2025-03-31T17:44:40+00:00</updated>
<author>
<name>Daniel Thornburgh</name>
<email>dthorn@google.com</email>
</author>
<published>2025-03-31T17:44:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=2d7add6e2e56baf46504a8a22dec42b61f63360f'/>
<id>2d7add6e2e56baf46504a8a22dec42b61f63360f</id>
<content type='text'>
This allows the contents of OVERLAYs to be attributed to memory regions.
This is the only clean way to overlap VMAs in linker scripts that choose
to primarily use memory regions to lay out addresses.

This also simplifies OVERLAY expansion to better match GNU LD.
Expressions for the first section's LMA and VMA are not generated if the
user did not provide them. This allows the LMA/VMA offset to be
preserved across multiple overlays in the same region, as with regular
sections.

Closes #129816</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This allows the contents of OVERLAYs to be attributed to memory regions.
This is the only clean way to overlap VMAs in linker scripts that choose
to primarily use memory regions to lay out addresses.

This also simplifies OVERLAY expansion to better match GNU LD.
Expressions for the first section's LMA and VMA are not generated if the
user did not provide them. This allows the LMA/VMA offset to be
preserved across multiple overlays in the same region, as with regular
sections.

Closes #129816</pre>
</div>
</content>
</entry>
<entry>
<title>[ELF] Allow KEEP within OVERLAY (#130661)</title>
<updated>2025-03-11T18:58:14+00:00</updated>
<author>
<name>Nathan Chancellor</name>
<email>nathan@kernel.org</email>
</author>
<published>2025-03-11T18:58:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=381599f1fe973afad3094e55ec99b1620dba7d8c'/>
<id>381599f1fe973afad3094e55ec99b1620dba7d8c</id>
<content type='text'>
When attempting to add KEEP within an OVERLAY description, which the
Linux kernel would like to do for ARCH=arm to avoid dropping the
.vectors sections with '--gc-sections' [1], ld.lld errors with:

  ld.lld: error: ./arch/arm/kernel/vmlinux.lds:37: section pattern is expected
  &gt;&gt;&gt;  __vectors_lma = .; OVERLAY 0xffff0000 : AT(__vectors_lma) { .vectors { KEEP(*(.vectors)) } ...
  &gt;&gt;&gt;                                                                               ^

readOverlaySectionDescription() does not handle all input section
description keywords, despite GNU ld's documentation stating that "The
section definitions within the OVERLAY construct are identical to those
within the general SECTIONS construct, except that no addresses and no
memory regions may be defined for sections within an OVERLAY."

Reuse the existing parsing in readInputSectionDescription(), which
handles KEEP, allowing the Linux kernel's use case to work properly.

[1]: https://lore.kernel.org/20250221125520.14035-1-ceggers@arri.de/
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When attempting to add KEEP within an OVERLAY description, which the
Linux kernel would like to do for ARCH=arm to avoid dropping the
.vectors sections with '--gc-sections' [1], ld.lld errors with:

  ld.lld: error: ./arch/arm/kernel/vmlinux.lds:37: section pattern is expected
  &gt;&gt;&gt;  __vectors_lma = .; OVERLAY 0xffff0000 : AT(__vectors_lma) { .vectors { KEEP(*(.vectors)) } ...
  &gt;&gt;&gt;                                                                               ^

readOverlaySectionDescription() does not handle all input section
description keywords, despite GNU ld's documentation stating that "The
section definitions within the OVERLAY construct are identical to those
within the general SECTIONS construct, except that no addresses and no
memory regions may be defined for sections within an OVERLAY."

Reuse the existing parsing in readInputSectionDescription(), which
handles KEEP, allowing the Linux kernel's use case to work properly.

[1]: https://lore.kernel.org/20250221125520.14035-1-ceggers@arri.de/
</pre>
</div>
</content>
</entry>
<entry>
<title>[LLD][ELF][AArch64] Add support for SHF_AARCH64_PURECODE ELF section flag (3/3) (#125689)</title>
<updated>2025-02-21T17:01:38+00:00</updated>
<author>
<name>Csanád Hajdú</name>
<email>csanad.hajdu@arm.com</email>
</author>
<published>2025-02-21T17:01:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=6e457c20016ae1ed7249dd28ce4b3c7993a91275'/>
<id>6e457c20016ae1ed7249dd28ce4b3c7993a91275</id>
<content type='text'>
Add support for the new SHF_AARCH64_PURECODE ELF section flag:
https://github.com/ARM-software/abi-aa/pull/304

The general implementation follows the existing one for ARM targets. The
output section only has the `SHF_AARCH64_PURECODE` flag set if all input
sections have it set.

Related PRs:
* LLVM: https://github.com/llvm/llvm-project/pull/125687
* Clang: https://github.com/llvm/llvm-project/pull/125688
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add support for the new SHF_AARCH64_PURECODE ELF section flag:
https://github.com/ARM-software/abi-aa/pull/304

The general implementation follows the existing one for ARM targets. The
output section only has the `SHF_AARCH64_PURECODE` flag set if all input
sections have it set.

Related PRs:
* LLVM: https://github.com/llvm/llvm-project/pull/125687
* Clang: https://github.com/llvm/llvm-project/pull/125688
</pre>
</div>
</content>
</entry>
<entry>
<title>[ELF] Replace inExpr with lexState. NFC</title>
<updated>2025-02-01T23:49:08+00:00</updated>
<author>
<name>Fangrui Song</name>
<email>i@maskray.me</email>
</author>
<published>2025-02-01T23:49:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=5c3c0a8cec9205efba78583bd0b8a646270968a1'/>
<id>5c3c0a8cec9205efba78583bd0b8a646270968a1</id>
<content type='text'>
We may add another state State::Wild to behave more lik GNU ld.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We may add another state State::Wild to behave more lik GNU ld.
</pre>
</div>
</content>
</entry>
</feed>
