qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] qemu-arm dynamically linked binary problem
@ 2004-12-31 18:21 Lennert Buytenhek
  2005-01-05 12:03 ` [Qemu-devel] " Lennert Buytenhek
  2005-01-05 13:35 ` [Qemu-devel] " Magnus Damm
  0 siblings, 2 replies; 8+ messages in thread
From: Lennert Buytenhek @ 2004-12-31 18:21 UTC (permalink / raw)
  To: fabrice; +Cc: qemu-devel

Hi,

I have three sets of {ld-linux,libc} for little-endian ARM: one from
qemu-gnemul-0.5.1.tar.gz from the qemu site, one hand-built with gcc
3.3.4 and glibc 2.3.3, and one hand-built with gcc 3.4.2 and glibc
2.3.3.  Yours works and mine don't.

Is there anything special about your libraries?  Which versions of
gcc/glibc did you use to build them?


thanks,
Lennert


% qemu-arm -L /usr/gnemul/qemu-arm-bellard ./hello-le
hello world


% qemu-arm -L /usr/gnemul/qemu-arm-gcc-3.3.4-glibc-2.3.3 ./hello-le
Inconsistency detected by ld.so: dymanic-link.h: 150: elf_get_dynamic_info: Assertion `info[20]->d_un.d_val == 17 || info[20]->d_un.d_val == 7' failed!


% qemu-arm -L /usr/gnemul/qemu-arm-gcc-3.4.2-glibc-2.3.3 ./hello-le
qemu: uncaught signal 11 (Segmentation fault) - exiting
	(Here it seems to be segfaulting while emulating the first ~30
	instructions of match_symbol() in ld-linux.so.2.)

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Qemu-devel] Re: qemu-arm dynamically linked binary problem
  2004-12-31 18:21 [Qemu-devel] qemu-arm dynamically linked binary problem Lennert Buytenhek
@ 2005-01-05 12:03 ` Lennert Buytenhek
  2005-01-05 13:35 ` [Qemu-devel] " Magnus Damm
  1 sibling, 0 replies; 8+ messages in thread
From: Lennert Buytenhek @ 2005-01-05 12:03 UTC (permalink / raw)
  To: qemu-devel

On Fri, Dec 31, 2004 at 07:21:26PM +0100, Lennert Buytenhek wrote:

> Hi,

Hi,


> % qemu-arm -L /usr/gnemul/qemu-arm-gcc-3.3.4-glibc-2.3.3 ./hello-le
> Inconsistency detected by ld.so: dymanic-link.h: 150: elf_get_dynamic_info: Assertion `info[20]->d_un.d_val == 17 || info[20]->d_un.d_val == 7' failed!
> 
> 
> % qemu-arm -L /usr/gnemul/qemu-arm-gcc-3.4.2-glibc-2.3.3 ./hello-le
> qemu: uncaught signal 11 (Segmentation fault) - exiting
> 	(Here it seems to be segfaulting while emulating the first ~30
> 	instructions of match_symbol() in ld-linux.so.2.)

I tried this again with the dynamic linker built by gcc 2.95.3 and
glibc 2.1.3, and that works.

I guess nobody really cares about this stuff and I should just be
implementing ARM system emulation instead, right?


--L

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Qemu-devel] qemu-arm dynamically linked binary problem
  2004-12-31 18:21 [Qemu-devel] qemu-arm dynamically linked binary problem Lennert Buytenhek
  2005-01-05 12:03 ` [Qemu-devel] " Lennert Buytenhek
@ 2005-01-05 13:35 ` Magnus Damm
  2005-01-05 13:49   ` Lennert Buytenhek
  1 sibling, 1 reply; 8+ messages in thread
From: Magnus Damm @ 2005-01-05 13:35 UTC (permalink / raw)
  To: qemu-devel

Hello,

On Fri, 31 Dec 2004 19:21:26 +0100, Lennert Buytenhek
<buytenh@wantstofly.org> wrote:
> Hi,
> 
> I have three sets of {ld-linux,libc} for little-endian ARM: one from
> qemu-gnemul-0.5.1.tar.gz from the qemu site, one hand-built with gcc
> 3.3.4 and glibc 2.3.3, and one hand-built with gcc 3.4.2 and glibc
> 2.3.3.  Yours works and mine don't.
> 
> Is there anything special about your libraries?  Which versions of
> gcc/glibc did you use to build them?

I have not much experience with ARM, but have you tried to use a
toolchain built with crosstool? Maybe there are some patches there?

I also grepped for arm in the glibc directory of my portage tree and
it looks like there are some arm-specific patches there too.

/ magnus

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Qemu-devel] qemu-arm dynamically linked binary problem
  2005-01-05 13:35 ` [Qemu-devel] " Magnus Damm
