PR binutils/1486
authorAndreas Schwab <schwab@linux-m68k.org>
Tue, 17 Jan 2006 17:39:20 +0000 (17:39 +0000)
committerAndreas Schwab <schwab@linux-m68k.org>
Tue, 17 Jan 2006 17:39:20 +0000 (17:39 +0000)
binutils/:
* configure.in: Don't define DISASSEMBLER_NEEDS_RELOCS.
* configure: Regenerate.
* objdump.c (struct objdump_disasm_info): Don't check for
DISASSEMBLER_NEEDS_RELOCS.
(objdump_print_addr): Likewise.
(disassemble_bytes): Check disassembler_needs_relocs from
disassemble_info at run-time instead of DISASSEMBLER_NEEDS_RELOCS
at compile-time.
(disassemble_section): Likewise.
(disassemble_data): Initialize it.

include/:
* dis-asm.h (struct disassemble_info): Add
disassembler_needs_relocs.

objdump/:
* disassemble.c (disassemble_init_for_target): Set
disassembler_needs_relocs for bfd_arch_arm.

binutils/ChangeLog
binutils/configure
binutils/configure.in
binutils/objdump.c
include/ChangeLog
include/dis-asm.h
opcodes/ChangeLog
opcodes/disassemble.c

index a5b7c15cb42239a92aaa094a4122a622d9c246ec..b73144f8abb56f859ad43fcd6fdcdf1ee6e93a06 100644 (file)
@@ -1,3 +1,17 @@
+2006-01-17  Andreas Schwab  <schwab@suse.de>
+
+       PR binutils/1486
+       * configure.in: Don't define DISASSEMBLER_NEEDS_RELOCS.
+       * configure: Regenerate.
+       * objdump.c (struct objdump_disasm_info): Don't check for
+       DISASSEMBLER_NEEDS_RELOCS.
+       (objdump_print_addr): Likewise.
+       (disassemble_bytes): Check disassembler_needs_relocs from
+       disassemble_info at run-time instead of DISASSEMBLER_NEEDS_RELOCS
+       at compile-time.
+       (disassemble_section): Likewise.
+       (disassemble_data): Initialize it.
+
 2006-01-11  Alan Modra  <amodra@bigpond.net.au>
 
        * objcopy.c (copy_object): Fix thinko.
index bf1ad10e09c9e4a72fdcb2ec236e14bede6cfae5..2c4d463ce84dca0eb9e8a9f1340ff4bc5e5bd780 100755 (executable)
@@ -10474,9 +10474,6 @@ do
          DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM"
          BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
          ;;
-       arm*-* | xscale-* | strongarm-* | d10v-*)
-         OBJDUMP_DEFS="-DDISASSEMBLER_NEEDS_RELOCS"
-         ;;
        i[3-7]86-*-pe* | i[3-7]86-*-cygwin* | i[3-7]86-*-mingw32** | i[3-7]86-*-netbsdpe*)
          BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
          DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_I386"
index 60db5ba98fee0b2aad6ee0efc3cd3e0ccf468a59..990b0605c9bade72c2cf288bed1efe3bf5b3368d 100644 (file)
@@ -250,9 +250,6 @@ changequote([,])dnl
          DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM"
          BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
          ;;
-       arm*-* | xscale-* | strongarm-* | d10v-*)
-         OBJDUMP_DEFS="-DDISASSEMBLER_NEEDS_RELOCS"
-         ;;
 changequote(,)dnl
        i[3-7]86-*-pe* | i[3-7]86-*-cygwin* | i[3-7]86-*-mingw32** | i[3-7]86-*-netbsdpe*)
 changequote([,])dnl
index f2b5eea01286bb8ee104f551f6bd8578c8dec617..fc9600c26ea9b393ddfab94c0ac6f0569390fca0 100644 (file)
@@ -1,6 +1,6 @@
 /* objdump.c -- dump information about an object file.
    Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-   2000, 2001, 2002, 2003, 2004, 2005
+   2000, 2001, 2002, 2003, 2004, 2005, 2006
    Free Software Foundation, Inc.
 
    This file is part of GNU Binutils.
@@ -130,9 +130,7 @@ struct objdump_disasm_info
   arelent **         dynrelbuf;
   long               dynrelcount;
   disassembler_ftype disassemble_fn;
-#ifdef DISASSEMBLER_NEEDS_RELOCS
   arelent *          reloc;
-#endif
 };
 
 /* Architecture to disassemble for, or default if NULL.  */
