From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 798 invoked by alias); 2 Sep 2003 18:17:23 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 734 invoked from network); 2 Sep 2003 18:17:17 -0000 Received: from unknown (HELO cam-admin0.cambridge.arm.com) (193.131.176.54) by sources.redhat.com with SMTP; 2 Sep 2003 18:17:17 -0000 Received: from pc960.cambridge.arm.com (pc960.cambridge.arm.com [10.1.205.4]) by cam-admin0.cambridge.arm.com (8.9.3/8.9.3) with ESMTP id TAA05399; Tue, 2 Sep 2003 19:17:00 +0100 (BST) Received: from pc960.cambridge.arm.com (rearnsha@localhost) by pc960.cambridge.arm.com (8.11.6/8.9.3) with ESMTP id h82IH0b21887; Tue, 2 Sep 2003 19:17:00 +0100 Message-Id: <200309021817.h82IH0b21887@pc960.cambridge.arm.com> X-Authentication-Warning: pc960.cambridge.arm.com: rearnsha owned process doing -bs To: mckennad@esatclear.ie cc: Richard Earnshaw , gdb@sources.redhat.com, insight@sources.redhat.com, Richard.Earnshaw@arm.com Reply-To: Richard.Earnshaw@arm.com Organization: ARM Ltd. X-Telephone: +44 1223 400569 (direct+voicemail), +44 1223 400400 (switchbd) X-Fax: +44 1223 400410 X-Address: ARM Ltd., 110 Fulbourn Road, Cherry Hinton, Cambridge CB1 9NJ. X-Url: http://www.arm.com/ Subject: Re: ARM Simulator Bug? In-reply-to: Your message of "Tue, 02 Sep 2003 15:31:11 BST." <3f54a9af.472.0@esatclear.ie> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Tue, 02 Sep 2003 18:17:00 -0000 From: Richard Earnshaw X-SW-Source: 2003-09/txt/msg00018.txt.bz2 > Hi Richard, > > Thanks for the reply. > > >It's more likely to be the way you are trying to get into Thumb state. Try > > > > > adr r0, __start_of_thumb > > Should this line not be > > adr r0, __start_of_thumb+1 > > To set the LSB to tell the core we want to enter Thumb mode > Well, no. If the bottom bit isn't being set automatically when the target is a thumb symbol then that's really a bug in the tools. > > bx r0 > > .code 16 > > .global __start_of_thumb > > .thumb_func > >__start_of_thumb: > > > > > >This is really brokenness in the way gas implements ARM and Thumb code > >areas, but it's hard to fix properly until GAS starts using mapping > >symbols. > > If I use the +1 code above, and set a breakpoint at the adr command, I can single > step successfully past the BX command and into my main. It appears that GAS is broken: $ cat test.s .arm adr r0, __thumb bx r0 .thumb .globl __thumb .thumb_func __thumb: nop $ arm-elf-as test.s -o test.o $ arm-elf-objdump -dr test.o test.o: file format elf32-littlearm Disassembly of section .text: 00000000 <__thumb-0x8>: 0: e28f0000 add r0, pc, #0 ; 0x0 ####### Bzzt no! 4: e12fff10 bx r0 00000008 <__thumb>: 8: 46c0 nop (mov r8, r8) Try using an LDR r0, =__thumb expression. You'll need to squeeze the constant pool in somewhere. R.