[ORC] Tailor ELF debugger support plugin to load-address patching only #168518
+227
−405
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In 4 years the ELF debugger support plugin wasn't adapted to other object formats or debugging approaches. After the renaming NFC in #168343, this patch tailors the plugin to ELF and section load-address patching. It allows removal of abstractions and consolidate processing steps with the newly enabled AllocActions from #168343.
The key change is to process debug sections in one place in a post-allocation pass. Since we can handle the endianness of the ELF file the single
visitSectionLoadAddresses()visitor function now, we don't need to track debug objects and sections in template classes anymore. We keep using theDebugObjectclass and dropDebugObjectSection,ELFDebugObjectSection<ELFT>andELFDebugObject.Furthermore, we now use the allocation's working memory for load-address fixups directly. We can drop the
WritableMemoryBufferfrom the debug object and most of thefinalizeWorkingMemory()step, which saves one copy of the entire debug object buffer. InliningfinalizeAsync()into the pre-fixup pass simplifies quite some logic.We still track
RegisteredObjshere, because we want to free memory once the corresponding code is freed. There will be a follow-up patch that turns it into a dealloc action.