From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/9217 Path: news.gmane.org!not-for-mail From: N Jain Newsgroups: gmane.linux.lib.musl.general Subject: Re: MUSL issue while loading C++ lib Date: Wed, 27 Jan 2016 14:04:59 -0500 Message-ID: References: <20160121171245.GC9621@port70.net> <20160121200626.GD9621@port70.net> <20160121224818.GE9621@port70.net> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=047d7b2e4d347e4751052a557ac3 X-Trace: ger.gmane.org 1453921517 25146 80.91.229.3 (27 Jan 2016 19:05:17 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 27 Jan 2016 19:05:17 +0000 (UTC) To: musl@lists.openwall.com, Szabolcs Nagy Original-X-From: musl-return-9230-gllmg-musl=m.gmane.org@lists.openwall.com Wed Jan 27 20:05:16 2016 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1aOVP1-0001mX-FS for gllmg-musl@m.gmane.org; Wed, 27 Jan 2016 20:05:15 +0100 Original-Received: (qmail 7940 invoked by uid 550); 27 Jan 2016 19:05:12 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Original-Received: (qmail 7921 invoked from network); 27 Jan 2016 19:05:11 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=a15zuY0Mz/E5P2aknzEHlBHjHNk/XUHkJiMSEj8NXO0=; b=UaoUz1sOZvDXJZX37tUzLCcG1ctQQDufm6wYtsZr8RD0ip6X+6YQnqCeOWqKQF5L2B uRoEfQQxeDLxpQTl4othHtW32p72u/bB+yUUaJobN4gh+pXlL3Vh4ZeI+vQWcUAuWUzL /xNuShCV7LUYf3N8IAa9yUMwLZTyF+Q98Wemgq4qEzWqV+nK4aimQvHTp9ruKvZVypTk ytcxZrMgrVP1RHutgbjmG1KRIGtvz0GtYgjzgDXkHYML3qxzgj0jFBPBI2Z+ZqLWvbEj Sm3ZXTM24eMnsB4WtrQP2nv1HuUZemlHtAE1jNxwac+KmmWYVxrU0Wnbz+l2BnCwKhz3 QT7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type; bh=a15zuY0Mz/E5P2aknzEHlBHjHNk/XUHkJiMSEj8NXO0=; b=DTeUPDoSPrcYRDtmdRCPAOZziziExCMnslDqW33O5EzG65gDTP11NAmT07USCcnsfz YFbMusvZEP6f9I+MJCjZeXmY/XIjotESE1q350ibAJiIAkNjffVVLWdF9mTbEPsjbnUd KiEnIM+WmOaQ1wk0G/HWElBGUCA76aNmuufiE9fU6Fv926UC0OJaxFKVp42WviD9PqKw 0SXT1Qv17v+WB71a59OpAi6PIJ2GR1ttAENDGIObF3BgI4PD4aPzMDqsIfLq9LF9RDvH cwaLANq7mtzwwdefmkZhwTJD03w8VEOVUgdAfDzfNFiPkhl5idPGHA7wG0fk8HMpgfc2 41rw== X-Gm-Message-State: AG10YOQ22WZObWjWIXwo+OtzJg8rhI+RXHt90c2efgjsnfZqbD+0fVMM08048zxbLy2Ltpfxrt4uRu/WlcJ4LA== X-Received: by 10.182.79.103 with SMTP id i7mr23265329obx.41.1453921499226; Wed, 27 Jan 2016 11:04:59 -0800 (PST) In-Reply-To: <20160121224818.GE9621@port70.net> Xref: news.gmane.org gmane.linux.lib.musl.general:9217 Archived-At: --047d7b2e4d347e4751052a557ac3 Content-Type: text/plain; charset=UTF-8 Hi All, I was debugging and trying to find the issue in MUSL during finding "_Unwind_Resume_or_Rethrow" symbol. I see that under find_sym function sysv_lookup(s,h,dso) function it is not able to get above names which seems to be right as the offset in reloc section of "libstdc++.so.6" is zero Example table below - Offset Info Type Sym.Value Sym. Name 0013700c 00000516 R_ARM_JUMP_SLOT 000c8bc8 _ZNSt13basic_filebufIcSt11char_traitsIcEE19_M_terminate_outputEv (*Able to lookup*) *00137330 00051c16 R_ARM_JUMP_SLOT 00000000 _Unwind_Resume_or_Rethrow (Failed)* *00137510 00083616 R_ARM_JUMP_SLOT 00000000 _Unwind_GetLanguageSpe (Failed)* > > and i think the linked binary is fine > > > libstdc++.so.6 vs libgcc_s.so.1 has some issues > > which makes the musl linker fail to find some symbols. > >From above dump I can see if Sym.Value = 0x0 then the symbol lookup fails. Can some one know how to solve above issue ? Also I am not able to find the code if libstdc++.so.6 needs dynamic section libgcc_s.so.1 then by the time MUSL loads libstdc++.so.6 above symbols should not have Sym.Value = 0x0 ? > > > i can't help further, you will have to debug it, > > i'd try to look at dso->strings with gdb and why the find_sym fails > > or recompile musl with some dprintf added, > > or try a known working toolchain and compare against it, > > or wait for other ideas.. > Any one know code where if library itself is dependent on other library where is symbol relocation happening ? I guess the issue is in that part of MUSL code ? Is there any MUSL patch to resolve above issue ? Thanks, NJ --047d7b2e4d347e4751052a557ac3 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi All,

I was debugging and trying to f= ind the issue in MUSL during finding =C2=A0"_Unwind_Resume_or_Rethrow&= quot; symbol.
I see that under find_sym function sysv_lookup(s,h,= dso) function it is not able to get above names which seems to be right as = the offset in reloc section of "libstdc++.so.6" is zero

Example table below -

Offset = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Info =C2=A0 =C2=A0 =C2=A0 =C2=A0Type =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 Sym.Value =C2=A0 Sym. Name
0013700c =C2=A000000516 = R_ARM_JUMP_SLOT =C2=A0 000c8bc8 =C2=A0 _ZNSt13basic_filebufIcSt11char_trait= sIcEE19_M_terminate_outputEv =C2=A0(Able to lookup)
001= 37330 =C2=A000051c16 R_ARM_JUMP_SLOT =C2=A0 00000000 =C2=A0 _Unwind_Resume_= or_Rethrow =C2=A0 =C2=A0 =C2=A0 (Failed)
00137510 =C2=A000= 083616 R_ARM_JUMP_SLOT =C2=A0 00000000 =C2=A0 _Unwind_GetLanguageSpe =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (Failed)


> and i = think the linked binary is fine

> libstdc++.so.6 vs libgcc_s.so.1 has some issues
> which make= s the musl linker fail to find some symbols.

From above dump I can see if Sym.Value =3D 0x0 then the symbol lookup= fails.
Can some one know how to solve above issue ?=C2=A0
<= div>Also I am not able to find the code if=C2=A0libstdc++.so.6 =C2=A0needs = dynamic section libgcc_s.so.1=C2=A0
then by the time MUSL loads l= ibstdc++.so.6 above symbols should not have Sym.Value =3D 0x0 ?
<= br>
=C2=A0

> i can't help further, you will have to debug it,
> i'= ;d try to look at dso->strings with gdb and why the find_sym fails
&g= t; or recompile musl with some dprintf added,
> or try a known workin= g toolchain and compare against it,
> or wait for other ideas..

Any one know code where if library itself is= dependent on other library where is symbol relocation happening ?
I guess the issue is in that part of MUSL code ? Is there any MUSL patch = to resolve above issue ?

Thanks,
NJ=C2= =A0

--047d7b2e4d347e4751052a557ac3--