Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[lld-macho] Use fewer indirections in UnwindInfo implementation
The previous implementation of UnwindInfoSection materialized all the compact unwind entries & applied their relocations, then parsed the resulting data to generate the final unwind info. This design had some unfortunate conseqeuences: since relocations can only be applied after their referents have had addresses assigned, operations that need to happen before address assignment must contort themselves. (See {D113582} and observe how this diff greatly simplifies it.) Moreover, it made synthesizing new compact unwind entries awkward. Handling PR50956 will require us to do this synthesis, and is the main motivation behind this diff. Previously, instead of generating a new CompactUnwindEntry directly, we would have had to generate a ConcatInputSection with a number of `Reloc`s that would then get "flattened" into a CompactUnwindEntry. This diff introduces an internal representation of `CompactUnwindEntry` (the former `CompactUnwindEntry` has been renamed to `CompactUnwindLayout`). The new CompactUnwindEntry stores references to its personality symbol and LSDA section directly, without the use of `Reloc` structs. In addition to being easier to work with, this diff also allows us to handle unwind info whose personality symbols are located in sections placed after the `__unwind_info`. Reviewed By: #lld-macho, oontvoo Differential Revision: https://reviews.llvm.org/D123276
- Loading branch information
Showing
4 changed files
with
63 additions
and
113 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters