bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug binutils/14006] New: objdump fails to disassemble first instruction


From: wiml at hhhh dot org
Subject: [Bug binutils/14006] New: objdump fails to disassemble first instruction of function (arm-none-eabi, function-sections)
Date: Sat, 21 Apr 2012 06:16:39 +0000

http://sourceware.org/bugzilla/show_bug.cgi?id=14006

             Bug #: 14006
           Summary: objdump fails to disassemble first instruction of
                    function (arm-none-eabi, function-sections)
           Product: binutils
           Version: 2.22
            Status: NEW
          Severity: normal
          Priority: P2
         Component: binutils
        AssignedTo: address@hidden
        ReportedBy: address@hidden
    Classification: Unclassified


Created attachment 6357
  --> http://sourceware.org/bugzilla/attachment.cgi?id=6357
sample .o file, and C source which generated it

Sometimes "objdump -d" fails to disassemble the first instruction of a
function, printing it instead as ".word xxxx":


Disassembly of section .text.adc_lld_init:
00000000 <adc_lld_init>:
   0:    e59f1004     .word    0xe59f1004
   4:    e3a00004     mov    r0, #4
   8:    eafffffe     b    0 <AIC_ConfigureIT>
   c:    00000000     .word    0x00000000


In this case the word at offset 0 should have been disassembled as something
like "ldr r1, [pc, #4]".

As far as I can tell the bug doesn't depend on what the first instruction is;
it only affects the first instruction, not the rest of the function; and only
with code compiled with -ffunction-sections. (Possibly only if the preceding
function/section ended with a literal pool? Maybe objdump's code vs. data
tracking is one word out of sync?)

Tested with objdump from binutils-2.22 directly from gnu.org, as well as
binutils 2.21.53.0.1.20110716 compiled via MacPorts, on an x86_64 MacOSX 10.6
machine. They behave the same.

I've attached a tarfile with an .o file reproducing the problem, a minified .i
file which produced that .o file, and a transcript of compiling & objdumping &
getting the erroneous output.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]