[dsymutil] Fix handling of common symbols in multiple object files.
authorJonas Devlieghere <jonas@devlieghere.com>
Wed, 9 Oct 2019 04:16:18 +0000 (04:16 +0000)
committerJonas Devlieghere <jonas@devlieghere.com>
Wed, 9 Oct 2019 04:16:18 +0000 (04:16 +0000)
commit4ac388f7caccc94065712878667829cebd7b8083
tree7fd306e8936b653874bb3df04ddfbeeacfb9a867
parent0746aafd89754a2ae9992c4d6394e3b4f3623b1d
[dsymutil] Fix handling of common symbols in multiple object files.

For common symbols the linker emits only a single symbol entry in the
debug map. This caused dsymutil to not relocate common symbols when
linking DWARF coming form object files that did not have this entry.
This patch fixes that by keeping track of common symbols in the object
files and synthesizing a debug map entry for them using the address from
the main binary.

Differential revision: https://reviews.llvm.org/D68680

llvm-svn: 374139
llvm/test/tools/dsymutil/Inputs/private/tmp/common/com [new file with mode: 0755]
llvm/test/tools/dsymutil/Inputs/private/tmp/common/com1.o [new file with mode: 0644]
llvm/test/tools/dsymutil/Inputs/private/tmp/common/com2.o [new file with mode: 0644]
llvm/test/tools/dsymutil/X86/common-sym-multi.test [new file with mode: 0644]
llvm/tools/dsymutil/MachODebugMapParser.cpp