https://sourceware.org/bugzilla/show_bug.cgi?id=33553

            Bug ID: 33553
           Summary: objdump -d sometimes fails to disassemble
           Product: binutils
           Version: 2.46 (HEAD)
            Status: NEW
          Severity: normal
          Priority: P2
         Component: binutils
          Assignee: unassigned at sourceware dot org
          Reporter: ro at gcc dot gnu.org
                CC: hjl.tools at gmail dot com
  Target Milestone: ---
            Target: i?86-*-solaris2*

When looking at GCC PR target/122331, I noticed that objdump -dw sometimes
fails to disassemble when Solaris dis has no such issue:

Consider the testcase from gcc/configure.ac (HAVE_AS_IX86_GOT32X):

        .data
bar:
        .byte 1
        .text
        .global _start
_start:
         cmpl $0, bar@GOT
         jmp *_start@GOT

Assembling and linking that as in that test

gas --32 conftest.s
gld -melf_i386_sol2 -o conftest conftest.o
objdump -dw conftest.o

produces


conftest:     file format elf32-i386-sol2


Disassembly of section .text:

08048074 <_START_>:
 8048074:       83 3d 90 90 04 08 00 e9 f4 ff ff ff 90             
.=...........

while Solaris dis has no such issue:

disassembly for conftest


section .text
    _START_:                83 3d 90 90 04 08  cmpl   $0x0,0x8049090
                            00 
    0x804807b:              e9 f4 ff ff ff     jmp    -0xc      <_START_>
    0x8048080:              90                 nop    

In other cases (conftest created with /bin/ld), objdump has no such problems:

08050478 <_start>:
 8050478:       83 3d 0c 00 00 00 00    cmpl   $0x0,0xc
 805047f:       ff 25 10 00 00 00       jmp    *0x10

Same for conftest created on Linux/i686:

08049000 <_start>:
 8049000:       83 3d f0 af 04 08 00    cmpl   $0x0,0x804aff0
 8049007:       e9 f4 ff ff ff          jmp    8049000 <_start>
 804900c:       90                      nop

I'm attaching the Solaris gas/gld conftest for inspection.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Reply via email to