This is the mail archive of the mailing list for the libc-ports project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH 2/2] MIPS: Fix n64 `ldconfig' for 32-bit objects


 This patch, rather obvious (and coded such as to make it obvious what is 
going on here), is needed on top of for n64 `ldconfig' to 
differentiate correctly between o32 and n32 binaries when maintaining the 
cache.  With n64 "elf_header" is declared as (Elf64_Ehdr *) which has a 
different layout to the header of 32-bit ELF files, so the fix is to cast 
the pointer to the correct one, i.e. (Elf32_Ehdr *), once the magic flag 
has indicated it is indeed a 32-bit file.

 Verified with `ldconfig -p' to report the correct flags.

2009-03-18  Maciej W. Rozycki  <>

	* sysdeps/unix/sysv/linux/mips/readelflib.c (process_elf_file):
	Use the Elf32_Ehdr type to check for EF_MIPS_ABI2 in the flags.

 Please apply.


Index: sysdeps/unix/sysv/linux/mips/readelflib.c
--- sysdeps/unix/sysv/linux/mips/readelflib.c	(revision 238573)
+++ sysdeps/unix/sysv/linux/mips/readelflib.c	(working copy)
@@ -39,11 +39,13 @@ process_elf_file (const char *file_name,
   if (elf_header->e_ident [EI_CLASS] == ELFCLASS32)
+      Elf32_Ehdr *elf32_header = (Elf32_Ehdr *) elf_header;
       ret = process_elf32_file (file_name, lib, flag, osversion, soname,
 				file_contents, file_length);
       /* n32 libraries are always  */
-      if (!ret && (elf_header->e_flags & EF_MIPS_ABI2) != 0)
+      if (!ret && (elf32_header->e_flags & EF_MIPS_ABI2) != 0)

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