This is the mail archive of the glibc-cvs@sourceware.org mailing list for the glibc 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]

GNU C Library master sources branch hjl/pr14831 created. glibc-2.16-ports-merge-671-g6dda64c


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, hjl/pr14831 has been created
        at  6dda64cb46cc42c41b7472233c61867b8218d1f5 (commit)

- Log -----------------------------------------------------------------
http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=6dda64cb46cc42c41b7472233c61867b8218d1f5

commit 6dda64cb46cc42c41b7472233c61867b8218d1f5
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Wed Nov 14 09:45:32 2012 -0800

    Skip audit if l_reloc_result is NULL

diff --git a/ChangeLog.hjl b/ChangeLog.hjl
new file mode 100644
index 0000000..29722f2
--- /dev/null
+++ b/ChangeLog.hjl
@@ -0,0 +1,12 @@
+2012-11-13  H.J. Lu  <hongjiu.lu@intel.com>
+
+	[BZ #14831]
+	* elf/Makefile (tests): Add tst-audit8.
+	($(objpfx)tst-audit8): Also depend on $(common-objpfx)math/libm.so.
+	($(objpfx)tst-audit8.out): New target.
+	(tst-audit8-ENV): New variable.
+	* elf/dl-runtime.c (_dl_profile_fixup): Call _dl_fixup to skip
+	audit if l_reloc_result is NULL.
+	(ELF_MACHINE_RUNTIME_FIXUP_PARAMS): Issue an error if it isn't
+	defined and ELF_MACHINE_RUNTIME_FIXUP_ARGS is defined.
+	* elf/tst-audit8.c: New file.
diff --git a/elf/Makefile b/elf/Makefile
index c2f0e20..7e5c9c8 100644
--- a/elf/Makefile
+++ b/elf/Makefile
@@ -142,7 +142,7 @@ tests += loadtest restest1 preloadtest loadfail multiload origtest resolvfail \
 	 tst-dlmodcount tst-dlopenrpath tst-deep1 \
 	 tst-dlmopen1 tst-dlmopen2 tst-dlmopen3 \
 	 unload3 unload4 unload5 unload6 unload7 unload8 tst-global1 order2 \
-	 tst-audit1 tst-audit2 \
+	 tst-audit1 tst-audit2 tst-audit8 \
 	 tst-stackguard1 tst-addr1 tst-thrlock \
 	 tst-unique1 tst-unique2 tst-unique3 tst-unique4 \
 	 tst-initorder tst-initorder2 tst-relsort1
@@ -1020,6 +1020,10 @@ $(objpfx)tst-audit7: $(objpfx)tst-auditmod7a.so
 $(objpfx)tst-audit7.out: $(objpfx)tst-auditmod7b.so
 tst-audit7-ENV = LD_AUDIT=$(objpfx)tst-auditmod7b.so
 
+$(objpfx)tst-audit8: $(common-objpfx)math/libm.so
+$(objpfx)tst-audit8.out: $(objpfx)tst-auditmod1.so
+tst-audit8-ENV = LD_AUDIT=$(objpfx)tst-auditmod1.so
+
 $(objpfx)tst-global1: $(libdl)
 $(objpfx)tst-global1.out: $(objpfx)testobj6.so $(objpfx)testobj2.so
 
diff --git a/elf/dl-runtime.c b/elf/dl-runtime.c
index 2e02a21..c4c57c2 100644
--- a/elf/dl-runtime.c
+++ b/elf/dl-runtime.c
@@ -164,6 +164,25 @@ _dl_profile_fixup (
 {
   void (*mcount_fct) (ElfW(Addr), ElfW(Addr)) = INTUSE(_dl_mcount);
 
+  if (l->l_reloc_result == NULL)
+    {
+      /* Resolve an IRELATIVE relocation in another DSO may reference a
+	 function defined in libc.so before l_reloc_result is allocated.
+	 For example, __get_cpu_features in libc.so is called to resolve
+	 R_X86_64_IRELATIVE relocations in x86-64 libm.so.  Skip audit and
+	 resolve the function in this case.  It is OK since we aren't
+	 supposed to audit IRELATIVE relocations.  */
+      *framesizep = -1;
+      return _dl_fixup (
+# ifdef ELF_MACHINE_RUNTIME_FIXUP_ARGS
+#  ifndef ELF_MACHINE_RUNTIME_FIXUP_PARAMS
+#   error Please define ELF_MACHINE_RUNTIME_FIXUP_PARAMS.
+#  endif
+			ELF_MACHINE_RUNTIME_FIXUP_PARAMS,
+# endif
+			l, reloc_arg);
+    }
+
   /* This is the address in the array where we store the result of previous
      relocations.  */
   struct reloc_result *reloc_result = &l->l_reloc_result[reloc_index];
diff --git a/elf/tst-audit8.c b/elf/tst-audit8.c
new file mode 100644
index 0000000..63656b4
--- /dev/null
+++ b/elf/tst-audit8.c
@@ -0,0 +1 @@
+#include "../io/pwd.c"

-----------------------------------------------------------------------


hooks/post-receive
-- 
GNU C Library master sources


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