@ 2005-01-05 13:49   ` Lennert Buytenhek
  2005-01-05 15:20     ` Paul Brook
  0 siblings, 1 reply; 8+ messages in thread
From: Lennert Buytenhek @ 2005-01-05 13:49 UTC (permalink / raw)
  To: Magnus Damm, qemu-devel

On Wed, Jan 05, 2005 at 02:35:09PM +0100, Magnus Damm wrote:

> Hello,

Hello,


> > I have three sets of {ld-linux,libc} for little-endian ARM: one from
> > qemu-gnemul-0.5.1.tar.gz from the qemu site, one hand-built with gcc
> > 3.3.4 and glibc 2.3.3, and one hand-built with gcc 3.4.2 and glibc
> > 2.3.3.  Yours works and mine don't.
> > 
> > Is there anything special about your libraries?  Which versions of
> > gcc/glibc did you use to build them?
> 
> I have not much experience with ARM, but have you tried to use a
> toolchain built with crosstool? Maybe there are some patches there?

Yes, I did build these with crosstool.  I do have quite some experience
with ARM platforms, and the binaries that all these toolchains generate
do run just fine on 'real' ARM hardware.

I just think there's something in qemu's ELF setup that the glibc 2.3
dynamic linker doesn't like.


cheers,
Lennert

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Qemu-devel] qemu-arm dynamically linked binary problem
  2005-01-05 13:49   ` Lennert Buytenhek
@ 2005-01-05 15:20     ` Paul Brook
  2005-01-05 15:48       ` Lennert Buytenhek
  0 siblings, 1 reply; 8+ messages in thread
From: Paul Brook @ 2005-01-05 15:20 UTC (permalink / raw)
  To: qemu-devel

On Wednesday 05 January 2005 13:49, Lennert Buytenhek wrote:
> On Wed, Jan 05, 2005 at 02:35:09PM +0100, Magnus Damm wrote:
> > Hello,
>
> Hello,
>
> > > I have three sets of {ld-linux,libc} for little-endian ARM: one from
> > > qemu-gnemul-0.5.1.tar.gz from the qemu site, one hand-built with gcc
> > > 3.3.4 and glibc 2.3.3, and one hand-built with gcc 3.4.2 and glibc
> > > 2.3.3.  Yours works and mine don't.
> > >
> > > Is there anything special about your libraries?  Which versions of
> > > gcc/glibc did you use to build them?
> >
> > I have not much experience with ARM, but have you tried to use a
> > toolchain built with crosstool? Maybe there are some patches there?
>
> Yes, I did build these with crosstool.  I do have quite some experience
> with ARM platforms, and the binaries that all these toolchains generate
> do run just fine on 'real' ARM hardware.
>
> I just think there's something in qemu's ELF setup that the glibc 2.3
> dynamic linker doesn't like.

It working with a gcc3.4-csl/glibc2.3.3 soft-float armv4 toolchain.

> Inconsistency detected by ld.so: dymanic-link.h: 150: elf_get_dynamic_info:
> Assertion `info[20]->d_un.d_val == 17 || info[20]->d_un.d_val == 7' failed! 

I remember seeing something like this. IIRC It was caused by the (recently 
fixed) rrx bug.

Paul

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Qemu-devel] qemu-arm dynamically linked binary problem
  2005-01-05 15:20     ` Paul Brook
@ 2005-01-05 15:48       ` Lennert Buytenhek
  2005-01-05 16:40         ` Paul Brook
  0 siblings, 1 reply; 8+ messages in thread
From: Lennert Buytenhek @ 2005-01-05 15:48 UTC (permalink / raw)
  To: Paul Brook; +Cc: qemu-devel

On Wed, Jan 05, 2005 at 03:20:35PM +0000, Paul Brook wrote:

> > I just think there's something in qemu's ELF setup that the glibc 2.3
> > dynamic linker doesn't like.
> 
> It working with a gcc3.4-csl/glibc2.3.3 soft-float armv4 toolchain.

You're using dynamically linked binaries, and you have the glibc 2.3.3
dynamic linker in /usr/gnemul/qemu-arm/lib ?


> > Inconsistency detected by ld.so: dymanic-link.h: 150: elf_get_dynamic_info:
> > Assertion `info[20]->d_un.d_val == 17 || info[20]->d_un.d_val == 7' failed! 
> 
> I remember seeing something like this. IIRC It was caused by the (recently 
> fixed) rrx bug.

