[PATCHs] Using the MC layer to produce dSYM companion binaries

Frédéric Riss friss at apple.com
Wed Aug 5 08:24:35 PDT 2015


Hi,

I’m directly and indirectly using the MC layer to produce the content of the debug sections in llvm-dsymutil. This works great, except that dsymutil is supposed to produce dSYM companion binaries and not the simple object files MC was designed to produce.

At some point I contemplated making MC generic enough to emit these kind of binaries, but it just feels like a bad fit. Moreover dSYM companion binaries have a number of unique characteristics that I think would fit pretty badly into any kind of generic framework (eg. fake sections that have a size but no contents or VM layout without any loadable sections).

I went the route of writing my own equivalent of the MCObjectWriter in llvm-dsymutil which was easy enough. Today the layout of the sections and the file emission is done inside MCAssembler::Finish(). For my usecase, I want to run only the section layout and do the emission myself. The first attached patch allows that by splitting a layout(MCAsmLayout &) method out of MCAssembler::Finish(). Does this look reasonable?

I also tried to reuse some low-level MachObjectWriter primitives. The second patch attached allows me to do just that by making them a tad more generic.

Both patches should have NFC.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: 01-split-out-mcassembler-layout.patch
Type: application/octet-stream
Size: 1929 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150805/a8e16b84/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 02-make-some-machobjectwriter-routines-more-generic.patch
Type: application/octet-stream
Size: 5157 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150805/a8e16b84/attachment-0001.obj>
-------------- next part --------------





More information about the llvm-commits mailing list