From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2108 invoked by alias); 17 Jul 2003 17:02:19 -0000 Mailing-List: contact binutils-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sources.redhat.com Received: (qmail 2099 invoked from network); 17 Jul 2003 17:02:18 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sources.redhat.com with SMTP; 17 Jul 2003 17:02:18 -0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.11.6/8.11.6) with ESMTP id h6HH2IH20050 for ; Thu, 17 Jul 2003 13:02:18 -0400 Received: from pobox.corp.redhat.com (pobox.corp.redhat.com [172.16.52.156]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id h6HH2II27456; Thu, 17 Jul 2003 13:02:18 -0400 Received: from localhost.localdomain.redhat.com (vpnuser1.stuttgart.redhat.com [172.16.4.1]) by pobox.corp.redhat.com (8.11.6/8.11.6) with ESMTP id h6HH2E522800; Thu, 17 Jul 2003 13:02:16 -0400 To: Vincent Rubiolo Cc: binutils@sources.redhat.com Subject: Re: [arnm-elf-objdump] Can't use two -M flags for disassembler (-Mforce-thumb and -Mreg-names-raw) References: <3F0E3141.4060706@st.com> <3F136B7B.6090201@st.com> <3F176A30.1090603@st.com> From: Nick Clifton Date: Thu, 17 Jul 2003 17:02:00 -0000 In-Reply-To: <3F176A30.1090603@st.com> (Vincent Rubiolo's message of "Fri, 18 Jul 2003 05:32:00 +0200") Message-ID: User-Agent: Gnus/5.1001 (Gnus v5.10.1) Emacs/21.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2003-07/txt/msg00328.txt.bz2 Hi Vincent, > Investigating a little more, this seems to happen even with > ARM-only/THUMB_only code: the disassembler turns off -Mforce-thumb > option when used with -Mreg-names-raw for an ADS object file, either > ARM or THUMB code. Thanks for the files. I have now reproduced the problem - and you are right. Objdump does ignore all but the last -M switch on the command line. This is a consequence of the way the program is designed (or rather evolved). Fortunately however there is a workaround: combine the switches into a single space separated list. ie: -M"force-thumb reg-names-raw" The attached patch will make objdump generate suitable warning messages if multiple -M switches are used and it updates the documentation to describe this "feature". Cheers Nick 2003-07-17 Nick Clifton * objdump.c (main): Issue a warning message if multiple -M switches are used. * doc/binutils.texi (objdump): Update documentation about -M option. Index: binutils/objdump.c =================================================================== RCS file: /cvs/src/src/binutils/objdump.c,v retrieving revision 1.67 diff -c -3 -p -r1.67 objdump.c *** binutils/objdump.c 25 Jun 2003 06:40:25 -0000 1.67 --- binutils/objdump.c 17 Jul 2003 16:58:47 -0000 *************** main (argc, argv) *** 2660,2665 **** --- 2660,2671 ---- machine = optarg; break; case 'M': + if (disassembler_options) + { + non_fatal ("multiple separate -M options are not supported."); + non_fatal ("please combine them into a single, space separated option."); + non_fatal ("ignoring option '-M%s'", disassembler_options); + } disassembler_options = optarg; break; case 'j': Index: binutils/doc/binutils.texi =================================================================== RCS file: /cvs/src/src/binutils/doc/binutils.texi,v retrieving revision 1.42 diff -c -3 -p -r1.42 binutils.texi *** binutils/doc/binutils.texi 26 Jun 2003 08:14:10 -0000 1.42 --- binutils/doc/binutils.texi 17 Jul 2003 16:58:51 -0000 *************** architectures with the @option{-i} optio *** 1625,1631 **** @item -M @var{options} @itemx --disassembler-options=@var{options} Pass target specific information to the disassembler. Only supported on ! some targets. If the target is an ARM architecture then this switch can be used to select which register name set is used during disassembler. Specifying --- 1625,1639 ---- @item -M @var{options} @itemx --disassembler-options=@var{options} Pass target specific information to the disassembler. Only supported on ! some targets. Note only a single instance of the option on the ! command line is supported. If the option occurs more than once, the ! earlier versions will be ignored. If it is necessary to specify more ! than one disassembler option then they should be placed together into ! a space separated list. ie: ! ! @smallexample ! -M"first-disassembler-option second-disassembler-option" ! @end smallexample If the target is an ARM architecture then this switch can be used to select which register name set is used during disassembler. Specifying