>     3. Position independence is still problem.
> 
>     > - In SH4 asm, the MOVA is hidden behind a normal mov.l without a base
>     > register, so in fact, it is used very often.
> 
>     Can't confirm this. Well, I can see now that it extensively uses 'mov.l
>     @(disp,PC),Rn' for loading constants, but no mova... I.e. following is
>     position-independent:
> 
>            mov.l   label,rx
> 
>     label:
>            .long   xxxx
> 
>     Only[!] as long as xxxx is *not* another label, in which case a
>     relocation record is generated voiding position independence.
> 
> 
> => I know, nevertheless, if you compile code on SH4 with gcc with -PIC,
> then the same apply, so currently, I don't see the point to make real
> PIC code on this CPU.

I can not confirm this, i.e. that gcc -fPIC generates
non-position-independent code on SH4 platform. At least code generated
by 3.4.6 is perfectly position-independent and there are no constructs
as above with xxxx being another label, it's always *offset* to the
other label. In other words if you want to pull reference to a [distant]
table you'd go:

        mova    pic_label,r0
        mov.l   @r0,rx
        add     r0,rx
        ...
pic_label:
        .long   table-pic_label

A.


______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [email protected]
Automated List Manager                           [email protected]

Reply via email to