This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 2/2] MIPS16: MIPS16 support proper


"Maciej W. Rozycki" <macro@codesourcery.com> writes:
>> 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?
>
>  I am fairly sure QEMU has issues with MIPS16 code, and I wouldn't be 
> surprised if user-mode emulation actually required porting QEMU, rather 
> than merely fixing bugs, to support MIPS16 binaries -- it may not be 
> prepared to handle the ISA bit at all.

Never tried user-mode emulation either, but FWIW...

>  Have you tried running your code on actual hardware?  This is how we did 
> testing of all these changes.

...QEMU 1.2 system emulation seems to handle MIPS16 pretty well,
so that might be another alternative.  See:

    http://gcc.gnu.org/ml/gcc-testresults/2013-01/msg02626.html
    http://gcc.gnu.org/ml/gcc-testresults/2013-01/msg02550.html

for some recent results.

Richard


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]