[PATCH] [lld] Enable writing of compact unwind sections

Nick Kledzik kledzik at apple.com
Wed Jun 25 16:29:38 PDT 2014


On Jun 25, 2014, at 2:49 AM, Tim Northover <t.p.northover at gmail.com> wrote:

> On 23 June 2014 17:09, Nick Kledzik <kledzik at apple.com> wrote:
>> If you want to get around the assert, for now you can create a place holder
>> function that takes all the __compact_unwind unwind atoms and replaces
>> them with one __unwind_info atom.
> 
> OK, having looked around I'm not sure I do understand what you're saying here.
> 
> It looks like some kind of architectural change will be needed to give
> typeCompactUnwind atoms any kind of special behaviour: either a new
> typeProcessedCompactUnwind and a pass to do the mapping during link
> (which I'd suggest simply drop all compact-unwind atoms for now, even
> producing a trivial __unwind_info is not actually trivial), or some
> kind of modularity in MachONormalizedFileFromAtoms.
> 
> Which one did you mean originally, or something entirely different?
Write a Pass which is only run for certain arches and certain output
mach-o types.  The pass does all the work to build a new atom
which is the __unwind_info section from the typeCompactUnwind 
and typeCFI atoms.  

But to properly test the output of this pass, we’d need a tool that
can dump the  __unwind_info section.  I have such a tool in ld64
called “unwindinfo” which we’d need to port to LLVM.  


> 
> Another option for the assert might be simply putting the data back
> into an __LD,__compact_unwind section for now. As I understand it,
> that would be harmless for correctness (libUnwind just carries on to
> __eh_frame directly if there's no __TEXT,__unwind_info), and it would
> fit reasonably into the current scheme.
This is a reasonable short term solution.

-Nick






More information about the llvm-commits mailing list