From: "Ulrich Weigand" <uweigand@de.ibm.com>
To: brobecker@adacore.com (Joel Brobecker)
Cc: teawater@gmail.com (Hui Zhu),
gdb-patches@sourceware.org (gdb-patches ml),
msnyder@vmware.com (Michael Snyder)
Subject: Re: [RFA] Check solib bfd arch
Date: Fri, 18 Sep 2009 12:50:00 -0000 [thread overview]
Message-ID: <200909181250.n8ICoMmD010948@d12av02.megacenter.de.ibm.com> (raw)
In-Reply-To: <20090917225633.GA29769@adacore.com> from "Joel Brobecker" at Sep 17, 2009 03:56:33 PM
Joel Brobecker wrote:
> I now see:
>
> (gdb) run
> Starting program: /[...]/sparc64/ex/task_switch
> warning: `/usr/platform/SUNW,Sun-Fire-V440/lib/sparcv9/libc_psr.so.1': Shared library architecture sparc:v9a is not compatible with target architecture sparc:v9.
>
> > + if (b->compatible (b, bfd_get_arch_info (abfd)) != b)
>
> In my case, b->compatible is bfd_default_compatible. the architecture
> is set to sparc:v9, and the shared library's architecture is sparc:v9a.
> The problem is that b->compatible is returning the architecture that
> is "more featureful" of the two, which in this case is sparc:v9a.
> As a result, we emit the warning.
>
> Looks to me like the check is too aggressive and should be changed
> to == 0. Would that be correct?
Well, the check is modeled after the one in osabi.c:can_run_code_for
which carries the comment:
/* BFD's 'A->compatible (A, B)' functions return zero if A and B are
incompatible. But if they are compatible, it returns the 'more
featureful' of the two arches. That is, if A can run code
written for B, but B can't run code written for A, then it'll
return A.
In your particular case, the result of compatible appears to indicate
that the target architecture sparc:v9 *cannot* run code written for
the architecture sparc:v9a; if this were true (I'm not sure about
such sparc architecture details), then it would be correct to reject
those shared libraries ...
In any case, I do not think the checks in osabi.c (for the main
executable) and in solib.c (for shared libraries) should be different.
Hui Zhu wrote:
> Could you please try it with "bfd_arch_rs6000 and bfd_arch_powerpc"?
> Or Ulrich, maybe you can help us with it. :)
Unfortunately, I don't have access to an old-style RS/6000 machine
myself ...
Bye,
Ulrich
--
Dr. Ulrich Weigand
GNU Toolchain for Linux on System z and Cell BE
Ulrich.Weigand@de.ibm.com
next prev parent reply other threads:[~2009-09-18 12:50 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-03 9:52 Hui Zhu
2009-07-05 21:36 ` Ulrich Weigand
2009-07-06 3:03 ` Hui Zhu
2009-07-07 16:45 ` Ulrich Weigand
2009-07-08 2:46 ` Hui Zhu
2009-07-09 13:43 ` Ulrich Weigand
2009-07-09 16:50 ` Hui Zhu
2009-09-17 22:56 ` Joel Brobecker
2009-09-18 5:05 ` Hui Zhu
2009-09-18 12:50 ` Ulrich Weigand [this message]
2009-09-18 13:06 ` Ulrich Weigand
2009-09-18 13:10 ` Daniel Jacobowitz
2009-09-18 14:24 ` Joel Brobecker
2009-09-18 14:08 ` Mark Kettenis
2009-09-18 14:11 ` Mark Kettenis
2009-09-18 14:39 ` Daniel Jacobowitz
2009-09-18 14:53 ` Pedro Alves
2009-09-18 16:14 ` Ulrich Weigand
2009-09-18 16:25 ` Daniel Jacobowitz
2009-09-18 16:41 ` Pedro Alves
2009-09-18 16:44 ` Daniel Jacobowitz
2009-09-18 16:45 ` Pedro Alves
2009-09-18 17:17 ` Joel Brobecker
2009-09-18 20:43 ` Joel Brobecker
2009-09-22 23:04 ` Joel Brobecker
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=200909181250.n8ICoMmD010948@d12av02.megacenter.de.ibm.com \
--to=uweigand@de.ibm.com \
--cc=brobecker@adacore.com \
--cc=gdb-patches@sourceware.org \
--cc=msnyder@vmware.com \
--cc=teawater@gmail.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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox