This is the mail archive of the libc-hacker@sources.redhat.com mailing list for the glibc project.

Note that libc-hacker is a closed list. You may look at the archives of this list, but subscription and posting are not open.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: [PATCH] Fix alpha elf_machine_load_address


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]