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

Bug#805730: marked as done (glibc: __gmon_start__ symbol proliferation on hppa)

Your message dated Sun, 22 Nov 2015 19:34:46 +0000
with message-id <E1a0aPO-0007C1-QZ@franck.debian.org>
and subject line Bug#805730: fixed in glibc 2.21-0experimental3
has caused the Debian Bug report #805730,
regarding glibc: __gmon_start__ symbol proliferation on hppa
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@bugs.debian.org

805730: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=805730
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
Source: glibc
Version: 2.19-22
Severity: normal
Tags: patch

Dear Maintainer,

The symbol __gmon_start__ is defined on the hppa in crtn.S.  As a result,
there is a weak definition in every executable.  This was originally done
to address problems in the handling of weak undefined symbols.  However,
the definition breaks the build of harfbuzz and vlc.  It breaks the
--as-needed processing of binutils/ld and this results in unnecessary
libraries being needed by executables.

The patch removes this definition and improves the handling of weak
undefined symbols in glibc.  The effect of removing __gmon_start is
handled by the dynamic linker, so it not necessary to immediately recompile

The problem is reported upstream here:

Submitted patch is here:

The attached change was installed in the +b4 build of 2.19-22 and no
regressions have been observed.

Would you please add the change to the debian/hppa patch set for glibc.

Dave Anglin

-- System Information:
Debian Release: stretch/sid
  APT prefers unreleased
  APT policy: (500, 'unreleased'), (500, 'unstable')
Architecture: hppa (parisc64)

Kernel: Linux 3.18.24+ (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8) (ignored: LC_ALL set to en_CA.utf8)
Shell: /bin/sh linked to /bin/dash
Init: sysvinit (via /sbin/init)
Index: glibc-2.19/ports/sysdeps/hppa/crti.S
--- glibc-2.19.orig/ports/sysdeps/hppa/crti.S
+++ glibc-2.19/ports/sysdeps/hppa/crti.S
@@ -49,6 +49,95 @@
+	weak_extern (PREINIT_FUNCTION)
+/* If we have working .init_array support, we want to keep the .init
+   section empty (apart from the mandatory prologue/epilogue.  This
+   ensures that the default unwind conventions (return-pointer in b0,
+   frame state in ar.pfs, etc.)  will do the Right Thing.  To ensure
+   an empty .init section, we register gmon_initializer() via the
+   .init_array.
+    --davidm 02/10/29 */
+/* This blob of assembly code is one simple C function:
+static void
+__attribute__ ((used))
+gmon_initializer (void)
+  extern void weak_function __gmon_start__ (void);
+  if (__gmon_start__)
+    (*__gmon_start__)();
+In a final executable, PLABEL32 relocations for function pointers are
+resolved at link time.  Typically, binutils/ld resolves __gmon_start__
+using an external shared library.  __gmon_start__ is always called if
+it is found at link time.  If __gmon_start__ is not found at runtime
+due to a library update, then the function pointer will point at a null
+function descriptor and calling it will cause a segmentation fault.
+So, we call __canonicalize_funcptr_for_compare to obtain the canonicalized
+address of __gmon_start__ and skip calling __gmon_start__ if it is zero.
+ */
+	.type __canonicalize_funcptr_for_compare,@function
+	.type $$dyncall,@function
+	.section .data.rel.ro,"aw",@progbits
+	.align 4
+	.type __gmon_start__,@function
+	.word P%__gmon_start__
+	.text
+	.align 4
+	.type gmon_initializer,@function
+	stw %r2,-20(%r30)
+	stwm %r4,64(%r30)
+	stw %r3,-60(%r30)
+	addil LT'.LC0,%r19
+	ldw RT'.LC0(%r1),%r28
+	ldw 0(%r28),%r3
+	comib,= 0,%r3,1f
+	copy %r19,%r4
+	stw %r19,-32(%r30)
+	bl __canonicalize_funcptr_for_compare,%r2
+	copy %r3,%r26
+	comib,= 0,%r28,1f
+	copy %r4,%r19
+	copy %r3,%r22
+	bl $$dyncall,%r31
+	copy %r31,%r2
+	ldw -84(%r30),%r2
+	ldw -60(%r30),%r3
+	bv %r0(%r2)
+	ldwm -64(%r30),%r4
+	.size gmon_initializer, .-gmon_initializer
+# define PREINIT_FUNCTION gmon_initializer
+	.section .init_array, "aw"
 /* _init prologue.  */
 	.section .init, "ax", %progbits
 	.align 4
@@ -58,14 +147,6 @@ _init:
 	stw	%rp,-20(%sp)
 	stwm	%r4,64(%sp)
 	stw	%r19,-32(%sp)
