From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11968 invoked by alias); 25 Nov 2003 12:34:43 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 11947 invoked from network); 25 Nov 2003 12:34:42 -0000 Received: from unknown (HELO cam-admin0.cambridge.arm.com) (193.131.176.58) by sources.redhat.com with SMTP; 25 Nov 2003 12:34:42 -0000 Received: from pc960.cambridge.arm.com (pc960.cambridge.arm.com [10.1.205.4]) by cam-admin0.cambridge.arm.com (8.12.10/8.12.10) with ESMTP id hAPCYYbo001247; Tue, 25 Nov 2003 12:34:34 GMT Received: from pc960.cambridge.arm.com (rearnsha@localhost) by pc960.cambridge.arm.com (8.11.6/8.9.3) with ESMTP id hAPCYYS11633; Tue, 25 Nov 2003 12:34:34 GMT Message-Id: <200311251234.hAPCYYS11633@pc960.cambridge.arm.com> X-Authentication-Warning: pc960.cambridge.arm.com: rearnsha owned process doing -bs To: Nick Clifton cc: Andrew Cagney , gdb-patches@sources.redhat.com, binutils@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: RFA: Skip ARM ELF Mapping symbols when showing disassembly In-reply-to: Your message of "Tue, 25 Nov 2003 12:22:11 GMT." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Tue, 25 Nov 2003 12:34:00 -0000 From: Richard Earnshaw X-SW-Source: 2003-11/txt/msg00560.txt.bz2 > Hi Andrew, > > > Hmm, what information do those mapping symbols provide? Dig dig (from > > tc-arm.c) ... > [snip] > > So GDB and objdump both need this information? > > Well yes and no... > > > How does objdump handle all this? > > Apart from a hack to objdump to skip the mapping symbols when > displaying disassembly it does not use them. > It should use them. Then it can correctly disassemble data as data rather than instructions. > Objdump (and gdb) both have perfectly adequate mechanisms for > distinguishing between code and data and between ARM and THUMB > instructions, so they do not need the mapping symbols. > No they don't. Try to disassemble a function that contains a mix of ARM and Thumb code and you will find that gdb/objdump just get it wrong. For example: .code 16 .thumb_func .align 0 .global func func: bx pc nop .code 32 bx lr which is disassembled as a.out: file format elf32-littlearm Disassembly of section .text: 00000000 : 0: 4778 bx pc 2: 46c0 nop (mov r8, r8) 4: ff1e second half of BL instruction 0xff1e 6: e12f b 268 R.