[dsymutil] Fix handling of common symbols.
authorFrederic Riss <friss@apple.com>
Sun, 31 Jan 2016 04:29:34 +0000 (04:29 +0000)
committerFrederic Riss <friss@apple.com>
Sun, 31 Jan 2016 04:29:34 +0000 (04:29 +0000)
commit6c8521ad32d61943d031ad165c5c2412e3d64bc6
tree70f15e9ae122b652524dfec6b9de78275e3cfb03
parentd8c33dc2f60becafd0460d4e24d211316f64e521
[dsymutil] Fix handling of common symbols.

llvm-dsymutil was misinterpreting the value of common symbols as their
address when it actually contains their size. This didn't impact
llvm-dsymutil's ability to link the debug information for common symbols
because these are always found by name and not by address. Things could
however go wrong when the size of a common object matched the object
file address of another symbol. Depending on the link order of the symbols
the common object might incorrectly evict this other object from the
address to symbol mapping, and then link the evicted symbol with a wrong
binary address.

Use the new ability to have symbols without an object file address to fix
this.

llvm-svn: 259318
llvm/test/tools/dsymutil/Inputs/common.macho.x86_64 [new file with mode: 0755]
llvm/test/tools/dsymutil/Inputs/common.macho.x86_64.o [new file with mode: 0644]
llvm/test/tools/dsymutil/X86/common-sym.test [new file with mode: 0644]
llvm/test/tools/dsymutil/absolute_symbol.test
llvm/test/tools/dsymutil/basic-linking.test
llvm/test/tools/dsymutil/debug-map-parsing.test
llvm/test/tools/dsymutil/yaml-object-address-rewrite.test
llvm/tools/dsymutil/DebugMap.cpp
llvm/tools/dsymutil/MachODebugMapParser.cpp