<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/bolt/lib/Core/BinaryContext.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>[BOLT] Refactor tracking internals of BinaryFunction. NFCI (#167074)</title>
<updated>2025-11-08T08:31:03+00:00</updated>
<author>
<name>Maksim Panchenko</name>
<email>maks@fb.com</email>
</author>
<published>2025-11-08T08:31:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=af456dfa111bbfc54950fd56a95a446488add406'/>
<id>af456dfa111bbfc54950fd56a95a446488add406</id>
<content type='text'>
In addition to tracking offsets inside a `BinaryFunction` that are
referenced by data relocations, we need to track those relocations too.
Plus, we will need to map symbols referenced by such relocations back to
the containing function.

This change introduces `BinaryFunction::InternalRefDataRelocations` to
track the aforementioned relocations and expands
`BinaryContext::SymbolToFunctionMap` to include local/temp symbols
involved in relocation processing.

There is no functional change introduced that should affect the output.
Future PRs will use the new tracking capabilities.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In addition to tracking offsets inside a `BinaryFunction` that are
referenced by data relocations, we need to track those relocations too.
Plus, we will need to map symbols referenced by such relocations back to
the containing function.

This change introduces `BinaryFunction::InternalRefDataRelocations` to
track the aforementioned relocations and expands
`BinaryContext::SymbolToFunctionMap` to include local/temp symbols
involved in relocation processing.

There is no functional change introduced that should affect the output.
Future PRs will use the new tracking capabilities.</pre>
</div>
</content>
</entry>
<entry>
<title>[BOLT][AArch64] Skip as many zeros as possible in padding validation (#166467)</title>
<updated>2025-11-06T17:38:25+00:00</updated>
<author>
<name>YongKang Zhu</name>
<email>yongzhu@fb.com</email>
</author>
<published>2025-11-06T17:38:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=6fce53af846cd88def615230ac5eaa8455958ccb'/>
<id>6fce53af846cd88def615230ac5eaa8455958ccb</id>
<content type='text'>
We are skipping four zero's at a time when validating code padding in
case that the next zero would be part of an instruction or constant
island, and for functions that have large amount of padding (like due to
hugify), this could be very slow. We now change the validation to skip
as many as possible but still need to be 4's exact multiple number of
zero's. No valid instruction has encoding as 0x00000000 and even if we
stumble into some constant island, the API
`BinaryFunction::isInConstantIsland()` has been made to find the size
between the asked address and the end of island (#164037), so this
should be safe.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We are skipping four zero's at a time when validating code padding in
case that the next zero would be part of an instruction or constant
island, and for functions that have large amount of padding (like due to
hugify), this could be very slow. We now change the validation to skip
as many as possible but still need to be 4's exact multiple number of
zero's. No valid instruction has encoding as 0x00000000 and even if we
stumble into some constant island, the API
`BinaryFunction::isInConstantIsland()` has been made to find the size
between the asked address and the end of island (#164037), so this
should be safe.</pre>
</div>
</content>
</entry>
<entry>
<title>[BOLT] Add an option for constant island cloning (#165778)</title>
<updated>2025-11-03T22:44:05+00:00</updated>
<author>
<name>YongKang Zhu</name>
<email>yongzhu@fb.com</email>
</author>
<published>2025-11-03T22:44:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=562e3bfcd45cddc1da133780b401564471c8c66d'/>
<id>562e3bfcd45cddc1da133780b401564471c8c66d</id>
<content type='text'>
Avoid cloning constant island helps to reduce app size, especially for
BOLT optimization in which cloning would happen when a function is split
into multiple fragments. Add an option to make the cloning optional, and
we will introduce a new pass to handle the reference too far error that
may result from disabling constant island cloning (#165787).</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Avoid cloning constant island helps to reduce app size, especially for
BOLT optimization in which cloning would happen when a function is split
into multiple fragments. Add an option to make the cloning optional, and
we will introduce a new pass to handle the reference too far error that
may result from disabling constant island cloning (#165787).</pre>
</div>
</content>
</entry>
<entry>
<title>[BOLT] Issue error on unclaimed PC-relative relocation (#166098)</title>
<updated>2025-11-03T17:19:33+00:00</updated>
<author>
<name>Maksim Panchenko</name>
<email>maks@fb.com</email>
</author>
<published>2025-11-03T17:19:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=97660c109470aeab78d9602328b7dc7dbb0f9091'/>
<id>97660c109470aeab78d9602328b7dc7dbb0f9091</id>
<content type='text'>
Replace assert with an error and improve the report when unclaimed
PC-relative relocation is left in strict mode.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Replace assert with an error and improve the report when unclaimed
PC-relative relocation is left in strict mode.</pre>
</div>
</content>
</entry>
<entry>
<title>[BOLT] Refactor handling of branch targets. NFCI (#165828)</title>
<updated>2025-10-31T15:56:30+00:00</updated>
<author>
<name>Maksim Panchenko</name>
<email>maks@fb.com</email>
</author>
<published>2025-10-31T15:56:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=7c01a905451644c3a195bc32e1b866d3261b5ecc'/>
<id>7c01a905451644c3a195bc32e1b866d3261b5ecc</id>
<content type='text'>
Refactor code that verifies external branch destinations and creates
secondary entry points.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Refactor code that verifies external branch destinations and creates
secondary entry points.</pre>
</div>
</content>
</entry>
<entry>
<title>[BOLT][AArch64] Validate code padding (#164037)</title>
<updated>2025-10-23T03:25:06+00:00</updated>
<author>
<name>YongKang Zhu</name>
<email>yongzhu@fb.com</email>
</author>
<published>2025-10-23T03:25:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=e1ae12640102fd2b05bc567243580f90acb1135f'/>
<id>e1ae12640102fd2b05bc567243580f90acb1135f</id>
<content type='text'>
Check whether AArch64 function code padding is valid,
and add an option to treat invalid code padding as error.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Check whether AArch64 function code padding is valid,
and add an option to treat invalid code padding as error.</pre>
</div>
</content>
</entry>
<entry>
<title>[BOLT] Check entry point address is not in constant island (#163418)</title>
<updated>2025-10-21T10:08:10+00:00</updated>
<author>
<name>Asher Dobrescu</name>
<email>asher.dobrescu@gmail.com</email>
</author>
<published>2025-10-21T10:08:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=2bbc4ae8501dec637d9dc064f8eeeee13a311339'/>
<id>2bbc4ae8501dec637d9dc064f8eeeee13a311339</id>
<content type='text'>
There are cases where `addEntryPointAtOffset` is called with a given
`Offset` that points to an address within a constant island. This
triggers `assert(!isInConstantIsland(EntryPointAddress)` and causes BOLT
to crash. This patch adds a check which ignores functions that would add
such entry points and warns the user.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
There are cases where `addEntryPointAtOffset` is called with a given
`Offset` that points to an address within a constant island. This
triggers `assert(!isInConstantIsland(EntryPointAddress)` and causes BOLT
to crash. This patch adds a check which ignores functions that would add
such entry points and warns the user.</pre>
</div>
</content>
</entry>
<entry>
<title>[bolt] Fix typos discovered by codespell (#124726)</title>
<updated>2025-10-14T12:45:40+00:00</updated>
<author>
<name>Christian Clauss</name>
<email>cclauss@me.com</email>
</author>
<published>2025-10-14T12:45:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=0fc05aa1c6d76a1830f2cf9227e15b168ccc1c08'/>
<id>0fc05aa1c6d76a1830f2cf9227e15b168ccc1c08</id>
<content type='text'>
https://github.com/codespell-project/codespell
```bash
codespell bolt --skip="*.yaml,Maintainers.txt" --write-changes \
    --ignore-words-list=acount,alledges,ans,archtype,defin,iself,mis,mmaped,othere,outweight,vas
```</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://github.com/codespell-project/codespell
```bash
codespell bolt --skip="*.yaml,Maintainers.txt" --write-changes \
    --ignore-words-list=acount,alledges,ans,archtype,defin,iself,mis,mmaped,othere,outweight,vas
```</pre>
</div>
</content>
</entry>
<entry>
<title>Reapply "[BOLT][AArch64] Handle OpNegateRAState to enable optimizing binaries with pac-ret hardening" (#162353) (#162435)</title>
<updated>2025-10-08T09:05:41+00:00</updated>
<author>
<name>Gergely Bálint</name>
<email>gergely.balint@arm.com</email>
</author>
<published>2025-10-08T09:05:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=889bfd91728a8ca8d27d3f0e5605464201bf5b3e'/>
<id>889bfd91728a8ca8d27d3f0e5605464201bf5b3e</id>
<content type='text'>
Reapply "[BOLT][AArch64] Handle OpNegateRAState to enable optimizing
binaries with pac-ret hardening (#120064)" (#162353)

This reverts commit c7d776b06897567e2d698e447d80279664b67d47.

#120064 was reverted for breaking builders.

Fix: changed the mismatched type in MarkRAStates.cpp to `auto`.

---

Original message:

OpNegateRAState is an AArch64-specific DWARF CFI used to change the value
of the RA_SIGN_STATE pseudoregister. The RA_SIGN_STATE register records
whether the current return address has been signed with PAC.

OpNegateRAState requires special handling in BOLT because its placement
depends on the function layout. Since BOLT reorders basic blocks during
optimization, these CFIs must be regenerated after layout is finalized.

This patch introduces two new passes:

- MarkRAStates (runs before optimizations): assigns a signedness annotation to each
  instruction based on OpNegateRAState CFIs in the input binary.

- InsertNegateRAStates (runs after optimizations): reads the annotations and emits
  new OpNegateRAState CFIs where RA state changes between instructions.

Design details are described in: `bolt/docs/PacRetDesign.md`.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Reapply "[BOLT][AArch64] Handle OpNegateRAState to enable optimizing
binaries with pac-ret hardening (#120064)" (#162353)

This reverts commit c7d776b06897567e2d698e447d80279664b67d47.

#120064 was reverted for breaking builders.

Fix: changed the mismatched type in MarkRAStates.cpp to `auto`.

---

Original message:

OpNegateRAState is an AArch64-specific DWARF CFI used to change the value
of the RA_SIGN_STATE pseudoregister. The RA_SIGN_STATE register records
whether the current return address has been signed with PAC.

OpNegateRAState requires special handling in BOLT because its placement
depends on the function layout. Since BOLT reorders basic blocks during
optimization, these CFIs must be regenerated after layout is finalized.

This patch introduces two new passes:

- MarkRAStates (runs before optimizations): assigns a signedness annotation to each
  instruction based on OpNegateRAState CFIs in the input binary.

- InsertNegateRAStates (runs after optimizations): reads the annotations and emits
  new OpNegateRAState CFIs where RA state changes between instructions.

Design details are described in: `bolt/docs/PacRetDesign.md`.</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "[BOLT][AArch64] Handle OpNegateRAState to enable optimizing binaries with pac-ret hardening" (#162353)</title>
<updated>2025-10-07T19:59:18+00:00</updated>
<author>
<name>Gergely Bálint</name>
<email>gergely.balint@arm.com</email>
</author>
<published>2025-10-07T19:59:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=c7d776b06897567e2d698e447d80279664b67d47'/>
<id>c7d776b06897567e2d698e447d80279664b67d47</id>
<content type='text'>
Reverts llvm/llvm-project#120064.

@gulfemsavrun reported that the patch broke toolchain builders.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Reverts llvm/llvm-project#120064.

@gulfemsavrun reported that the patch broke toolchain builders.</pre>
</div>
</content>
</entry>
</feed>