-	copy	%r19,%r4	/* delay slot */
-	copy	%r19,%r4	/* delay slot */
-	copy	%r4,%r19
 /* _fini prologue.  */
         .section .fini,"ax",%progbits
Index: glibc-2.19/ports/sysdeps/hppa/crtn.S
--- glibc-2.19.orig/ports/sysdeps/hppa/crtn.S
+++ glibc-2.19/ports/sysdeps/hppa/crtn.S
@@ -38,27 +38,6 @@
 /* crtn.S puts function epilogues in the .init and .fini sections
    corresponding to the prologues in crti.S. */
-/* Note that we cannot have a weak undefined __gmon_start__, because
-   that would require this to be PIC, and the linker is currently not
-   able to generate a proper procedure descriptor for _init.  Sad but
-   true.  Anyway, HPPA is one of those horrible architectures where
-   making the comparison and indirect call is quite expensive (see the
-   comment in sysdeps/generic/initfini.c). */
-        .text
-        .align 4
-        .weak   __gmon_start__
-        .type    __gmon_start__,@function
-	.proc
-	.callinfo
-	.entry
-        bv,n %r0(%r2)
-	.exit
-	.procend
-/* Here is the tail end of _init.  We put __gmon_start before this so
-   that the assembler creates the .PARISC.unwind section for us, ie.
-   with the right attributes.  */
 	.section .init, "ax", @progbits
 	ldw	-84(%sp),%rp
 	copy	%r4,%r19
Index: glibc-2.19/ports/sysdeps/hppa/dl-lookupcfg.h
--- glibc-2.19.orig/ports/sysdeps/hppa/dl-lookupcfg.h
+++ glibc-2.19/ports/sysdeps/hppa/dl-lookupcfg.h
@@ -74,7 +74,9 @@ void _dl_unmap (struct link_map *map);
 /* Construct a fixup value from the address and linkmap */
 #define DL_FIXUP_MAKE_VALUE(map, addr) \
-   ((struct fdesc) { (addr), (map)->l_info[DT_PLTGOT]->d_un.d_ptr })
+  (map) ? ((struct fdesc) { (addr), (map)->l_info[DT_PLTGOT]->d_un.d_ptr }) \
+	: ((struct fdesc) { 0, 0 })
 /* Extract the code address from a fixup value */
 #define DL_FIXUP_VALUE_CODE_ADDR(value) ((value).ip)
Index: glibc-2.19/ports/sysdeps/hppa/dl-trampoline.S
--- glibc-2.19.orig/ports/sysdeps/hppa/dl-trampoline.S
+++ glibc-2.19/ports/sysdeps/hppa/dl-trampoline.S
@@ -82,6 +82,11 @@ _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 */
+	comib,=	0,%r28,1f
 	/* Load up the returned func descriptor */
 	copy	%r28, %r22
 	copy	%r29, %r19
@@ -107,6 +112,13 @@ _dl_runtime_resolve:
 	/* Jump to new function, but return to previous function */
 	bv	%r0(%r22)
 	ldw	-20(%sp),%rp
+	/* Return to previous function */
+	ldw	-148(%sp),%rp
+	bv	%r0(%rp)
+	ldo	-128(%sp),%sp

--- End Message ---
--- Begin Message ---
Source: glibc
Source-Version: 2.21-0experimental3

We believe that the bug you reported is fixed in the latest version of
glibc, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 805730@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
Aurelien Jarno <aurel32@debian.org> (supplier of updated glibc package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@ftp-master.debian.org)

Hash: SHA1

