On 16 Nov 2011, at 19:12, Richard Henderson wrote:

On 11/16/2011 08:38 AM, Rainer Orth wrote:
        * config/generic/asmcfi.h: Fix comment.
        * config/x86/sjlj.S (_ITM_beginTransaction): Provide PIC code
        sequence without .hidden support.
        (GTM_longjmp) [__ELF__]: Only use .hidden if
        HAVE_ATTRIBUTE_VISIBILITY.

Nearly ok.

+       subl    $4, %esp
+       movl    %ebx, 24(%esp)
+       call    1f
+1:     popl    %ebx
+       addl    $_GLOBAL_OFFSET_TABLE_+[.-1b], %ebx
+       call    GTM_begin_transaction@PLT
+       movl    24(%esp), %ebx
+       addl    $4, %esp

This is overly complicated.  We've saved %ebx at 12(%esp) above.
This should be as simple as

        call    1f
1:      popl    %ebx
        addl    $_GLOBAL_OFFSET_TABLE_+[.-1b], %ebx
        call    GTM_begin_transaction@PLT
        movl    12(%esp), %ebx

It also needs wrapping like

#elif defined(__ELF__)
        ...
#else
# error "Unsupported PIC sequence"
#endif

... which will almost certainly immediately fail on Darwin, but
at least not with some reference to @PLT.

we have  the equivalent of hidden on Darwin :

        .private_extern

I will try and get back to this .. been busy with other stuff....

at the moment the two things top issues remaining on Darwn are:

1. underscores for the ASM functions.

.. Darwin's asm will not add an underscore to functions .. so we end up with unresolved refs to __ITM_beginTransaction/GTM_...

2. providing a section name for .tm_clone_section that is compatible with Mach-o section semantics.

I've hacked around this for my tests by making a target macro, but maybe you have some other preference.

Iain

Reply via email to