On Tue, 2015-10-06 at 19:36 -0400, Rich Felker wrote:
> > 
> > Do you have some alternatives to what's currently in the patch?  It's
> > difficult to judge without seeing them...
> 
> Perhaps something like the following:
> 
> #ifdef __SH_FDPIC__
> typedef __attribute__((__may_alias__)) uintptr_t sh_aliased_uintptr_t;
> #define SH_CODE_ADDR(x) (*(sh_aliased_uintptr_t *)(x))
> #else
> #define SH_CODE_ADDR(x) x
> #endif
> 
> And then just passing SH_CODE_ADDR(__udiv_qrnnd_16) rather than just
> __udiv_qrnnd_16 as the input to the asm.

Looks OK to me.  Have you tried it?  I'm not sure whether uintptr_t is
always available in this case.  It seems longlong.h is used in a couple
of places, for the host and for the target.  To be on the safe side,
it'd be better to do a native GCC build with FDPIC enabled and some
cross builds.  I'm not sure if this is feasible/possible at the moment.
Maybe defer this and make a follow up patch?

Cheers,
Oleg

Reply via email to