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

Kai Nacke kai.nacke at redstar.de
Fri Jun 7 08:06:23 PDT 2013


Hi! Does anybody have a chance to look at this?

Thank you

Regards
Kai

On 31.05.2013 13:43, Kai Nacke wrote:
> Ping^2.
>
> After finding yet another issue I realized that the patch was getting
> far too big. Therefore I splitted the patch into 4 parts.
>
> The first patch fixes the failing seh.s test. The second patch changes
> the relocation type to IMAGE_REL_AMD64_ADDR32NB as required by the MS
> COFF spec. The third patch adresses an alignment problem inside the
> unwind info data structure (this one is new). The fourth patch outputs
> the personality function and the language data into the right places.
>
> Each patch except the last one contains test cases. Currently, there is
> no code path in LLVM to trigger the changed code. I will add test cases
> for this with my next patch which will add support for Win64 EH to LLVM.
>
> @Anton
> I am CC'ing you because you reviewed my MC patches the last time.
>
> Regards
> Kai
>
> On 22.05.2013 07:59, Kai Nacke wrote:
>> 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
>>>
>>
>>
>> _______________________________________________
>> 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