Format: 1.8
Date: Sun, 22 Nov 2015 19:37:39 +0100
Source: glibc
Binary: libc-bin libc-dev-bin libc-l10n glibc-doc glibc-source locales locales-all nscd multiarch-support libc6 libc6-dev libc6-dbg libc6-pic libc6-udeb libc6.1 libc6.1-dev libc6.1-dbg libc6.1-pic libc6.1-udeb libc0.3 libc0.3-dev libc0.3-dbg libc0.3-pic libc0.3-udeb libc0.1 libc0.1-dev libc0.1-dbg libc0.1-pic libc0.1-udeb libc6-i386 libc6-dev-i386 libc6-sparc libc6-dev-sparc libc6-sparc64 libc6-dev-sparc64 libc6-s390 libc6-dev-s390 libc6-amd64 libc6-dev-amd64 libc6-powerpc libc6-dev-powerpc libc6-ppc64 libc6-dev-ppc64 libc6-mips32 libc6-dev-mips32 libc6-mipsn32 libc6-dev-mipsn32 libc6-mips64 libc6-dev-mips64 libc0.1-i386 libc0.1-dev-i386 libc6-x32 libc6-dev-x32 libc6-i686 libc6-xen libc0.1-i686 libc0.3-i686 libc0.3-xen libc6.1-alphaev67 libnss-dns-udeb libnss-files-udeb
Architecture: source
Version: 2.21-0experimental3
Distribution: experimental
Urgency: medium
Maintainer: GNU Libc Maintainers <debian-glibc@lists.debian.org>
Changed-By: Aurelien Jarno <aurel32@debian.org>
 glibc-doc  - GNU C Library: Documentation
 glibc-source - GNU C Library: sources
 libc-bin   - GNU C Library: Binaries
 libc-dev-bin - GNU C Library: Development binaries
 libc-l10n  - GNU C Library: localization files
 libc0.1    - GNU C Library: Shared libraries
 libc0.1-dbg - GNU C Library: detached debugging symbols
 libc0.1-dev - GNU C Library: Development Libraries and Header Files
 libc0.1-dev-i386 - GNU C Library: 32bit development libraries for AMD64
 libc0.1-i386 - GNU C Library: 32bit shared libraries for AMD64
 libc0.1-i686 - GNU C Library: Shared libraries [i686 optimized]
 libc0.1-pic - GNU C Library: PIC archive library
 libc0.1-udeb - GNU C Library: Shared libraries - udeb (udeb)
 libc0.3    - GNU C Library: Shared libraries
 libc0.3-dbg - GNU C Library: detached debugging symbols
 libc0.3-dev - GNU C Library: Development Libraries and Header Files
 libc0.3-i686 - GNU C Library: Shared libraries [i686 optimized]
 libc0.3-pic - GNU C Library: PIC archive library
 libc0.3-udeb - GNU C Library: Shared libraries - udeb (udeb)
 libc0.3-xen - GNU C Library: Shared libraries [Xen version]
 libc6      - GNU C Library: Shared libraries
 libc6-amd64 - GNU C Library: 64bit Shared libraries for AMD64
 libc6-dbg  - GNU C Library: detached debugging symbols
 libc6-dev  - GNU C Library: Development Libraries and Header Files
 libc6-dev-amd64 - GNU C Library: 64bit Development Libraries for AMD64
 libc6-dev-i386 - GNU C Library: 32-bit development libraries for AMD64
 libc6-dev-mips32 - GNU C Library: o32 Development Libraries for MIPS
 libc6-dev-mips64 - GNU C Library: 64bit Development Libraries for MIPS64
 libc6-dev-mipsn32 - GNU C Library: n32 Development Libraries for MIPS64
 libc6-dev-powerpc - GNU C Library: 32bit powerpc development libraries for ppc64
 libc6-dev-ppc64 - GNU C Library: 64bit Development Libraries for PowerPC64
 libc6-dev-s390 - GNU C Library: 32bit Development Libraries for IBM zSeries
 libc6-dev-sparc - GNU C Library: 32bit Development Libraries for SPARC
 libc6-dev-sparc64 - GNU C Library: 64bit Development Libraries for UltraSPARC
 libc6-dev-x32 - GNU C Library: X32 ABI Development Libraries for AMD64
 libc6-i386 - GNU C Library: 32-bit shared libraries for AMD64
 libc6-i686 - GNU C Library: Shared libraries [i686 optimized]
 libc6-mips32 - GNU C Library: o32 Shared libraries for MIPS
 libc6-mips64 - GNU C Library: 64bit Shared libraries for MIPS64
 libc6-mipsn32 - GNU C Library: n32 Shared libraries for MIPS64
 libc6-pic  - GNU C Library: PIC archive library
 libc6-powerpc - GNU C Library: 32bit powerpc shared libraries for ppc64
 libc6-ppc64 - GNU C Library: 64bit Shared libraries for PowerPC64
 libc6-s390 - GNU C Library: 32bit Shared libraries for IBM zSeries
 libc6-sparc - GNU C Library: 32bit Shared libraries for SPARC
 libc6-sparc64 - GNU C Library: 64bit Shared libraries for UltraSPARC
 libc6-udeb - GNU C Library: Shared libraries - udeb (udeb)
 libc6-x32  - GNU C Library: X32 ABI Shared libraries for AMD64
 libc6-xen  - GNU C Library: Shared libraries [Xen version]
 libc6.1    - GNU C Library: Shared libraries
 libc6.1-alphaev67 - GNU C Library: Shared libraries (EV67 optimized)
 libc6.1-dbg - GNU C Library: detached debugging symbols
 libc6.1-dev - GNU C Library: Development Libraries and Header Files
 libc6.1-pic - GNU C Library: PIC archive library
 libc6.1-udeb - GNU C Library: Shared libraries - udeb (udeb)
 libnss-dns-udeb - GNU C Library: NSS helper for DNS - udeb (udeb)
 libnss-files-udeb - GNU C Library: NSS helper for files - udeb (udeb)
 locales    - GNU C Library: National Language (locale) data [support]
 locales-all - GNU C Library: Precompiled locale data
 multiarch-support - Transitional package to ensure multiarch compatibility
 nscd       - GNU C Library: Name Service Cache Daemon
