From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/6055 Path: news.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: libc.so segfaults on mips Date: Thu, 4 Sep 2014 10:57:01 -0400 Message-ID: <20140904145701.GR12888@brightrain.aerifal.cx> References: <4971377a-43f4-4c82-bee6-635791bbe44b@email.android.com> <20140904073545.GP12888@brightrain.aerifal.cx> <7bb51525-1a3d-43e8-a567-7523ca3673c7@email.android.com> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1409842647 28900 80.91.229.3 (4 Sep 2014 14:57:27 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 4 Sep 2014 14:57:27 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-6068-gllmg-musl=m.gmane.org@lists.openwall.com Thu Sep 04 16:57:22 2014 Return-path: Envelope-to: gllmg-musl@plane.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1XPYTK-0004AC-Gs for gllmg-musl@plane.gmane.org; Thu, 04 Sep 2014 16:57:14 +0200 Original-Received: (qmail 22108 invoked by uid 550); 4 Sep 2014 14:57:14 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 22100 invoked from network); 4 Sep 2014 14:57:13 -0000 Content-Disposition: inline In-Reply-To: <7bb51525-1a3d-43e8-a567-7523ca3673c7@email.android.com> User-Agent: Mutt/1.5.21 (2010-09-15) Original-Sender: Rich Felker Xref: news.gmane.org gmane.linux.lib.musl.general:6055 Archived-At: On Thu, Sep 04, 2014 at 04:56:40PM +0800, Рысь wrote: > > > 4 сентября 2014 г. 15:35:45 KRAT, Rich Felker пишет: > >On Thu, Sep 04, 2014 at 03:07:57PM +0800, Рысь wrote: > >> Hi list! > >> > >> Not a really blocking bug but I was wondering why cross compiled > >> musl libc.so for embedded wrt system is segfaults with this: > >> > >> % ./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 > >> > >> Such a trouble I had once when system enforced mmap_min_addr, > >> however there it has default value. > >> > >> The toolchain is somewhat old: gcc 4.2.1, binutils 2.17.50.0.17 but > >> confirmed working and stable. > >> > >> Musl is 1.1.4. > >> > >> What else can cause this? > > > >Could you attach the output of readelf -a libc.so? I'm guessing the > >problem is a broken linker that's accepting the option but not > >actually honoring -Bsymbolic-functions, or another toolchain related > >issue. > > > >Rich > > Ugh, some things changed because of removal of local patches, but issue still same. Segfault line for unmodified musl: > > --- {si_signo=SIGSEGV, si_code=SI_USER, si_errno=EPERM, si_addr=0x7b2a0} (Segmentation fault) --- > > The output of readelf attached. This output looks incomplete. MIPS readelf -a output should end with a large section that starts with: Primary GOT: Canonical gp value: 000b2f90 followed by Local entries: ... Global entries: ... This is where I would be able to tell if something is wrong. Do you perhaps have an ancient version of readelf? If you're using the native one that came with your mips toolchain, try the host readelf instead from a normal system. Rich