bug-gnu-utils
[Top][All Lists]
Advanced

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

objdump of an a.out generates SEGV on large addresses


From: Stephen Bevan
Subject: objdump of an a.out generates SEGV on large addresses
Date: Thu, 4 Jan 2001 13:29:46 -0800 (PST)

I'm using the binutils 2.9.1 suite cross compiled
for sparc-linux-aout under Linux/ix86.  If I create
an a.out file with a start address of 0xFD000000
(SPARC PROM VM start) then objdump dumps core when
trying to --disassemble it unless the --adjust-vma
argment is also used.

Since I'm posting this via yahoo and it folds lines
in the most inappropriate places I've attached a
log which shows system I'm running, what
versions of the utilities I'm using, an example
program which exhibits the problem, sample runs
showing the SEGV, a GDB session showing where the
problem occurs and another run showing that
--adjust-vma works around the problem.


__________________________________________________
Do You Yahoo!?
Yahoo! Photos - Share your holiday photos online!
http://photos.yahoo.com/
amidala$ uname -a
Linux amidala 2.2.14-5.0 #1 Tue Mar 7 21:07:39 EST 2000 i686 unknown
amidala$ gcc -v
Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/egcs-2.91.66/specs
gcc version egcs-2.91.66 19990314/Linux (egcs-1.1.2 release)
amidala$ /home/stephen/cross/sparc-linux-aout/bin/sparc-linux-aout-objdump 
--version
GNU objdump 2.9.1
Copyright 1997 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License.  This program has absolutely no warranty.
amidala$ /home/stephen/cross/sparc-linux-aout/bin/sparc-linux-aout-ld --version
GNU ld 2.9.1
Copyright 1997 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License.  This program has absolutely no warranty.
  Supported emulations:
   sparcaout
amidala$ /home/stephen/cross/sparc-linux-aout/bin/sparc-linux-aout-as --version
GNU assembler 2.9.1
Copyright 1997 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License.  This program has absolutely no warranty.
This assembler was configured for a target of `sparc-linux-aout'.
amidala$ cat prom.s
! The smallest file I could write that can create the objdump problem.

_start: ta 0
amidala$ /home/stephen/cross/sparc-linux-aout/bin/sparc-linux-aout-as -o prom.o 
prom.s
amidala$ /home/stephen/cross/sparc-linux-aout/bin/sparc-linux-aout-ld -Ttext 
0xfd000000 -N  -o prom prom.o
amidala$ /home/stephen/cross/sparc-linux-aout/bin/sparc-linux-aout-objdump 
--disassemble prom

prom:     file format a.out-sunos-big

Disassembly of section .text:

00000000 <_start-0xfd000000>:

fd000000 <_start>:
Segmentation fault (core dumped)

(gdb) run --disassemble prom
Starting program: 
/home/stephen/cross/sparc-linux-aout/bin/sparc-linux-aout-objdump --disassemble 
prom

prom:     file format a.out-sunos-big

Disassembly of section .text:

00000000 <_start-0xfd000000>:

fd000000 <_start>:

Program received signal SIGSEGV, Segmentation fault.
0x804a543 in disassemble_bytes (info=0xbffff8c8, 
    disassemble_fn=0x8061200 <print_insn_sparc>, insns=true, 
    data=0x809bca0 "\221Ð ", start=-50331648, stop=-50331640, 
    relppp=0xbffff8b4, relppend=0x0) at ../../src/binutils/objdump.c:1210
1210            if (data[z] != 0)
(gdb) info locals
z = -50331648
bytes = 1073746899
need_nl = false
aux = (struct objdump_disasm_info *) 0xbffff8bc
section = (asection *) 0x809ac54
bytes_per_line = 4
skip_addr_chars = 4
i = -50331648
(gdb) p/x z
$1 = 0xfd000000
(gdb) quit
The program is running.  Exit anyway? (y or n) y
amidala$ /home/stephen/cross/sparc-linux-aout/bin/sparc-linux-aout-objdump 
--adjust-vma=0xfd000000 --disassemble prom

prom:     file format a.out-sunos-big

Disassembly of section .text:

fd000000 <_start>:
fd000000:       91 d0 20 00     ta  0
fd000004:       00 00 00 00     unimp  0

reply via email to

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