[dsymutil] Add support for linking remarks
authorFrancis Visoiu Mistrih <francisvm@yahoo.com>
Mon, 30 Sep 2019 16:05:12 +0000 (09:05 -0700)
committerFrancis Visoiu Mistrih <francisvm@yahoo.com>
Fri, 1 Nov 2019 22:38:49 +0000 (15:38 -0700)
commit1ee18f275e60462d8c5e149fc74eaea9c671d4a8
treea204f82983d8a71038bf0c2b7fc08a0777cead73
parent1de2a05701e73f8ef5914c2f6ea2dcbe617ce18b
[dsymutil] Add support for linking remarks

This adds support to dsymutil for linking remark files and placing them
in the final .dSYM bundle.

The result will be placed in:

* a.out.dSYM/Contents/Resources/Remarks/a.out
or
* a.out.dSYM/Contents/Resources/Remarks/a.out-<arch> for universal binaries

When multi-threaded, this runs a third thread which loops over all the
object files and parses remarks as it finds __remarks sections.

Testing this involves running dsymutil on pre-built binaries and object
files, then running llvm-bcanalyzer on the final result to check for
remarks.

Differential Revision: https://reviews.llvm.org/D69142
24 files changed:
llvm/test/tools/dsymutil/Inputs/basic1.c
llvm/test/tools/dsymutil/Inputs/remarks/basic.macho.remarks.x86_64 [new file with mode: 0755]
llvm/test/tools/dsymutil/Inputs/remarks/basic1.macho.remarks.x86_64.o [new file with mode: 0644]
llvm/test/tools/dsymutil/Inputs/remarks/basic1.macho.remarks.x86_64.opt.bitstream [new file with mode: 0644]
llvm/test/tools/dsymutil/Inputs/remarks/basic2.macho.remarks.x86_64.o [new file with mode: 0644]
llvm/test/tools/dsymutil/Inputs/remarks/basic2.macho.remarks.x86_64.opt.bitstream [new file with mode: 0644]
llvm/test/tools/dsymutil/Inputs/remarks/basic3.macho.remarks.x86_64.o [new file with mode: 0644]
llvm/test/tools/dsymutil/Inputs/remarks/basic3.macho.remarks.x86_64.opt.bitstream [new file with mode: 0644]
llvm/test/tools/dsymutil/Inputs/remarks/fat.macho.remarks.i386.opt.bitstream [new file with mode: 0644]
llvm/test/tools/dsymutil/Inputs/remarks/fat.macho.remarks.x86 [new file with mode: 0755]
llvm/test/tools/dsymutil/Inputs/remarks/fat.macho.remarks.x86.c [new file with mode: 0644]
llvm/test/tools/dsymutil/Inputs/remarks/fat.macho.remarks.x86.o [new file with mode: 0644]
llvm/test/tools/dsymutil/Inputs/remarks/fat.macho.remarks.x86.opt.bitstream [new file with mode: 0644]
llvm/test/tools/dsymutil/Inputs/remarks/fat.macho.remarks.x86_64.opt.bitstream [new file with mode: 0644]
llvm/test/tools/dsymutil/Inputs/remarks/fat.macho.remarks.x86_64h.opt.bitstream [new file with mode: 0644]
llvm/test/tools/dsymutil/X86/basic-linking-bundle.test
llvm/test/tools/dsymutil/X86/remarks-linking-bundle.test [new file with mode: 0644]
llvm/test/tools/dsymutil/X86/remarks-linking-fat-bundle.test [new file with mode: 0644]
llvm/test/tools/dsymutil/cmdline.test
llvm/tools/dsymutil/CMakeLists.txt
llvm/tools/dsymutil/DwarfLinker.cpp
llvm/tools/dsymutil/LinkUtils.h
llvm/tools/dsymutil/Options.td
llvm/tools/dsymutil/dsymutil.cpp