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.


r~

Reply via email to