summaryrefslogtreecommitdiff
path: root/llvm/tools/dsymutil/RelocationMap.cpp
AgeCommit message (Collapse)Author
2023-10-26Reland [dsymutil] Add support for mergeable libraries (#70256)Alpha Abdoulaye
Reland https://reviews.llvm.org/D158124 Fixed `-fpermissive` error reported by gcc only.
2023-10-24Revert "[dsymutil] Add support for mergeable libraries"Philip Reames
This reverts commit 122c89b271af30b86536cad7bac64ea9c56615ed. Change does not build, with errors such as: In file included from ../llvm-project/llvm/tools/dsymutil/DebugMap.h:24, from ../llvm-project/llvm/tools/dsymutil/DwarfLinkerForBinary.h:13, from ../llvm-project/llvm/tools/dsymutil/DwarfLinkerForBinary.cpp:9: ../llvm-project/llvm/tools/dsymutil/RelocationMap.h:60:17: error: declaration of ‘llvm::dsymutil::SymbolMapping llvm::dsymutil::ValidReloc::SymbolMapping’ changes meaning of ‘SymbolMapping’ [-fpermissive] 60 | SymbolMapping SymbolMapping; | ^~~~~~~~~~~~~ ../llvm-project/llvm/tools/dsymutil/RelocationMap.h:36:8: note: ‘SymbolMapping’ declared here as ‘struct llvm::dsymutil::SymbolMapping’ 36 | struct SymbolMapping { | ^~~~~~~~~~~~~ In file included from ../llvm-project/llvm/tools/dsymutil/DwarfLinkerForBinary.h:13, from ../llvm-project/llvm/tools/dsymutil/DwarfLinkerForBinary.cpp:9: ../llvm-project/llvm/tools/dsymutil/DebugMap.h:198:32: error: declaration of ‘std::optional<llvm::dsymutil::RelocationMap> llvm::dsymutil::DebugMapObject::RelocationMap’ changes meaning of ‘RelocationMap’ [-fpermissive] 198 | std::optional<RelocationMap> RelocationMap; | ^~~~~~~~~~~~~ In file included from ../llvm-project/llvm/tools/dsymutil/DebugMap.h:24, from ../llvm-project/llvm/tools/dsymutil/DwarfLinkerForBinary.h:13, from ../llvm-project/llvm/tools/dsymutil/DwarfLinkerForBinary.cpp:9: ../llvm-project/llvm/tools/dsymutil/RelocationMap.h:76:7: note: ‘RelocationMap’ declared here as ‘class llvm::dsymutil::RelocationMap’ 76 | class RelocationMap { | ^~~~~~~~~~~~~
2023-10-24[dsymutil] Add support for mergeable librariesAlpha Abdoulaye
This adds support in dsymutil for mergeable libraries [1]. 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. [1] https://developer.apple.com/documentation/xcode/configuring-your-project-to-use-mergeable-libraries Differential revision: https://reviews.llvm.org/D158124