[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Patches] Revert more EGLIBC-local changes



After investigation I've committed this patch to revert more changes local 
to EGLIBC as no longer serving any useful purpose:

* The __USE_EXTERN_INLINES_IN_LIBC changes for -Os builds are no longer 
needed, and would not now be the right approach for fixing any -Os issues 
that appear in future.  It was reported in Nov 2011 on libc-alpha that 
such builds worked for glibc with a single fix that is now in glibc.  On 
investigation, most calls to affected functions from within glibc will 
actually use the xstat/xmknod variants because of the definitions in 
include/sys/stat.h, the internal header, whether or not the inlines are 
enabled in io/sys/stat.h, the public header.  Where calls are not to names 
that are remapped (through inlines or macros) in the internal header, and 
are not directly to the xstat/xmknod versions, it looks like there are 
always local macro definitions ensuring the xstat/xmknod functions get 
used.  Any future such -Os issues should be addressed in one of those 
three ways (direct use of xstat/xmknod; internal header changes; local 
macros), not through the public header.

* Some casts in mips/dl-machine.h actually only cast one typedef for 
uint32_t or uint64_t to another typedef for the same type; there is no 
point in such a conversion, especially since the function call will make 
it implicitly anyway.  In particular, glibc builds for MIPS do not show 
any warnings from this code lacking the casts (although despite some 
warning fixes I made, they are still pretty noisy).

* I've removed ELF_MACHINE_NO_PLT conditionals from glibc now nothing 
defines it, and the EGLIBC-local changes that used to fix audit test 
failures for MIPS are also now useless (given that MIPS hasn't defined 
that macro for four years); I've removed them.  To fix those failures 
(glibc bug 2981), they'll need newly investigating in glibc and some 
different fix produced.

Index: include/features.h
===================================================================
--- include/features.h	(revision 21758)
+++ include/features.h	(working copy)
@@ -391,15 +391,7 @@
 # define __USE_EXTERN_INLINES	1
 #endif
 
-/* There are some functions that must be declared 'extern inline' even with
-   -Os when building LIBC, or they'll end up undefined.  */
-#if __GNUC_PREREQ (2, 7) && defined __OPTIMIZE__ \
-    && (defined _LIBC || !defined __OPTIMIZE_SIZE__) && !defined __NO_INLINE__ \
-    && defined __extern_inline
-# define __USE_EXTERN_INLINES_IN_LIBC	1
-#endif
 
-
 /* This is here only because every header file already includes this one.
    Get the definitions of all the appropriate `__stub_FUNCTION' symbols.
    <gnu/stubs.h> contains `#define __stub_FUNCTION' when FUNCTION is a stub
Index: ports/sysdeps/mips/dl-machine.h
===================================================================
--- ports/sysdeps/mips/dl-machine.h	(revision 21758)
+++ ports/sysdeps/mips/dl-machine.h	(working copy)
@@ -572,8 +572,7 @@
 		 const ElfW(Sym) *sym, const struct r_found_version *version,
 		 void *const reloc_addr, int skip_ifunc)
 {
-  elf_machine_reloc (map, (ElfW(Addr)) reloc->r_info,
-		     sym, version, reloc_addr, 0, 1);
+  elf_machine_reloc (map, reloc->r_info, sym, version, reloc_addr, 0, 1);
 }
 
 auto inline void
@@ -613,8 +612,8 @@
 		  const ElfW(Sym) *sym, const struct r_found_version *version,
 		  void *const reloc_addr, int skip_ifunc)
 {
-  elf_machine_reloc (map, (ElfW(Addr)) reloc->r_info, sym, version,
-		     reloc_addr, reloc->r_addend, 0);
+  elf_machine_reloc (map, reloc->r_info, sym, version, reloc_addr,
+		     reloc->r_addend, 0);
 }
 
 auto inline void
Index: ChangeLog.eglibc
===================================================================
--- ChangeLog.eglibc	(revision 21758)
+++ ChangeLog.eglibc	(working copy)
@@ -1,3 +1,9 @@
+2012-11-17  Joseph Myers  <joseph@xxxxxxxxxxxxxxxx>
+
+	* elf/dl-reloc.c, include/features.h, io/sys/stat.h,
+	ports/sysdeps/mips/dl-machine.h: Revert unnecessary differences
+	from glibc.
+
 2012-02-20  Paul Pluzhnikov  <ppluzhnikov@xxxxxxxxxx>
 
 	* debug/tst-backtrace5.c (handle_signal): Adjust for VDSO.
Index: elf/dl-reloc.c
===================================================================
--- elf/dl-reloc.c	(revision 21758)
+++ elf/dl-reloc.c	(working copy)
@@ -271,17 +271,6 @@
 	   relocations.  If the shared object lacks a PLT (for example
 	   if it only contains lead function) the l_info[DT_PLTRELSZ]
 	   will be NULL.  */
-#ifdef ELF_MACHINE_NO_PLT
-	l->l_reloc_result = calloc (sizeof (l->l_reloc_result[0]), 1);
-	if (l->l_reloc_result == NULL)
-	  {
-	    errstring = N_("\
-%s: out of memory to store relocation results for %s\n");
-	    _dl_fatal_printf (errstring,
-			      rtld_progname ?: "<program name unknown>",
-			      l->l_name);
-	  }
-#else
 	if (l->l_info[DT_PLTRELSZ] == NULL)
 	  {
 	    errstring = N_("%s: no PLTREL found in object %s\n");
@@ -299,7 +288,6 @@
 %s: out of memory to store relocation results for %s\n");
 	    goto fatal;
 	  }
-#endif
       }
 #endif
   }
Index: io/sys/stat.h
===================================================================
--- io/sys/stat.h	(revision 21758)
+++ io/sys/stat.h	(working copy)
@@ -447,7 +447,7 @@
 		       __mode_t __mode, __dev_t *__dev)
      __THROW __nonnull ((3, 5));
 
-#if defined __GNUC__ && __GNUC__ >= 2 && defined __USE_EXTERN_INLINES_IN_LIBC
+#if defined __GNUC__ && __GNUC__ >= 2 && defined __USE_EXTERN_INLINES
 /* Inlined versions of the real stat and mknod functions.  */
 
 __extern_inline int

-- 
Joseph S. Myers
joseph@xxxxxxxxxxxxxxxx
_______________________________________________
Patches mailing list
Patches@xxxxxxxxxx
http://eglibc.org/cgi-bin/mailman/listinfo/patches