This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
RE: [Patch, MIPS] Modify dl-machine.h for mips32r6/mips64r6
- From: Matthew Fortune <Matthew dot Fortune at imgtec dot com>
- To: Steve Ellcey <Steve dot Ellcey at imgtec dot com>, "libc-alpha at sourceware dot org" <libc-alpha at sourceware dot org>
- Date: Fri, 19 Dec 2014 21:54:50 +0000
- Subject: RE: [Patch, MIPS] Modify dl-machine.h for mips32r6/mips64r6
- Authentication-results: sourceware.org; auth=none
- References: <67afeb7f-c91f-4702-bf3e-97d9d22bd9b7 at BAMAIL02 dot ba dot imgtec dot org>
> diff --git a/sysdeps/mips/dl-machine.h b/sysdeps/mips/dl-machine.h
> index 5000d2a..8885c80 100644
> --- a/sysdeps/mips/dl-machine.h
> +++ b/sysdeps/mips/dl-machine.h
> @@ -138,7 +138,11 @@ elf_machine_load_address (void)
> #ifndef __mips16
> asm (" .set noreorder\n"
> " " STRINGXP (PTR_LA) " %0, 0f\n"
> +#if __mips_isa_rev < 6
> " bltzal $0, 0f\n"
> +#else
> + " bal 0f\n"
> +#endif
> " nop\n"
> "0: " STRINGXP (PTR_SUBU) " %0, $31, %0\n"
> " .set reorder\n"
I never got to reviewing this internally. We should switch this to using
ADDIUPC.
The goal of this code I believe is to determine the relative offset from the
static and dynamic locations of ld.so.
" STRINGXP (PTR_LA) " %0, 0f\n"
0: addiupc <reg>, 0
" STRINGXP (PTR_SUBU) " %0, <reg>, %0\n"
We should also do something similar with the other case.
Thanks,
Matthew