[Object] Search for architecures by name in MachOUniversalBinary::getObjectForArch()
authorFrederic Riss <friss@apple.com>
Mon, 22 Jun 2015 21:33:24 +0000 (21:33 +0000)
committerFrederic Riss <friss@apple.com>
Mon, 22 Jun 2015 21:33:24 +0000 (21:33 +0000)
commit11fcb499220574760f1b7dac1a2daf59cdd1046c
tree6e7e2b82dcb82973142ab88822170c0e36c9081f
parent9a2f12cea91f2538b9ec05d024b5d198462ea0ff
[Object] Search for architecures by name in MachOUniversalBinary::getObjectForArch()

The reason we need to search by name rather than by Triple::ArchType
is to handle subarchitecture correclty. There is no different ArchType
for the x86_64h architecture (it identifies itself as x86_64), or for
the various ARM subarches. The only way to get to the subarch slice
in an universal binary is to search by name.

This issue led to hard to debug and transient symbolication failures
in Asan tests (it mostly works, because the files are very similar).

This also affects the Profiling infrastucture as it is the other user
of that API.

Reviewers: samsonov, bogner

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D10604

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240339 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Object/MachOUniversal.h
include/llvm/ProfileData/CoverageMapping.h
include/llvm/ProfileData/CoverageMappingReader.h
lib/Object/MachOUniversal.cpp
lib/ProfileData/CoverageMapping.cpp
lib/ProfileData/CoverageMappingReader.cpp
test/tools/llvm-symbolizer/Inputs/fat.c [new file with mode: 0644]
test/tools/llvm-symbolizer/Inputs/fat.o [new file with mode: 0644]
test/tools/llvm-symbolizer/fat.test [new file with mode: 0644]
tools/llvm-cov/CodeCoverage.cpp
tools/llvm-symbolizer/LLVMSymbolize.cpp