Closes: 712074 722885 753909 793641 799478 805730
 glibc (2.21-0experimental3) experimental; urgency=medium
   [ Aurelien Jarno ]
   * patches/hppa/cvs-allocatestack-stacktop.diff: new patch from upstream
     to fix a set-but-unused warning in nptl/allocatestack.c, causing a
     build failure.
   * patches/hppa/local-stack-grows-up.diff: rebase.
   * patches/any/cvs-tls-dtv.diff: new patch from upstream to fix fix DTV race,
     assert, and DTV_SURPLUS Static TLS limit.  This also reduces the failure
     rate of nptl/tst-stack4.  Closes: #793641.
   * Add expected testsuite result for mips64el:
     - testsuite-checking/expected-results-mips64el-linux-gnu-libc
     - testsuite-checking/expected-results-mips64el-linux-gnuabin32-mipsn32
     - testsuite-checking/expected-results-mipsel-linux-gnu-mips32
   * patches/kfreebsd/local-sysdeps.diff, patches/kfreebsd/local-fbtl.diff:
     update to revision 5844 (from glibc-bsd):
     - Update to glibc 2.21.
     - Define F_DUP2FD_CLOEXEC.  Closes: #712074.
     - Wire-up accept4.  Closes: #722885.
   * sysdeps/kfreebsd-{amd64,i386}.mk: configure with --disable-werror.
   * patches/kfreebsd/local-nscd-no-sockcloexec.diff: Drop.
   * patches/kfreebsd/local-getaddrinfo-freebsd-kernel.diff: improve and remove
     a warning.
   * patches/kfreebsd/local-tst-auxv.diff: new patch to disable AT_EXECFN
     testing in tst-auxv when it is not defined.
   * patches/any/cvs-rfc3542-advanced-api.diff: new patch from usptream to
     add missing Advanced API (RFC3542) (1) defines.  Closes: #753909.
   * debian/rules: don't put debug files from libc0.1-i386 and libc6-mips32
     into libc0.1-dbg or libc6-dbg.
   * patches/hppa/cvs-atomic.diff, patches/hppa/cvs-inline-syscall.diff: new
     patches from upstream to improve atomic and inline syscalls on HPPA
     (closes: #799478).
   * rules.d/build.mk: don't run the testsuite with make -k, as a build
     failure in the testsuite, otherwise build failures cause the regression
     comparison to be entirely skipped.
   * testsuite-checking/expected-results-*kfreebsd-gnu-*: update testsuite
   * patches/any/cvs-check-localplt.diff: new patch from upstream to fix
     check-localplt test with recent binutils version on x86.
   * patches/hppa/submitted-gmon-start.diff: new patch from upstream to
     fix __gmon_start__ symbol proliferation on hppa.  Closes: #805730.
   * Update from upstream stable branch:
     - patches/any/cvs-make-typo.diff: Merged.
     - Fix FTBFS with libselinux 2.4.
   [ Samuel Thibault ]
   * patches/hurd-i386/tg-pagesize.diff: Refresh.
   * patches/hurd-i386/submitted-handle-eprototype.diff: Refresh.
   * patches/hurd-i386/tg-posix_thread.diff: Update, to define
 0776d55cdf6697af1d026667ab5f1fd3f9f35779 8250 glibc_2.21-0experimental3.dsc
 d77f23e894be85f2e1731d4114bf6993dbbea815 1008348 glibc_2.21-0experimental3.debian.tar.xz
 c40d9393b8e59f1e8810e3c15913d9d3fedfa77ce03a2274e8a4cfcc094e56e7 8250 glibc_2.21-0experimental3.dsc
 b36b5791f3b4dd37d8933f35c7522fa27d50a585726f3a3a4baf19ad07269408 1008348 glibc_2.21-0experimental3.debian.tar.xz
 c040f519e85115b32436c516ee3d4b24 8250 libs required glibc_2.21-0experimental3.dsc
 dae5ef0bd39560199bb5d508c4d19cb0 1008348 libs required glibc_2.21-0experimental3.debian.tar.xz

Version: GnuPG v1


--- End Message ---

Reply to: