mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Szabolcs Nagy <nsz@port70.net>
To: N Jain <jain61@gmail.com>
Cc: musl@lists.openwall.com
Subject: Re: MUSL issue while loading C++ lib
Date: Wed, 27 Jan 2016 21:08:07 +0100	[thread overview]
Message-ID: <20160127200807.GQ9621@port70.net> (raw)
In-Reply-To: <CAOkOUee5gw1uVKGT3+X+2+z+c2KZ=FJh=fcYCd3Zni7Jeer2wQ@mail.gmail.com>

* N Jain <jain61@gmail.com> [2016-01-27 14:04:59 -0500]:
> 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)*
> 

0 is ok as these are defined in libgcc_s not libstdc++

i'd try to compile and run (gcc foo.c -lgcc_s)

void _Unwind_Resume_or_Rethrow();
int main()
{
	_Unwind_Resume_or_Rethrow();
}

(it would segfault at runtime but the point is to see
if the symbol lookup succeeds, if not, you can debug
this easier than libstdc++, if yes, then compare
and see what's different)

> > > 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 ?

the code is in ldso/dynlink.c


      reply	other threads:[~2016-01-27 20:08 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-21 16:21 N Jain
2016-01-21 17:12 ` Szabolcs Nagy
2016-01-21 19:05   ` N Jain
2016-01-21 20:06     ` Szabolcs Nagy
2016-01-21 21:17       ` N Jain
2016-01-21 22:48         ` Szabolcs Nagy
2016-01-27 19:04           ` N Jain
2016-01-27 20:08             ` Szabolcs Nagy [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160127200807.GQ9621@port70.net \
    --to=nsz@port70.net \
    --cc=jain61@gmail.com \
    --cc=musl@lists.openwall.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).