[PATCH] D158124: [dsymutil] Add support for mergeable libraries
Alpha Abdoulaye via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 16 15:19:59 PDT 2023
Alpha created this revision.
Alpha added reviewers: JDevlieghere, avl.
Herald added a subscriber: hiraditya.
Herald added a reviewer: jhenderson.
Herald added a project: All.
Alpha requested review of this revision.
Herald added subscribers: llvm-commits, MaskRay.
Herald added a project: LLVM.
This adds support in dsymutil for mergeable libraries <https://developer.apple.com/documentation/xcode/configuring-your-project-to-use-mergeable-libraries>.
dsymutil reads a new stab emitted by ld, allowing it to operate on dynamic libraries instead of object files. It also now loads the Dwarf files associated to the libraries, and build the debug map for each binary from the list of symbols exported by the library.
For each Debug Map Object, there is a new associated Relocation Map which is serialized from the information retrieved in the original debug_info (or debug_addr) section of the .o file.
The final DWARF file has multiple compile units, so the offsets information of the relocations are adjusted relatively to the compile unit they will end up belonging to, inside the final linked DWARF file.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D158124
Files:
llvm/include/llvm/BinaryFormat/Dwarf.def
llvm/include/llvm/BinaryFormat/MachO.h
llvm/include/llvm/DWARFLinker/DWARFLinker.h
llvm/include/llvm/DWARFLinker/DWARFLinkerCompileUnit.h
llvm/include/llvm/DWARFLinkerParallel/AddressesMap.h
llvm/include/llvm/TargetParser/Triple.h
llvm/lib/DWARFLinker/DWARFLinker.cpp
llvm/lib/TargetParser/Triple.cpp
llvm/test/tools/dsymutil/Inputs/bar-relink-variant.dylib.dSYM/Contents/Info.plist
llvm/test/tools/dsymutil/Inputs/bar-relink-variant.dylib.dSYM/Contents/Resources/DWARF/bar-relink-variant.dylib
llvm/test/tools/dsymutil/Inputs/bar-relink-variant.dylib.dSYM/Contents/Resources/Relocations/aarch64/bar-relink-variant.dylib.yml
llvm/test/tools/dsymutil/Inputs/bar-relink.dylib.dSYM/Contents/Info.plist
llvm/test/tools/dsymutil/Inputs/bar-relink.dylib.dSYM/Contents/Resources/DWARF/bar-relink.dylib
llvm/test/tools/dsymutil/Inputs/bar-relink.dylib.dSYM/Contents/Resources/Relocations/aarch64/bar-relink.dylib.yml
llvm/test/tools/dsymutil/Inputs/basic-relink.macho.arm64.dylib
llvm/test/tools/dsymutil/Inputs/basic-relink.macho.arm64.o
llvm/test/tools/dsymutil/Inputs/foo-relink-variant.dylib.dSYM/Contents/Info.plist
llvm/test/tools/dsymutil/Inputs/foo-relink-variant.dylib.dSYM/Contents/Resources/DWARF/foo-relink-variant.dylib
llvm/test/tools/dsymutil/Inputs/foo-relink-variant.dylib.dSYM/Contents/Resources/DWARF/foo-relink-variant_debug.dylib
llvm/test/tools/dsymutil/Inputs/foo-relink-variant.dylib.dSYM/Contents/Resources/Relocations/aarch64/foo-relink-variant.dylib.yml
llvm/test/tools/dsymutil/Inputs/foo-relink.dylib.dSYM/Contents/Info.plist
llvm/test/tools/dsymutil/Inputs/foo-relink.dylib.dSYM/Contents/Resources/DWARF/foo-relink.dylib
llvm/test/tools/dsymutil/Inputs/foo-relink.dylib.dSYM/Contents/Resources/Relocations/aarch64/foo-relink.dylib.yml
llvm/test/tools/dsymutil/Inputs/proxy-relink.dylib.dSYM/Contents/Info.plist
llvm/test/tools/dsymutil/Inputs/proxy-relink.dylib.dSYM/Contents/Resources/DWARF/proxy-relink.dylib
llvm/test/tools/dsymutil/Inputs/proxy-relink.dylib.dSYM/Contents/Resources/Relocations/aarch64/proxy-relink.dylib.yml
llvm/test/tools/dsymutil/Inputs/two-level-relink.macho.arm64.dylib
llvm/test/tools/dsymutil/Inputs/variant-relink.macho.arm64.dylib
llvm/test/tools/dsymutil/basic-linking.test
llvm/tools/dsymutil/CMakeLists.txt
llvm/tools/dsymutil/DebugMap.cpp
llvm/tools/dsymutil/DebugMap.h
llvm/tools/dsymutil/DwarfLinkerForBinary.cpp
llvm/tools/dsymutil/DwarfLinkerForBinary.h
llvm/tools/dsymutil/LinkUtils.h
llvm/tools/dsymutil/MachODebugMapParser.cpp
llvm/tools/dsymutil/Options.td
llvm/tools/dsymutil/RelocationMap.cpp
llvm/tools/dsymutil/RelocationMap.h
llvm/tools/dsymutil/dsymutil.cpp
llvm/tools/dsymutil/dsymutil.h
llvm/tools/llvm-dwarfutil/DebugInfoLinker.cpp
llvm/tools/llvm-nm/llvm-nm.cpp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D158124.550902.patch
Type: text/x-patch
Size: 75494 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230816/5a835290/attachment.bin>
More information about the llvm-commits
mailing list