public inbox for libc-ports@sourceware.org
 help / color / mirror / Atom feed
From: "Ellcey, Steve" <sellcey@mips.com>
To: "Maciej W. Rozycki" <macro@codesourcery.com>,
	       "libc-alpha@sourceware.org"	<libc-alpha@sourceware.org>,
	       "libc-ports@sourceware.org"	<libc-ports@sourceware.org>
Cc: Chung-Lin Tang <cltang@codesourcery.com>
Subject: RE: [PATCH 2/2] MIPS16: MIPS16 support proper
Date: Thu, 24 Jan 2013 18:08:00 -0000	[thread overview]
Message-ID: <B3A978AD3152E64BBBA356E6778FB9978A405B@exchdb03.mips.com> (raw)
In-Reply-To: <alpine.DEB.1.10.1301230317220.4834@tp.orcam.me.uk>

Maciej,

I was able to apply your patches and build a MIPS16 glibc (multiple ones actually for mips32,
mips32r2, big & little endian, soft & hard float), so that was great.  I am having trouble running executables
that I link with those libraries though.  I am using qemu for my testing and the same qemu that runs
mips32r2 binaries just fine won't run something compiled with -mips32r2 -mips16 and linked with the mips16
glibc that I built.

After some poking around I think the problem is not the glibc that I built but with crti.o and crtn.o.  If I use
regular mips32 versions of these crt files and mips16 built versions of everything else (main program, glibc,
libgcc, etc.) then I can run a simple hello world program, if I use the mips16 versions of crti and crtn I get:


mips-mti-linux-gnu-gcc -mips32r2 -mips16 '-Wl,--dynamic-linker=/local/home/sellcey/gcc/mips16/sysroot-mips-mti-linux-gnu/mips16/usr/lib/ld-2.17.90.so' '-Wl,-rpath=/local/home/sellcey/gcc/mips16/sysroot-mips-mti-linux-gnu/mips16/usr/lib:/local/home/sellcey/gcc/mips16/install-mips-mti-linux-gnu/mips-mti-linux-gnu/lib/mips16' hi.c -o x

mips-mti-linux-gnu-qemu -r 2.6.38 ./x
hi
qemu: uncaught target signal 11 (Segmentation fault) - core dumped

Note that it did print 'hi' before getting the signal.

If I try adding '-static' then I get:

mips-mti-linux-gnu-gcc -static -mips32r2 -mips16 hi.c -o x
mips-mti-linux-gnu-qemu -r 2.6.38 ./x
qemu: uncaught target signal 4 (Illegal instruction) - core dumped



I was wondering if you have any idea what could be causing this.  Should the standard qemu be able
to run mips16 executables with no changes?

Steve Ellcey
sellcey@mips.com

  parent reply	other threads:[~2013-01-24 18:08 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-23  4:41 [PATCH 0/2] MIPS16: MIPS16 support Maciej W. Rozycki
2013-01-23  4:41 ` [PATCH 1/2] MIPS16: Allocate GLIBC_2.18 Maciej W. Rozycki
2013-01-23  4:42 ` [PATCH 2/2] MIPS16: MIPS16 support proper Maciej W. Rozycki
2013-01-23 17:22   ` Joseph S. Myers
2013-01-24 10:10     ` Chung-Lin Tang
2013-01-24 13:13       ` Maciej W. Rozycki
2013-01-24 13:56         ` Richard Sandiford
2013-02-20 16:19     ` [PATCH v2] MIPS: MIPS16 support Maciej W. Rozycki
2013-02-20 16:29       ` Joseph S. Myers
2013-02-27  1:38         ` [PATCH v3] " Maciej W. Rozycki
2013-02-27 17:50           ` Joseph S. Myers
2013-02-27 23:54             ` Maciej W. Rozycki
2013-01-24 18:08   ` Ellcey, Steve [this message]
2013-01-25  5:14     ` [PATCH 2/2] MIPS16: MIPS16 support proper Maciej W. Rozycki
2013-01-25 13:59       ` Richard Sandiford
2013-01-28 22:18         ` Steve Ellcey
2013-01-25 22:10       ` Steve Ellcey
2013-01-26  0:32         ` Maciej W. Rozycki
2013-01-28 17:36           ` Steve Ellcey
2013-01-28 17:56             ` Steve Ellcey
2013-01-28 21:08               ` Maciej W. Rozycki
2013-01-28 18:58             ` Richard Henderson
2013-01-28 21:06               ` Maciej W. Rozycki
2013-01-28 21:17                 ` Steve Ellcey
2013-01-29 16:24                   ` Richard Henderson
2013-01-29 19:27                     ` Joseph S. Myers

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=B3A978AD3152E64BBBA356E6778FB9978A405B@exchdb03.mips.com \
    --to=sellcey@mips.com \
    --cc=cltang@codesourcery.com \
    --cc=libc-alpha@sourceware.org \
    --cc=libc-ports@sourceware.org \
    --cc=macro@codesourcery.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).