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

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

objdump segfaults on some .o files (OpenBSD sparc64)


From: Henric Jungheim
Subject: objdump segfaults on some .o files (OpenBSD sparc64)
Date: Sun, 26 Jan 2003 03:26:42 -0800
User-agent: Mutt/1.4i

I'm running OpenBSD -current on sparc64 and I've been having some problems with 
objdump
segfaulting on some files.  Mucking with "--adjust-vma" avoids the problem.  
Both 2.12 and
the objdump that comes with OpenBSD behave the same:

arch/sparc64/compile/GENERIC>objdump --disassemble busop.o

busop.o:     file format elf64-sparc

Disassembly of section .text:

0000000000000000 <bus_space_read_multi_2>:
Segmentation fault (core dumped)
arch/sparc64/compile/GENERIC>objdump --disassemble --adjust-vma=4 busop.o |& 
head

busop.o:     file format elf64-sparc

Disassembly of section .text:

0000000000000004 <bus_space_read_multi_2>:
   4:   d2 73 a8 87     stx  %o1, [ %sp + 0x887 ]
   8:   98 03 20 01     inc  %o4
   c:   c4 0a 20 14     ldub  [ %o0 + 0x14 ], %g2
  10:   87 80 a0 00     wr  %g2, 0, %asi
  ...



This change to the source stops the cores.  I don't know enough about the
binutils source to say if it is the right way to fix the problem but, "It
works for me":

--- sparc-dis.c Mon Feb 11 05:10:30 2002
+++ /usr/src/gnu/usr.bin/binutils/opcodes/sparc-dis.c   Sun Jan 26 01:52:30 2003
@@ -682,9 +682,12 @@
              unsigned long prev_insn;
              int errcode;
 
-             errcode =
-               (*info->read_memory_func)
-                 (memaddr - 4, buffer, sizeof (buffer), info);
+             if (memaddr >= 4)
+               errcode =
+                 (*info->read_memory_func)
+                   (memaddr - 4, buffer, sizeof (buffer), info);
+             else
+               errcode = 1;
              prev_insn = getword (buffer);
 
              if (errcode == 0)

-- 
address@hidden
http://home.attbi.com/~henric/




reply via email to

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