mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-02-13 13:45:16 +00:00
![Jez Ng](/assets/img/avatar_default.png)
This diff is motivated by my work to add proper DWARF unwind support. As detailed in PR50956 functions that need DWARF unwind need to have compact unwind entries synthesized for them. These CU entries encode an offset within `__eh_frame` that points to the corresponding DWARF FDE. In order to encode this offset during `UnwindInfoSectionImpl::finalize()`, we need to first assign values to `InputSection::outSecOff` for each `__eh_frame` subsection. But `__eh_frame` is ordered after `__unwind_info` (according to ld64 at least), which puts us in a bit of a bind: `outSecOff` gets assigned during finalization, but `__eh_frame` is being finalized after `__unwind_info`. But it occurred to me that there's no real need for most ConcatOutputSections to be finalized sequentially. It's only necessary for text-containing ConcatOutputSections that may contain branch relocs which may need thunks. ConcatOutputSections containing other types of data can be finalized in any order. This diff moves the finalization logic for non-text sections into a separate `finalizeContents()` method. This method is called before section address assignment & unwind info finalization takes place. In theory we could call these `finalizeContents()` methods in parallel, but in practice it seems to be faster to do it all on the main thread. Reviewed By: #lld-macho, oontvoo Differential Revision: https://reviews.llvm.org/D123279
LLVM Linker (lld)
This directory and its subdirectories contain source code for the LLVM Linker, a modular cross platform linker which is built as part of the LLVM compiler infrastructure project.
lld is open source software. You may freely distribute it under the terms of the license agreement found in LICENSE.txt.
Benchmarking
In order to make sure various developers can evaluate patches over the same tests, we create a collection of self contained programs.
It is hosted at https://s3-us-west-2.amazonaws.com/linker-tests/lld-speed-test.tar.xz
The current sha256 is 10eec685463d5a8bbf08d77f4ca96282161d396c65bd97dc99dbde644a31610f
.