@@ -866,9 +864,7 @@ objdump_print_addr (bfd_vma vma,
 {
   struct objdump_disasm_info *aux;
   asymbol *sym = NULL; /* Initialize to avoid compiler warning.  */
-#ifdef DISASSEMBLER_NEEDS_RELOCS
   bfd_boolean skip_find = FALSE;
-#endif
 
   if (sorted_symcount < 1)
     {
@@ -879,7 +875,6 @@ objdump_print_addr (bfd_vma vma,
 
   aux = (struct objdump_disasm_info *) info->application_data;
 
-#ifdef DISASSEMBLER_NEEDS_RELOCS
   if (aux->reloc != NULL
       && aux->reloc->sym_ptr_ptr != NULL
       && * aux->reloc->sym_ptr_ptr != NULL)
@@ -894,7 +889,6 @@ objdump_print_addr (bfd_vma vma,
     }
 
   if (!skip_find)
-#endif
     sym = find_symbol_for_address (vma, info, NULL);
 
   objdump_print_addr_with_sym (aux->abfd, aux->sec, sym, vma, info,
@@ -1319,12 +1313,10 @@ disassemble_bytes (struct disassemble_info * info,
     {
       bfd_vma z;
       bfd_boolean need_nl = FALSE;
-#ifdef DISASSEMBLER_NEEDS_RELOCS
       int previous_octets;
 
       /* Remember the length of the previous instruction.  */
       previous_octets = octets;
-#endif
       octets = 0;
 
       /* If we see more than SKIP_ZEROES octets of zeroes, we just
@@ -1389,8 +1381,8 @@ disassemble_bytes (struct disassemble_info * info,
              info->bytes_per_chunk = 0;
              info->flags = 0;
 
-#ifdef DISASSEMBLER_NEEDS_RELOCS
-             if (*relppp < relppend)
+             if (info->disassembler_needs_relocs
+                 && *relppp < relppend)
                {
                  bfd_signed_vma distance_to_rel;
 
@@ -1420,7 +1412,7 @@ disassemble_bytes (struct disassemble_info * info,
                  else
                    aux->reloc = NULL;
                }
-#endif
+
              octets = (*disassemble_fn) (section->vma + addr_offset, info);
              info->fprintf_func = (fprintf_ftype) fprintf;
              info->stream = stdout;
@@ -1672,10 +1664,7 @@ disassemble_section (bfd *abfd, asection *section, void *info)
       rel_offset = 0;
 
       if ((section->flags & SEC_RELOC) != 0
-#ifndef DISASSEMBLER_NEEDS_RELOCS
-         && dump_reloc_info
-#endif
-         )
+         && (dump_reloc_info || pinfo->disassembler_needs_relocs))
        {
          long relsize;
 
@@ -1882,9 +1871,7 @@ disassemble_data (bfd *abfd)
   aux.require_sec = FALSE;
   aux.dynrelbuf = NULL;
   aux.dynrelcount = 0;
-#ifdef DISASSEMBLER_NEEDS_RELOCS
   aux.reloc = NULL;
-#endif
 
   disasm_info.print_address_func = objdump_print_address;
   disasm_info.symbol_at_address_func = objdump_symbol_at_address;
@@ -1926,6 +1913,7 @@ disassemble_data (bfd *abfd)
   disasm_info.octets_per_byte = bfd_octets_per_byte (abfd);
   disasm_info.skip_zeroes = DEFAULT_SKIP_ZEROES;
   disasm_info.skip_zeroes_at_end = DEFAULT_SKIP_ZEROES_AT_END;
+  disasm_info.disassembler_needs_relocs = FALSE;
 
   if (bfd_big_endian (abfd))
     disasm_info.display_endian = disasm_info.endian = BFD_ENDIAN_BIG;
index fe5e1c16df822251a81b8d0f9ee1eb924877ae49..66589fc949b9874091ef59ad18843ec213962cc4 100644 (file)
@@ -1,3 +1,9 @@
+2006-01-17  Andreas Schwab  <schwab@suse.de>
+
+       PR binutils/1486
+       * dis-asm.h (struct disassemble_info): Add
+       disassembler_needs_relocs.
+
 2006-01-09  Bob Wilson  <bob.wilson@acm.org>
 
        * xtensa-config.h (XCHAL_HAVE_MUL32_HIGH): Define.
index ddb3426a590f1e472518bd6919e9f3a4be1e0e5f..61b34c3615139eef18f3c93c9edae7394759bd56 100644 (file)
@@ -172,6 +172,9 @@ typedef struct disassemble_info {
      alignment.  */
   unsigned int skip_zeroes_at_end;
 
+  /* Whether the disassembler always needs the relocations.  */
+  bfd_boolean disassembler_needs_relocs;
+
   /* Results from instruction decoders.  Not all decoders yet support
      this information.  This info is set each time an instruction is
      decoded, and is only valid for the last such instruction.
index 9083afa8b9016981ec0e5e8d1a56f28934925b0c..fe28508a15ef93bcbf9f3c3db6a2ac3f2d89f19b 100644 (file)
@@ -1,3 +1,9 @@
+2006-01-17  Andreas Schwab  <schwab@suse.de>
+
+       PR binutils/1486
+       * disassemble.c (disassemble_init_for_target): Set
+       disassembler_needs_relocs for bfd_arch_arm.
+
 2006-01-16  Paul Brook  <paul@codesourcery.com>
 
        * m68k-opc.c (m68k_opcodes): Fix opcodes for ColdFire f?abss,
index db5b90b56c26482cf58efdada2de3eba4b1bffdf..5cef902866626e991af1c499ed0f3aa6e1b5757f 100644 (file)
@@ -442,6 +442,7 @@ disassemble_init_for_target (struct disassemble_info * info)
 #ifdef ARCH_arm
     case bfd_arch_arm:
       info->symbol_is_valid = arm_symbol_is_valid;
+      info->disassembler_needs_relocs = TRUE;
       break;
 #endif
 #ifdef ARCH_ia64