|
Revision tags: llvmorg-20.1.0, llvmorg-20.1.0-rc3, llvmorg-20.1.0-rc2, llvmorg-20.1.0-rc1, llvmorg-21-init, llvmorg-19.1.7, llvmorg-19.1.6, llvmorg-19.1.5, llvmorg-19.1.4, llvmorg-19.1.3, llvmorg-19.1.2, llvmorg-19.1.1, llvmorg-19.1.0, llvmorg-19.1.0-rc4, llvmorg-19.1.0-rc3, llvmorg-19.1.0-rc2, llvmorg-19.1.0-rc1, llvmorg-20-init, llvmorg-18.1.8, llvmorg-18.1.7, llvmorg-18.1.6, llvmorg-18.1.5, llvmorg-18.1.4, llvmorg-18.1.3, llvmorg-18.1.2, llvmorg-18.1.1, llvmorg-18.1.0, llvmorg-18.1.0-rc4, llvmorg-18.1.0-rc3, llvmorg-18.1.0-rc2, llvmorg-18.1.0-rc1, llvmorg-19-init, llvmorg-17.0.6, llvmorg-17.0.5, llvmorg-17.0.4, llvmorg-17.0.3, llvmorg-17.0.2, llvmorg-17.0.1, llvmorg-17.0.0, llvmorg-17.0.0-rc4, llvmorg-17.0.0-rc3, llvmorg-17.0.0-rc2, llvmorg-17.0.0-rc1, llvmorg-18-init, llvmorg-16.0.6, llvmorg-16.0.5, llvmorg-16.0.4, llvmorg-16.0.3, llvmorg-16.0.2, llvmorg-16.0.1, llvmorg-16.0.0, llvmorg-16.0.0-rc4, llvmorg-16.0.0-rc3, llvmorg-16.0.0-rc2, llvmorg-16.0.0-rc1, llvmorg-17-init, llvmorg-15.0.7, llvmorg-15.0.6, llvmorg-15.0.5, llvmorg-15.0.4, llvmorg-15.0.3, llvmorg-15.0.2, llvmorg-15.0.1, llvmorg-15.0.0, llvmorg-15.0.0-rc3, llvmorg-15.0.0-rc2 |
|
| #
d6e5bfce |
| 01-Aug-2022 |
Jez Ng <[email protected]> |
[lld-macho] Support EH frame pointer encodings that use sdata4
Previously we only supporting using the system pointer size (aka the `absptr` encoding) because `llvm-mc`'s CFI directives always gener
[lld-macho] Support EH frame pointer encodings that use sdata4
Previously we only supporting using the system pointer size (aka the `absptr` encoding) because `llvm-mc`'s CFI directives always generate EH frames with that encoding. But libffi uses 4-byte-encoded, hand-rolled EH frames, so this patch adds support for it.
Fixes #56576.
Reviewed By: #lld-macho, oontvoo
Differential Revision: https://reviews.llvm.org/D130804
(cherry picked from commit 6c9f6812523a706c11a12e6cb4119b0cf67bbb21)
show more ...
|
|
Revision tags: llvmorg-15.0.0-rc1, llvmorg-16-init, llvmorg-14.0.6 |
|
| #
e183bf8e |
| 13-Jun-2022 |
Jez Ng <[email protected]> |
[lld-macho][reland] Initial support for EH Frames
This reverts commit 942f4e3a7cc9a9f8b2654817cff12907d1276031.
The additional change required to avoid the assertion errors seen previously is:
-
[lld-macho][reland] Initial support for EH Frames
This reverts commit 942f4e3a7cc9a9f8b2654817cff12907d1276031.
The additional change required to avoid the assertion errors seen previously is:
--- a/lld/MachO/ICF.cpp +++ b/lld/MachO/ICF.cpp @@ -443,7 +443,9 @@ void macho::foldIdenticalSections() { /*relocVA=*/0); isec->data = copy; } - } else { + } else if (!isEhFrameSection(isec)) { + // EH frames are gathered as hashables from unwindEntry above; give a + // unique ID to everything else. isec->icfEqClass[0] = ++icfUniqueID; } }
Differential Revision: https://reviews.llvm.org/D123435
show more ...
|
|
Revision tags: llvmorg-14.0.5 |
|
| #
826be330 |
| 09-Jun-2022 |
Jez Ng <[email protected]> |
[lld-macho] Initial support for EH Frames
== Background ==
`llvm-mc` generates unwind info in both compact unwind and DWARF formats. LLD already handles the compact unwind format; this diff gets us
[lld-macho] Initial support for EH Frames
== Background ==
`llvm-mc` generates unwind info in both compact unwind and DWARF formats. LLD already handles the compact unwind format; this diff gets us close to handling the DWARF format properly.
== Caveats ==
It's not quite done yet, but I figure it's worth getting this reviewed and landed first as it's shaping up to be a fairly large code change.
**Known limitations of the current code:**
* Only works for x86_64, for which `llvm-mc` emits "abs-ified" relocations as described in https://github.com/llvm/llvm-project/commit/618def651b59bd42c05bbd91d825af2fb2145683. `llvm-mc` emits regular relocations for ARM EH frames, which we do not yet handle correctly.
Since the feature is not ready for real use yet, I've gated it behind a flag that only gets toggled on during test suite runs. With most of the new code disabled, we see just a hint of perf regression, so I don't think it'd be remiss to land this as-is:
base diff difference (95% CI) sys_time 1.926 ± 0.168 1.979 ± 0.117 [ -1.2% .. +6.6%] user_time 3.590 ± 0.033 3.606 ± 0.028 [ +0.0% .. +0.9%] wall_time 7.104 ± 0.184 7.179 ± 0.151 [ -0.2% .. +2.3%] samples 30 31
== Design ==
Like compact unwind entries, EH frames are also represented as regular ConcatInputSections that get pointed to via `Defined::unwindEntry`. This allows them to be handled generically by e.g. the MarkLive and ICF code. (But note that unlike compact unwind subsections, EH frame subsections do end up in the final binary.)
In order to make EH frames "look like" a regular ConcatInputSection, some processing is required. First, we need to split the `__eh_frame` section along EH frame boundaries rather than along symbol boundaries. We do this by decoding the length field of each EH frame. Second, the abs-ified relocations need to be turned into regular Relocs.
== Next Steps ==
In order to support EH frames on ARM targets, we will either have to teach LLD how to handle EH frames with explicit relocs, or we can try to make `llvm-mc` emit abs-ified relocs for ARM as well. I'm hoping to do the latter as I think it will make the LLD implementation both simpler and faster to execute.
== Misc ==
The `obj-file-with-stabs.s` test had to be updated as the previous version would trip assertion errors in the code. It appears that in our attempt to produce a minimal YAML test input, we created a file with invalid EH frame data. I've fixed this by re-generating the YAML and not doing any hand-pruning of it.
Reviewed By: #lld-macho, Roger
Differential Revision: https://reviews.llvm.org/D123435
show more ...
|