about summary refs log tree commit diff
path: root/sysdeps/hppa/dl-trampoline.S
diff options
context:
space:
mode:
authorJohn David Anglin <danglin@gcc.gnu.org>2017-07-23 12:50:44 -0400
committerJohn David Anglin <danglin@gcc.gnu.org>2017-07-23 12:50:44 -0400
commit64a1daed189ab6fff11b33dd8d493962460f0f6c (patch)
treeca2b47d4d4a8fbd703cbe61060ee1441cebb6c7a /sysdeps/hppa/dl-trampoline.S
parent1740441b49cd4fee21b0368108ab53fb788bba7b (diff)
downloadglibc-64a1daed189ab6fff11b33dd8d493962460f0f6c.tar.gz
glibc-64a1daed189ab6fff11b33dd8d493962460f0f6c.tar.xz
glibc-64a1daed189ab6fff11b33dd8d493962460f0f6c.zip
[BZ 19170]
Revise comment in sysdeps/hppa/dl-trampoline.S
Diffstat (limited to 'sysdeps/hppa/dl-trampoline.S')
-rw-r--r--sysdeps/hppa/dl-trampoline.S16
1 files changed, 13 insertions, 3 deletions
diff --git a/sysdeps/hppa/dl-trampoline.S b/sysdeps/hppa/dl-trampoline.S
index f1294a931f..3165c6f0e2 100644
--- a/sysdeps/hppa/dl-trampoline.S
+++ b/sysdeps/hppa/dl-trampoline.S
@@ -82,9 +82,19 @@ _dl_runtime_resolve:
 	bl	_dl_fixup,%rp
 	copy	%r21,%r19		/* set fixup func ltp */
 
-	/* Sometimes a final executable may attempt to call an undefined
-	   weak function (e.g., __gmon_start__).  Return if the function
-	   was not resolved by _dl_fixup */
+	/* While the linker will set a function pointer to NULL when it
+	   encounters an undefined weak function, we need to dynamically
+	   detect removed weak functions.  The issue arises because a weak
+	   __gmon_start__ function was added to shared executables to work
+	   around issues in _init that are now resolved.  The presence of
+	   __gmon_start__ in every shared library breaks the linker
+	   `--as-needed' option.  This __gmon_start__ function does nothing
+	   but removal is tricky.  Depending on the binding, removal can
+	   cause an application using it to fault.  The call to _dl_fixup
+	   returns NULL when a function isn't resolved.  In order to help
+	   with __gmon_start__ removal, we return directly to the caller
+	   when _dl_fixup returns NULL.  This check could be removed when
+	   BZ 19170 is fixed.  */
 	comib,=	0,%r28,1f
 
 	/* Load up the returned func descriptor */