Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <b3c56cad-d94e-4cd9-8f82-0f770b7e53d2@email.android.com>
Date: Thu, 04 Sep 2014 22:03:58 +0800
From: Рысь <lynx@...server.ru>
To: musl@...ts.openwall.com
Subject: Re: libc.so segfaults on mips



4 сентября 2014 г. 20:32:09 KRAT, Szabolcs Nagy <nsz@...t70.net> пишет:
>* ???????? <lynx@...server.ru> [2014-09-04 16:56:40 +0800]:
>> 4 ???????????????? 2014 ??. 15:35:45 KRAT, Rich Felker
><dalias@...c.org> ??????????:
>> >On Thu, Sep 04, 2014 at 03:07:57PM +0800, ???????? wrote:
>> >> Not a really blocking bug but I was wondering why cross compiled
>> >> musl libc.so for embedded wrt system is segfaults with this:
>
>OpenWRT does not use standard mips ABI but its own thing:
>you need mips-sf (softfloat) toolchain
>
>> >> % ./strace ./libc.so 
>> >> execve("./libc.so", ["./libc.so"], [/* 10 vars */]) = 0
>> >> --- {si_signo=SIGSEGV, si_code=SI_USER, si_errno=EPERM,
>si_addr=0x4}
>> >(Segmentation fault) ---
>> >> +++ killed by SIGSEGV +++
>> >> Segmentation fault
>> >> 
>> >> A strange segfault with EPERM.
>> >> 
>> >> The target is mips2 bigendian router, specifically it is ar9331
>SoC.
>> >> This is how file reports on libc.so: ELF 32-bit MSB shared object,
>> >> MIPS, MIPS-I version 1 (SYSV), dynamically linked, not stripped
>
>> >Could you attach the output of readelf -a libc.so? I'm guessing the
>> The output of readelf attached.
>
>i don't see the softfloat symbols of libgcc there
>(eg __addsf3)
>
>(musl malloc uses float arithmetics so ./libc.so will fail
>immediately)
>
>(openwrt kernel can be built with fpu emulation which is
>the default on normal mips kernels)

Strange, I have already fpu emulator enabled (Algorithmics/MIPS FPU emulator 1.5 that comes with oprnwrt kernel). Btw without it even static userspace faults.
Landley toolchain "broken" here too, but I don't know is it softfloat or not.
Static userspace now works flawlessly, so I will investigate my toolchain.

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.