OSDN Git Service

[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)
commit99a07120d47e1881a14a7b36bf7cf6bbd54954af
tree01ee778edb7de2aa3cabd22048ba43f5085ef13a
parentc5413fcc11958f06d26fbaaae62d28edff38c0ef
[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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259318 91177308-0d34-0410-b5e6-96231b3b80d8
test/tools/dsymutil/Inputs/common.macho.x86_64 [new file with mode: 0755]
test/tools/dsymutil/Inputs/common.macho.x86_64.o [new file with mode: 0644]
test/tools/dsymutil/X86/common-sym.test [new file with mode: 0644]
test/tools/dsymutil/absolute_symbol.test
test/tools/dsymutil/basic-linking.test
test/tools/dsymutil/debug-map-parsing.test
test/tools/dsymutil/yaml-object-address-rewrite.test
tools/dsymutil/DebugMap.cpp
tools/dsymutil/MachODebugMapParser.cpp