[PATCH] Fix alpha elf_machine_load_address
Jakub Jelinek
jakub@redhat.com
Wed Sep 19 11:00:00 GMT 2001
On Wed, Sep 19, 2001 at 10:47:07AM -0700, Richard Henderson wrote:
> On Wed, Sep 19, 2001 at 07:13:38PM +0200, Jakub Jelinek wrote:
> > + asm("br %0, 1f\n"
> > + "0:\n\t"
> > + "br $0, 2f\n"
> > + "1:\n\t"
> > + ".data\n"
> > + "2:\n\t"
> > + ".quad 0b\n\t"
> > + ".previous"
> > : "=r"(dot));
>
> How about
>
> unsigned long addr;
>
> asm ("bsr %0,1f \n\
> .data \n\
> .align 3 \n\
> nop \n\
> 1: ret %0,(%0),0 \n\
> .quad . \n\
> .previous"
> : "=r"(addr));
>
> return addr - *(unsigned long *)addr;
Should work too, but I wanted to avoid executing code in .data section.
If executing code in .data section is not that bad on alpha with respect to
TLB or caches, then your routine should be used instead.
I'll test it tomorrow.
Jakub
More information about the Libc-hacker
mailing list