[PATCH 1/2] MIPS: Fix n32 `ldconfig' annotation

Maciej W. Rozycki macro@codesourcery.com
Wed Mar 18 14:12:00 GMT 2009


Hello,

 This fix (from http://sourceware.org/bugzilla/show_bug.cgi?id=7074) is 
still waiting to be applied.  It is required for correct operation of 
`ldconfig' where n32 MIPS shared objects have to be marked as such in 
"ld.so.cache" once they have been successfully validated with 
process_elf32_file() (i.e. the function has returned zero).  Otherwise the 
objects are treated as o32 binaries and are skipped when n32 dynamic 
loading is being performed.

 As it is, the flag is set for objects which have failed validation -- 
which are subsequently discarded as the return value is checked by the 
caller of process_elf_file().  The end result is ld.so fails dynamic 
linking in the presence of "ld.so.cache".

 Verified with `ldconfig -p' to report the correct flags.  I have 
rephrased the changelog entry to follow the GNU standard in a bit better 
way.

ChangeLog.mips:
2009-03-18  Zhang Le  <r0bertz@gentoo.org>

	* sysdeps/unix/sysv/linux/mips/readelflib.c (process_elf_file):
	Fix the condition used to annotate n32 objects.

 I believe it qualifies as a trivial change not requiring a copyright 
assignment/disclaimer.  Please apply.

  Maciej

glibc-ports-2.8-mips-n32-0.patch
Index: sysdeps/unix/sysv/linux/mips/readelflib.c
===================================================================
--- sysdeps/unix/sysv/linux/mips/readelflib.c	(revision 238138)
+++ sysdeps/unix/sysv/linux/mips/readelflib.c	(working copy)
@@ -43,7 +43,7 @@ process_elf_file (const char *file_name,
 				file_contents, file_length);
 
       /* n32 libraries are always libc.so.6+.  */
-      if (ret && (elf_header->e_flags & EF_MIPS_ABI2) != 0)
+      if (!ret && (elf_header->e_flags & EF_MIPS_ABI2) != 0)
 	*flag = FLAG_MIPS64_LIBN32|FLAG_ELF_LIBC6;
     }
   else



More information about the Libc-ports mailing list