I'm using CVS from a few days ago, which does like look it has those
rrx fixes in.  I've also applied your selfmodify fix by hand.  I didn't
apply your 5e diff.


--L

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Qemu-devel] qemu-arm dynamically linked binary problem
  2005-01-05 15:48       ` Lennert Buytenhek
@ 2005-01-05 16:40         ` Paul Brook
  2005-01-08 14:01           ` Lennert Buytenhek
  0 siblings, 1 reply; 8+ messages in thread
From: Paul Brook @ 2005-01-05 16:40 UTC (permalink / raw)
  To: Lennert Buytenhek; +Cc: qemu-devel

On Wednesday 05 January 2005 15:48, Lennert Buytenhek wrote:
> On Wed, Jan 05, 2005 at 03:20:35PM +0000, Paul Brook wrote:
> > > I just think there's something in qemu's ELF setup that the glibc 2.3
> > > dynamic linker doesn't like.
> >
> > It working with a gcc3.4-csl/glibc2.3.3 soft-float armv4 toolchain.
>
> You're using dynamically linked binaries, and you have the glibc 2.3.3
> dynamic linker in /usr/gnemul/qemu-arm/lib ?

I've tested two types of applications:

- Cross-toolchain based on CodeSourcery gcc(3.4+bits of 4.0 backported), CVS 
glibc and binutils, plus minor config hacks to for soft-float and to use 
ld.so and shared libraries from my build sysroot.

- A Debian chroot via binfmt_misc and a static qemu-arm binary. This is a 
normal Debian Arm install with no modifications.

> > > Inconsistency detected by ld.so: dymanic-link.h: 150:
> > > elf_get_dynamic_info: Assertion `info[20]->d_un.d_val == 17 ||
> > > info[20]->d_un.d_val == 7' failed!
> >
> > I remember seeing something like this. IIRC It was caused by the
> > (recently fixed) rrx bug.
>
> I'm using CVS from a few days ago, which does like look it has those
> rrx fixes in.  I've also applied your selfmodify fix by hand.  I didn't
> apply your 5e diff.

I've just tired qemu CVS head, and that also works for me.

However I'll I did need to rebuild from a clean source tree,
 ie "make clean && make" after changing things.
There are obviously missing makefile dependencies somewhere.

Paul

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Qemu-devel] qemu-arm dynamically linked binary problem
  2005-01-05 16:40         ` Paul Brook
@ 2005-01-08 14:01           ` Lennert Buytenhek
  0 siblings, 0 replies; 8+ messages in thread
From: Lennert Buytenhek @ 2005-01-08 14:01 UTC (permalink / raw)
  To: qemu-devel

On Wed, Jan 05, 2005 at 04:40:18PM +0000, Paul Brook wrote:

> I've just tired qemu CVS head, and that also works for me.
> 
> However I'll I did need to rebuild from a clean source tree,
>  ie "make clean && make" after changing things.
> There are obviously missing makefile dependencies somewhere.

I did that as well.

It seems that it doesn't matter which gcc version I use for compiling
the app.  I can use gcc 3.4.2 compiled apps just fine, as long as I
use the glibc 2.1.3 dynamic linker.  If I copy the glibc 2.3.2 ld.so
into my chroot (over the 2.1.3 one) things just go splat.

I'll play around with some other combinations as well.


--L

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2005-01-08 14:20 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-12-31 18:21 [Qemu-devel] qemu-arm dynamically linked binary problem Lennert Buytenhek
2005-01-05 12:03 ` [Qemu-devel] " Lennert Buytenhek
2005-01-05 13:35 ` [Qemu-devel] " Magnus Damm
2005-01-05 13:49   ` Lennert Buytenhek
2005-01-05 15:20     ` Paul Brook
2005-01-05 15:48       ` Lennert Buytenhek
2005-01-05 16:40         ` Paul Brook
2005-01-08 14:01           ` Lennert Buytenhek

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).