From owner-freebsd-arm@FreeBSD.ORG Mon Apr 15 02:45:38 2013 Return-Path: Delivered-To: freebsd-arm@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 71C9EBB7; Mon, 15 Apr 2013 02:45:38 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from mail05.syd.optusnet.com.au (mail05.syd.optusnet.com.au [211.29.132.186]) by mx1.freebsd.org (Postfix) with ESMTP id 3C11ACC5; Mon, 15 Apr 2013 02:45:37 +0000 (UTC) Received: from bender (pa49-176-8-48.pa.nsw.optusnet.com.au [49.176.8.48] (may be forged)) by mail05.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id r3F2jEFd015053; Mon, 15 Apr 2013 12:45:19 +1000 Date: Mon, 15 Apr 2013 12:45:10 +1000 From: Andrew Turner To: Tim Kientzle Subject: Re: GDB on EABI Message-ID: <20130415124510.46f76bec@bender> In-Reply-To: References: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.0 cv=Ov0XUFDt c=1 sm=1 a=kj9zAlcOel0A:10 a=fNUWLwDUyLIA:10 a=6I5d2MoRAAAA:8 a=kiVn5AXGW-Hn35AQ4cIA:9 a=CjuIK1q_8ugA:10 a=SV7veod9ZcQA:10 a=yZEqWRH4PL0qC4IGBoEPsg==:117 Cc: freebsd-arm X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Porting FreeBSD to the StrongARM Processor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Apr 2013 02:45:38 -0000 On Sun, 14 Apr 2013 11:45:00 -0700 Tim Kientzle wrote: > On RPI with a recent -CURRENT (r249461) built -DWITH_ARM_EABI. > > Looks like GDB doesn't yet know about our EABI variant: > > ...../contrib/gdb/gdb/arm-tdep.c:2589: internal-error: > arm_elf_osabi_sniffer: Unknown ARM EABI version 0x5000000 This is gdb failing to correctly determine the ABI from the .note.tag section. I made a change in [1] to use this section, however it appears to not be working correctly here. The reason it complains about the EABI version is because gdb uses it if it is unable to determine the ABI by other means. As is is unneeded for FreeBSD I haven't taught gdb about the above EABI version so it complains to not know about it. > I'm also still seeing a lot of problems from the rtld locking issue: > > # top > ld-elf.so.1: assert > failed: /usr/home/tim/projects/crochet-rpi/src/libexec/rtld-elf/rtld_lock.c:233 > Abort (core dumped) I've tracked down this as an issue where llvm incorrectly aligns the stack in some cases within a leaf function that uses thread local storage. As a work around you can edit contrib/llvm/lib/Target/ARM/ARMFrameLowering.h to change the last argument to TargetFrameLowering from 4 to 8. This will ensure all stack frames are 8 byte aligned. I have a patch I am planning on submitting upstream to fix this in a better way but I am currently traveling and have not yet had a chance. Andrew [1] http://svnweb.freebsd.org/base/head/contrib/gdb/gdb/osabi.c?r1=246312&r2=246311&pathrev=246312