From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:56259) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ue3Bp-0002Cn-8f for qemu-devel@nongnu.org; Sun, 19 May 2013 08:58:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ue3Bk-00088s-1t for qemu-devel@nongnu.org; Sun, 19 May 2013 08:58:17 -0400 Received: from hall.aurel32.net ([2001:470:1f15:c4f::1]:33600) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ue3Bj-00084k-NN for qemu-devel@nongnu.org; Sun, 19 May 2013 08:58:11 -0400 Date: Sun, 19 May 2013 14:58:07 +0200 From: Aurelien Jarno Message-ID: <20130519125807.GB5144@ohm.aurel32.net> References: <20120110173816.GB6244@volta.aurel32.net> <515FBBC9.1020800@msgid.tls.msk.ru> <5189FC50.4020503@msgid.tls.msk.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: Subject: Re: [Qemu-devel] sparc-linux-user: Fix missing symbols in .rel/.rela.plt sections List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Blue Swirl Cc: Michael Tokarev , qemu-devel@nongnu.org On Thu, May 09, 2013 at 05:56:03PM +0000, Blue Swirl wrote: > On Wed, May 8, 2013 at 7:18 AM, Michael Tokarev wrote: > > Ping #2? > > > > 06.04.2013 10:08, Michael Tokarev wrote: > >> This patch was submitted more than a year ago (at Jan-2012). > >> Is it still needed? If yes, why it hasn't been applied? > > Well, is it still needed? Without it, trying to build static qemu-user on sparc leads to the following error: | LINK mips-linux-user/qemu-mips | /usr/lib/gcc/sparc-linux-gnu/4.6/../../../sparc-linux-gnu/libglib-2.0.a(gutils.o): In function `g_get_any_init_do': | (.text+0x440): warning: Using 'getpwuid' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking | /usr/lib/gcc/sparc-linux-gnu/4.6/../../../sparc-linux-gnu/libglib-2.0.a(gutils.o): In function `g_get_any_init_do': | (.text+0x430): warning: Using 'setpwent' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking | /usr/lib/gcc/sparc-linux-gnu/4.6/../../../sparc-linux-gnu/libglib-2.0.a(gutils.o): In function `g_get_any_init_do': | (.text+0x448): warning: Using 'endpwent' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking | /usr/lib/gcc/sparc-linux-gnu/4.6/../../../sparc-linux-gnu/libglib-2.0.a(gutils.o): In function `g_get_any_init_do': | (.text+0x188): warning: Using 'getpwnam_r' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking | /usr/lib/gcc/sparc-linux-gnu/4.6/../../../sparc-linux-gnu/libglib-2.0.a(gutils.o): In function `g_get_any_init_do': | (.text+0x1c8): warning: Using 'getpwuid_r' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking | /usr/lib/gcc/sparc-linux-gnu/4.6/../../../sparc-linux-gnu/libc.a(elf-init.o): In function `__libc_csu_irel': | (.text+0x144): undefined reference to `__rela_iplt_start' | /usr/lib/gcc/sparc-linux-gnu/4.6/../../../sparc-linux-gnu/libc.a(elf-init.o): In function `__libc_csu_irel': | (.text+0x148): undefined reference to `__rela_iplt_end' | /usr/lib/gcc/sparc-linux-gnu/4.6/../../../sparc-linux-gnu/libc.a(elf-init.o): In function `__libc_csu_irel': | (.text+0x14c): undefined reference to `__rela_iplt_start' | /usr/lib/gcc/sparc-linux-gnu/4.6/../../../sparc-linux-gnu/libc.a(elf-init.o): In function `__libc_csu_irel': | (.text+0x150): undefined reference to `__rela_iplt_end' | collect2: ld returned 1 exit status | make[1]: *** [qemu-mips] Error 1 | make: *** [subdir-mips-linux-user] Error 2 So I think it is still needed, unless you have another fix in mind. > >> > >> It still applies cleanly to the current git, with the exception > >> of s|^|ldscripts/| - sparc.ld moved from the top directory to > >> ldscripts/. > >> > >> (Ref: http://patchwork.ozlabs.org/patch/135267 ) > >> > >> Thanks, > >> > >> /mjt > >> > >> > >> 10.01.2012 11:38, Aurelien Jarno wrote: > >>> sparc-linux-user: Fix missing symbols in .rel/.rela.plt sections > >>> > >>> Fix .rel.plt sections in the output to not only include .rel.plt > >>> sections from the input but also the .rel.iplt sections and to define > >>> the hidden symbols __rel_iplt_start and __rel_iplt_end around > >>> .rel.iplt as otherwise we get undefined references to these when > >>> linking statically to a multiarch enabled libc (using STT_GNU_IFUNC). > >>> > >>> Cc: Blue Swirl > >>> Signed-off-by: Aurelien Jarno > >>> > >>> --- > >>> sparc.ld | 16 ++++++++++++++-- > >>> 1 files changed, 14 insertions(+), 2 deletions(-) > >>> > >>> diff --git a/sparc.ld b/sparc.ld > >>> index 56efe34..cec17c9 100644 > >>> --- a/sparc.ld > >>> +++ b/sparc.ld > >>> @@ -37,8 +37,20 @@ SECTIONS > >>> .rela.fini : { *(.rela.fini) } > >>> .rel.bss : { *(.rel.bss) } > >>> .rela.bss : { *(.rela.bss) } > >>> - .rel.plt : { *(.rel.plt) } > >>> - .rela.plt : { *(.rela.plt) } > >>> + .rel.plt : > >>> + { > >>> + *(.rel.plt) > >>> + PROVIDE (__rel_iplt_start = .); > >>> + *(.rel.iplt) > >>> + PROVIDE (__rel_iplt_end = .); > >>> + } > >>> + .rela.plt : > >>> + { > >>> + *(.rela.plt) > >>> + PROVIDE (__rela_iplt_start = .); > >>> + *(.rela.iplt) > >>> + PROVIDE (__rela_iplt_end = .); > >>> + } > >>> .init : { *(.init) } =0x47ff041f > >>> .text : > >>> { > >>> > >> > >> > > > > -- Aurelien Jarno GPG: 1024D/F1BCDB73 aurelien@aurel32.net http://www.aurel32.net