[PATCH][X86_64/MC] Towards usable Win64 exception handling

Kai Nacke kai at redstar.de
Tue May 21 22:59:53 PDT 2013


Ping.

On 18.05.2013 14:49, Kai Nacke wrote:
> Hi!
>
> On 17.05.2013 22:00, Rafael EspĂ­ndola wrote:
>  > needs a testcase.
>
> I realized that the main test case is currently marked as XFAIL because
> of a wrong offset for unwind code SET_FP. I also fixed this, re-enabled
> the test case and added a check for the changed relocation type.
>
> Every aspect of this patch should now be covered by a test.
>
> Regards
> Kai
>
> On 17.05.2013 16:27, Kai Nacke wrote:
>> Hi!
>>
>> This patch fixes a couple of problems in the Win64 EH code.
>>
>> - The emitted EH handler is now the personality function specified in
>> the IR instead of the hard coded _GCC_specific_handler
>> (_GCC_specific_handler is not called from SEH code - it's
>> __gcc_personality_seh0. Specify this as personality function if you like
>> to try the GCC code.)
>>
>> - The Dwarf EH code ("gcc_except_table") is no longer emitted into a
>> separate section but into the UNWIND_INFO structure as language specific
>> handler data. A pointer to this data is passed in field
>> DISPATCHER_CONTEXT->HandlerData to the personality function.
>>
>> - All relocations now use the VK_COFF_IMGREL32 modifier. This is
>> required by the COFF specification and keeps the MS LINK tool happy. The
>> linker flag /LARGEADDRESSAWARE:NO is no longer required.
>>
>> - Begin and end address of a function are now expressed as offsets from
>> the function symbol instead of emitting the temporary labels. The latter
>> approach didn't work with the VK_COFF_IMGREL32 modifier. Nice side
>> effect is that llvm-objdump now displays the function symbol, too.
>>
>> Using this patch and a modified version of the patch to create the
>> unwinding code from Charles Davis I am able to raise an exception
>> via RaiseException and get the personality function called. :-)
>>
>> Please review. (BTW: This patch supersedes my mail "MCWin64EH:
>> reloctions must be IMGREL32")
>>
>> Regards
>> Kai
>>
>>
>> _______________________________________________
>> llvm-commits mailing list
>> llvm-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>>
>
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>





More information about the llvm-commits mailing list