Fix n64 fallout from MIPS prelinker patch
Richard Sandiford
rsandifo@nildram.co.uk
Tue Feb 27 21:31:00 GMT 2007
As Khem noticed, my prelinker patch broke n64. I'd forgotten
(not for the first time) that Elf64_Word is actually a 32-bit
value. Specifically, r_info is an Elf32_Word but an Elf64_Xword.
Unfortunately, there's no such thing as an Elf32_Xword, so this
patch changes the type of elf_machine_reloc's r_info field from
ElfW(Word) to ElfW(Addr), which is 32 bits for ELF32 and 64 bits
for ELF64. Please install if OK.
Richard
2007-02-27 Richard Sandiford <rsandifo@nildram.co.uk>
* sysdeps/mips/dl-machine.h (elf_machine_reloc): Change type of
r_info argument to ElfW(Addr).
(elf_machine_rel, elf_machine_rela): Update calls accordingly.
Index: sysdeps/mips/dl-machine.h
===================================================================
RCS file: /cvs/glibc/ports/sysdeps/mips/dl-machine.h,v
retrieving revision 1.82
diff -u -p -r1.82 dl-machine.h
--- sysdeps/mips/dl-machine.h 8 Jan 2007 15:34:50 -0000 1.82
+++ sysdeps/mips/dl-machine.h 25 Feb 2007 23:38:54 -0000
@@ -304,7 +304,7 @@ do { \
auto inline void
__attribute__ ((always_inline))
-elf_machine_reloc (struct link_map *map, ElfW(Word) r_info,
+elf_machine_reloc (struct link_map *map, ElfW(Addr) r_info,
const ElfW(Sym) *sym, const struct r_found_version *version,
void *reloc_addr, ElfW(Addr) r_addend, int inplace_p)
{
@@ -490,7 +490,8 @@ elf_machine_rel (struct link_map *map, c
const ElfW(Sym) *sym, const struct r_found_version *version,
void *const reloc_addr)
{
- elf_machine_reloc (map, reloc->r_info, sym, version, reloc_addr, 0, 1);
+ elf_machine_reloc (map, (ElfW(Addr)) reloc->r_info,
+ sym, version, reloc_addr, 0, 1);
}
auto inline void
@@ -515,8 +516,8 @@ elf_machine_rela (struct link_map *map,
const ElfW(Sym) *sym, const struct r_found_version *version,
void *const reloc_addr)
{
- elf_machine_reloc (map, reloc->r_info, sym, version, reloc_addr,
- reloc->r_addend, 0);
+ elf_machine_reloc (map, (ElfW(Addr)) reloc->r_info, sym, version,
+ reloc_addr, reloc->r_addend, 0);
}
auto inline void
More information about the Libc-ports
mailing list