This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Update objdump.c to Iso C


Hi Guys,

  I am applying this patch to update objdump to use Iso C.  There are
  no new failures introduced into any of my test toolchains by this
  patch.

Cheers
        Nick

2003-07-29  Nick Clifton  <nickc@redhat.com>

	* objdump.c: Update to Iso C.

Index: binutils/objdump.c
===================================================================
RCS file: /cvs/src/src/binutils/objdump.c,v
retrieving revision 1.71
diff -c -3 -p -r1.71 objdump.c
*** binutils/objdump.c	24 Jul 2003 14:06:07 -0000	1.71
--- binutils/objdump.c	29 Jul 2003 15:07:28 -0000
***************
*** 39,45 ****
  #ifdef NEED_DECLARATION_FPRINTF
  /* This is needed by INIT_DISASSEMBLE_INFO.  */
  extern int fprintf
!   PARAMS ((FILE *, const char *, ...));
  #endif
  
  /* Exit status.  */
--- 39,45 ----
  #ifdef NEED_DECLARATION_FPRINTF
  /* This is needed by INIT_DISASSEMBLE_INFO.  */
  extern int fprintf
!   (FILE *, const char *, ...);
  #endif
  
  /* Exit status.  */
*************** static bfd_size_type stabstr_size;
*** 122,199 ****
  /* Static declarations.  */
  
  static void usage
!   PARAMS ((FILE *, int));
  static void nonfatal
!   PARAMS ((const char *));
  static void display_file
!   PARAMS ((char *, char *));
  static void dump_section_header
!   PARAMS ((bfd *, asection *, PTR));
  static void dump_headers
!   PARAMS ((bfd *));
  static void dump_data
!   PARAMS ((bfd *));
  static void dump_relocs
!   PARAMS ((bfd *));
  static void dump_dynamic_relocs
!   PARAMS ((bfd *));
  static void dump_reloc_set
!   PARAMS ((bfd *, asection *, arelent **, long));
  static void dump_symbols
!   PARAMS ((bfd *, bfd_boolean));
  static void dump_bfd_header
!   PARAMS ((bfd *));
  static void dump_bfd_private_header
!   PARAMS ((bfd *));
  static void dump_bfd
!   PARAMS ((bfd *));
  static void display_bfd
!   PARAMS ((bfd *));
  static void objdump_print_value
!   PARAMS ((bfd_vma, struct disassemble_info *, bfd_boolean));
  static void objdump_print_symname
!   PARAMS ((bfd *, struct disassemble_info *, asymbol *));
  static asymbol *find_symbol_for_address
!   PARAMS ((bfd *, asection *, bfd_vma, bfd_boolean, long *));
  static void objdump_print_addr_with_sym
!   PARAMS ((bfd *, asection *, asymbol *, bfd_vma,
! 	   struct disassemble_info *, bfd_boolean));
  static void objdump_print_addr
!   PARAMS ((bfd_vma, struct disassemble_info *, bfd_boolean));
  static void objdump_print_address
!   PARAMS ((bfd_vma, struct disassemble_info *));
  static int objdump_symbol_at_address
!   PARAMS ((bfd_vma, struct disassemble_info *));
  static void show_line
!   PARAMS ((bfd *, asection *, bfd_vma));
  static void disassemble_bytes
!   PARAMS ((struct disassemble_info *, disassembler_ftype, bfd_boolean,
! 	   bfd_byte *, bfd_vma, bfd_vma, arelent ***, arelent **));
  static void disassemble_data
!   PARAMS ((bfd *));
  static asymbol ** slurp_symtab
!   PARAMS ((bfd *));
  static asymbol ** slurp_dynamic_symtab
!   PARAMS ((bfd *));
  static long remove_useless_symbols
!   PARAMS ((asymbol **, long));
  static int compare_symbols
!   PARAMS ((const PTR, const PTR));
  static int compare_relocs
!   PARAMS ((const PTR, const PTR));
  static void dump_stabs
!   PARAMS ((bfd *));
  static bfd_boolean read_section_stabs
!   PARAMS ((bfd *, const char *, const char *));
  static void print_section_stabs
!   PARAMS ((bfd *, const char *, const char *));
  static void dump_section_stabs
!   PARAMS ((bfd *, char *, char *));
  
  static void
! usage (stream, status)
!      FILE *stream;
!      int status;
  {
    fprintf (stream, _("Usage: %s <option(s)> <file(s)>\n"), program_name);
    fprintf (stream, _(" Display information from object <file(s)>.\n"));
--- 122,197 ----
  /* Static declarations.  */
  
  static void usage
!   (FILE *, int);
  static void nonfatal
!   (const char *);
  static void display_file
!   (char *, char *);
  static void dump_section_header
!   (bfd *, asection *, void *);
  static void dump_headers
!   (bfd *);
  static void dump_data
!   (bfd *);
  static void dump_relocs
!   (bfd *);
  static void dump_dynamic_relocs
!   (bfd *);
  static void dump_reloc_set
!   (bfd *, asection *, arelent **, long);
  static void dump_symbols
!   (bfd *, bfd_boolean);
  static void dump_bfd_header
!   (bfd *);
  static void dump_bfd_private_header
!   (bfd *);
  static void dump_bfd
!   (bfd *);
  static void display_bfd
!   (bfd *);
  static void objdump_print_value
!   (bfd_vma, struct disassemble_info *, bfd_boolean);
  static void objdump_print_symname
!   (bfd *, struct disassemble_info *, asymbol *);
  static asymbol *find_symbol_for_address
!   (bfd *, asection *, bfd_vma, bfd_boolean, long *);
  static void objdump_print_addr_with_sym
!   (bfd *, asection *, asymbol *, bfd_vma,
!    struct disassemble_info *, bfd_boolean);
  static void objdump_print_addr
!   (bfd_vma, struct disassemble_info *, bfd_boolean);
  static void objdump_print_address
!   (bfd_vma, struct disassemble_info *);
  static int objdump_symbol_at_address
!   (bfd_vma, struct disassemble_info *);
  static void show_line
!   (bfd *, asection *, bfd_vma);
  static void disassemble_bytes
!   (struct disassemble_info *, disassembler_ftype, bfd_boolean,
!    bfd_byte *, bfd_vma, bfd_vma, arelent ***, arelent **);
  static void disassemble_data
!   (bfd *);
  static asymbol ** slurp_symtab
!   (bfd *);
  static asymbol ** slurp_dynamic_symtab
!   (bfd *);
  static long remove_useless_symbols
!   (asymbol **, long);
  static int compare_symbols
!   (const void *, const void *);
  static int compare_relocs
!   (const void *, const void *);
  static void dump_stabs
!   (bfd *);
  static bfd_boolean read_section_stabs
!   (bfd *, const char *, const char *);
  static void print_section_stabs
!   (bfd *, const char *, const char *);
  static void dump_section_stabs
!   (bfd *, char *, char *);
  
  static void
! usage (FILE *stream, int status)
  {
    fprintf (stream, _("Usage: %s <option(s)> <file(s)>\n"), program_name);
    fprintf (stream, _(" Display information from object <file(s)>.\n"));
*************** usage (stream, status)
*** 254,264 ****
  }
  
  /* 150 isn't special; it's just an arbitrary non-ASCII char value.  */
! 
! #define OPTION_ENDIAN (150)
! #define OPTION_START_ADDRESS (OPTION_ENDIAN + 1)
! #define OPTION_STOP_ADDRESS (OPTION_START_ADDRESS + 1)
! #define OPTION_ADJUST_VMA (OPTION_STOP_ADDRESS + 1)
  
  static struct option long_options[]=
  {
--- 252,264 ----
  }
  
  /* 150 isn't special; it's just an arbitrary non-ASCII char value.  */
! enum option_values
!   {
!     OPTION_ENDIAN=150,
!     OPTION_START_ADDRESS,
!     OPTION_STOP_ADDRESS,
!     OPTION_ADJUST_VMA
!   };
  
  static struct option long_options[]=
  {
*************** static struct option long_options[]=
*** 302,319 ****
  };
  
  static void
! nonfatal (msg)
!      const char *msg;
  {
    bfd_nonfatal (msg);
    exit_status = 1;
  }
  
  static void
! dump_section_header (abfd, section, ignored)
!      bfd *abfd ATTRIBUTE_UNUSED;
!      asection *section;
!      PTR ignored ATTRIBUTE_UNUSED;
  {
    char *comma = "";
    unsigned int opb = bfd_octets_per_byte (abfd);
--- 302,316 ----
  };
  
  static void
! nonfatal (const char *msg)
  {
    bfd_nonfatal (msg);
    exit_status = 1;
  }
  
  static void
! dump_section_header (bfd *abfd ATTRIBUTE_UNUSED, asection *section,
! 		     void *ignored ATTRIBUTE_UNUSED)
  {
    char *comma = "";
    unsigned int opb = bfd_octets_per_byte (abfd);
*************** dump_section_header (abfd, section, igno
*** 388,395 ****
  }
  
  static void
! dump_headers (abfd)
!      bfd *abfd;
  {
    printf (_("Sections:\n"));
  
--- 385,391 ----
  }
  
  static void
! dump_headers (bfd *abfd)
  {
    printf (_("Sections:\n"));
  
*************** dump_headers (abfd)
*** 409,420 ****
      printf (_("  Pg"));
    printf ("\n");
  
!   bfd_map_over_sections (abfd, dump_section_header, (PTR) NULL);
  }
  
  static asymbol **
! slurp_symtab (abfd)
!      bfd *abfd;
  {
    asymbol **sy = (asymbol **) NULL;
    long storage;
--- 405,415 ----
      printf (_("  Pg"));
    printf ("\n");
  
!   bfd_map_over_sections (abfd, dump_section_header, NULL);
  }
  
  static asymbol **
! slurp_symtab (bfd *abfd)
  {
    asymbol **sy = (asymbol **) NULL;
    long storage;
*************** slurp_symtab (abfd)
*** 440,447 ****
  /* Read in the dynamic symbols.  */
  
  static asymbol **
! slurp_dynamic_symtab (abfd)
!      bfd *abfd;
  {
    asymbol **sy = (asymbol **) NULL;
    long storage;
--- 435,441 ----
  /* Read in the dynamic symbols.  */
  
  static asymbol **
! slurp_dynamic_symtab (bfd *abfd)
  {
    asymbol **sy = (asymbol **) NULL;
    long storage;
*************** slurp_dynamic_symtab (abfd)
*** 472,482 ****
     Return the number of useful symbols.  */
  
  static long
! remove_useless_symbols (symbols, count)
!      asymbol **symbols;
!      long count;
  {
!   register asymbol **in_ptr = symbols, **out_ptr = symbols;
  
    while (--count >= 0)
      {
--- 466,474 ----
     Return the number of useful symbols.  */
  
  static long
! remove_useless_symbols (asymbol **symbols, long count)
  {
!   asymbol **in_ptr = symbols, **out_ptr = symbols;
  
    while (--count >= 0)
      {
*************** remove_useless_symbols (symbols, count)
*** 498,513 ****
  /* Sort symbols into value order.  */
  
  static int
! compare_symbols (ap, bp)
!      const PTR ap;
!      const PTR bp;
! {
!   const asymbol *a = *(const asymbol **)ap;
!   const asymbol *b = *(const asymbol **)bp;
!   const char *an, *bn;
!   size_t anl, bnl;
!   bfd_boolean af, bf;
!   flagword aflags, bflags;
  
    if (bfd_asymbol_value (a) > bfd_asymbol_value (b))
      return 1;
--- 490,507 ----
  /* Sort symbols into value order.  */
  
  static int
! compare_symbols (const void *ap, const void *bp)
! {
!   const asymbol *a = * (const asymbol **) ap;
!   const asymbol *b = * (const asymbol **) bp;
!   const char *an;
!   const char *bn;
!   size_t anl;
!   size_t bnl;
!   bfd_boolean af;
!   bfd_boolean bf;
!   flagword aflags;
!   flagword bflags;
  
    if (bfd_asymbol_value (a) > bfd_asymbol_value (b))
      return 1;
*************** compare_symbols (ap, bp)
*** 605,616 ****
  /* Sort relocs into address order.  */
  
  static int
! compare_relocs (ap, bp)
!      const PTR ap;
!      const PTR bp;
  {
!   const arelent *a = *(const arelent **)ap;
!   const arelent *b = *(const arelent **)bp;
  
    if (a->address > b->address)
      return 1;
--- 599,608 ----
  /* Sort relocs into address order.  */
  
  static int
! compare_relocs (const void *ap, const void *bp)
  {
!   const arelent *a = * (const arelent **) ap;
!   const arelent *b = * (const arelent **) bp;
  
    if (a->address > b->address)
      return 1;
*************** compare_relocs (ap, bp)
*** 630,639 ****
  /* Print VMA to STREAM.  If SKIP_ZEROES is TRUE, omit leading zeroes.  */
  
  static void
! objdump_print_value (vma, info, skip_zeroes)
!      bfd_vma vma;
!      struct disassemble_info *info;
!      bfd_boolean skip_zeroes;
  {
    char buf[30];
    char *p;
--- 622,629 ----
  /* Print VMA to STREAM.  If SKIP_ZEROES is TRUE, omit leading zeroes.  */
  
  static void
! objdump_print_value (bfd_vma vma, struct disassemble_info *info,
! 		     bfd_boolean skip_zeroes)
  {
    char buf[30];
    char *p;
*************** objdump_print_value (vma, info, skip_zer
*** 656,665 ****
  /* Print the name of a symbol.  */
  
  static void
! objdump_print_symname (abfd, info, sym)
!      bfd *abfd;
!      struct disassemble_info *info;
!      asymbol *sym;
  {
    char *alloc;
    const char *name;
--- 646,653 ----
  /* Print the name of a symbol.  */
  
  static void
! objdump_print_symname (bfd *abfd, struct disassemble_info *info,
! 		       asymbol *sym)
  {
    char *alloc;
    const char *name;
*************** objdump_print_symname (abfd, info, sym)
*** 688,699 ****
     then *PLACE is set to the index of the symbol in sorted_syms.  */
  
  static asymbol *
! find_symbol_for_address (abfd, sec, vma, require_sec, place)
!      bfd *abfd;
!      asection *sec;
!      bfd_vma vma;
!      bfd_boolean require_sec;
!      long *place;
  {
    /* @@ Would it speed things up to cache the last two symbols returned,
       and maybe their address ranges?  For many processors, only one memory
--- 676,683 ----
     then *PLACE is set to the index of the symbol in sorted_syms.  */
  
  static asymbol *
! find_symbol_for_address (bfd *abfd, asection *sec, bfd_vma vma,
! 			 bfd_boolean require_sec, long *place)
  {
    /* @@ Would it speed things up to cache the last two symbols returned,
       and maybe their address ranges?  For many processors, only one memory
*************** find_symbol_for_address (abfd, sec, vma,
*** 812,824 ****
  /* Print an address to INFO symbolically.  */
  
  static void
! objdump_print_addr_with_sym (abfd, sec, sym, vma, info, skip_zeroes)
!      bfd *abfd;
!      asection *sec;
!      asymbol *sym;
!      bfd_vma vma;
!      struct disassemble_info *info;
!      bfd_boolean skip_zeroes;
  {
    objdump_print_value (vma, info, skip_zeroes);
  
--- 796,804 ----
  /* Print an address to INFO symbolically.  */
  
  static void
! objdump_print_addr_with_sym (bfd *abfd, asection *sec, asymbol *sym,
! 			     bfd_vma vma, struct disassemble_info *info,
! 			     bfd_boolean skip_zeroes)
  {
    objdump_print_value (vma, info, skip_zeroes);
  
*************** objdump_print_addr_with_sym (abfd, sec, 
*** 863,872 ****
     TRUE, don't output leading zeroes.  */
  
  static void
! objdump_print_addr (vma, info, skip_zeroes)
!      bfd_vma vma;
!      struct disassemble_info *info;
!      bfd_boolean skip_zeroes;
  {
    struct objdump_disasm_info *aux;
    asymbol *sym;
--- 843,850 ----
     TRUE, don't output leading zeroes.  */
  
  static void
! objdump_print_addr (bfd_vma vma, struct disassemble_info *info,
! 		    bfd_boolean skip_zeroes)
  {
    struct objdump_disasm_info *aux;
    asymbol *sym;
*************** objdump_print_addr (vma, info, skip_zero
*** 889,897 ****
     routine.  */
  
  static void
! objdump_print_address (vma, info)
!      bfd_vma vma;
!      struct disassemble_info *info;
  {
    objdump_print_addr (vma, info, ! prefix_addresses);
  }
--- 867,873 ----
     routine.  */
  
  static void
! objdump_print_address (bfd_vma vma, struct disassemble_info *info)
  {
    objdump_print_addr (vma, info, ! prefix_addresses);
  }
*************** objdump_print_address (vma, info)
*** 899,907 ****
  /* Determine of the given address has a symbol associated with it.  */
  
  static int
! objdump_symbol_at_address (vma, info)
!      bfd_vma vma;
!      struct disassemble_info * info;
  {
    struct objdump_disasm_info * aux;
    asymbol * sym;
--- 875,881 ----
  /* Determine of the given address has a symbol associated with it.  */
  
  static int
! objdump_symbol_at_address (bfd_vma vma, struct disassemble_info * info)
  {
    struct objdump_disasm_info * aux;
    asymbol * sym;
*************** static struct print_file_list *print_fil
*** 945,958 ****
  /* Skip ahead to a given line in a file, optionally printing each
     line.  */
  
- static void skip_to_line
-   PARAMS ((struct print_file_list *, unsigned int, bfd_boolean));
- 
  static void
! skip_to_line (p, line, show)
!      struct print_file_list *p;
!      unsigned int line;
!      bfd_boolean show;
  {
    while (p->line < line)
      {
--- 919,927 ----
  /* Skip ahead to a given line in a file, optionally printing each
     line.  */
  
  static void
! skip_to_line (struct print_file_list *p, unsigned int line,
! 	      bfd_boolean show)
  {
    while (p->line < line)
      {
*************** skip_to_line (p, line, show)
*** 977,986 ****
     listing.  */
  
  static void
! show_line (abfd, section, addr_offset)
!      bfd *abfd;
!      asection *section;
!      bfd_vma addr_offset;
  {
    const char *filename;
    const char *functionname;
--- 946,952 ----
     listing.  */
  
  static void
! show_line (bfd *abfd, asection *section, bfd_vma addr_offset)
  {
    const char *filename;
    const char *functionname;
*************** typedef struct
*** 1127,1143 ****
    char *current;
  } SFILE;
  
! /* sprintf to a "stream" */
  
  static int
! objdump_sprintf VPARAMS ((SFILE *f, const char *format, ...))
  {
    char *buf;
    size_t n;
  
!   VA_OPEN (args, format);
!   VA_FIXEDARG (args, SFILE *, f);
!   VA_FIXEDARG (args, const char *, format);
  
    vasprintf (&buf, format, args);
  
--- 1093,1108 ----
    char *current;
  } SFILE;
  
! /* sprintf to a "stream".  */
  
  static int
! objdump_sprintf (SFILE *f, const char *format, ...)
  {
    char *buf;
    size_t n;
+   va_list args;
  
!   va_start (args, format);
  
    vasprintf (&buf, format, args);
  
*************** objdump_sprintf VPARAMS ((SFILE *f, cons
*** 1165,1171 ****
  
    free (buf);
  
!   VA_CLOSE (args);
    return n;
  }
  
--- 1130,1136 ----
  
    free (buf);
  
!   va_end (args);
    return n;
  }
  
*************** objdump_sprintf VPARAMS ((SFILE *f, cons
*** 1190,1206 ****
  /* Disassemble some data in memory between given values.  */
  
  static void
! disassemble_bytes (info, disassemble_fn, insns, data,
! 		   start_offset, stop_offset, relppp,
! 		   relppend)
!      struct disassemble_info *info;
!      disassembler_ftype disassemble_fn;
!      bfd_boolean insns;
!      bfd_byte *data;
!      bfd_vma start_offset;
!      bfd_vma stop_offset;
!      arelent ***relppp;
!      arelent **relppend;
  {
    struct objdump_disasm_info *aux;
    asection *section;
--- 1155,1168 ----
  /* Disassemble some data in memory between given values.  */
  
  static void
! disassemble_bytes (struct disassemble_info * info,
! 		   disassembler_ftype        disassemble_fn,
! 		   bfd_boolean               insns,
! 		   bfd_byte *                data,
! 		   bfd_vma                   start_offset,
! 		   bfd_vma                   stop_offset,
! 		   arelent ***               relppp,
! 		   arelent **                relppend)
  {
    struct objdump_disasm_info *aux;
    asection *section;
*************** disassemble_bytes (info, disassemble_fn,
*** 1537,1544 ****
  /* Disassemble the contents of an object file.  */
  
  static void
! disassemble_data (abfd)
!      bfd *abfd;
  {
    unsigned long addr_offset;
    disassembler_ftype disassemble_fn;
--- 1499,1505 ----
  /* Disassemble the contents of an object file.  */
  
  static void
! disassemble_data (bfd *abfd)
  {
    unsigned long addr_offset;
    disassembler_ftype disassemble_fn;
*************** disassemble_data (abfd)
*** 1563,1569 ****
  
    INIT_DISASSEMBLE_INFO (disasm_info, stdout, fprintf);
  
!   disasm_info.application_data = (PTR) &aux;
    aux.abfd = abfd;
    aux.require_sec = FALSE;
    disasm_info.print_address_func = objdump_print_address;
--- 1524,1530 ----
  
    INIT_DISASSEMBLE_INFO (disasm_info, stdout, fprintf);
  
!   disasm_info.application_data = (void *) &aux;
    aux.abfd = abfd;
    aux.require_sec = FALSE;
    disasm_info.print_address_func = objdump_print_address;
*************** disassemble_data (abfd)
*** 1628,1634 ****
        asymbol *sym = NULL;
        long place = 0;
  
!       /* Sections that do not contain machine code are not normally disassembled.  */
        if (! disassemble_all
  	  && only == NULL
  	  && (section->flags & SEC_CODE) == 0)
--- 1589,1596 ----
        asymbol *sym = NULL;
        long place = 0;
  
!       /* Sections that do not contain machine
! 	 code are not normally disassembled.  */
        if (! disassemble_all
  	  && only == NULL
  	  && (section->flags & SEC_CODE) == 0)
*************** disassemble_data (abfd)
*** 1731,1737 ****
  
  	      for (x = place;
  		   (x < sorted_symcount
! 		    && bfd_asymbol_value (sorted_syms[x]) <= section->vma + addr_offset);
  		   ++x)
  		continue;
  
--- 1693,1700 ----
  
  	      for (x = place;
  		   (x < sorted_symcount
! 		    && bfd_asymbol_value (sorted_syms[x])
! 		       <= section->vma + addr_offset);
  		   ++x)
  		continue;
  
*************** disassemble_data (abfd)
*** 1751,1757 ****
  	      (* disasm_info.fprintf_func) (disasm_info.stream, ":\n");
  	    }
  
! 	  if (sym != NULL && bfd_asymbol_value (sym) > section->vma + addr_offset)
  	    nextsym = sym;
  	  else if (sym == NULL)
  	    nextsym = NULL;
--- 1714,1721 ----
  	      (* disasm_info.fprintf_func) (disasm_info.stream, ":\n");
  	    }
  
! 	  if (sym != NULL
! 	      && bfd_asymbol_value (sym) > section->vma + addr_offset)
  	    nextsym = sym;
  	  else if (sym == NULL)
  	    nextsym = NULL;
*************** disassemble_data (abfd)
*** 1822,1829 ****
     uses Sun stabs encoding.  */
  
  static void
! dump_stabs (abfd)
!      bfd *abfd;
  {
    dump_section_stabs (abfd, ".stab", ".stabstr");
    dump_section_stabs (abfd, ".stab.excl", ".stab.exclstr");
--- 1786,1792 ----
     uses Sun stabs encoding.  */
  
  static void
! dump_stabs (bfd *abfd)
  {
    dump_section_stabs (abfd, ".stab", ".stabstr");
    dump_section_stabs (abfd, ".stab.excl", ".stab.exclstr");
*************** dump_stabs (abfd)
*** 1837,1846 ****
     Otherwise return FALSE.  */
  
  static bfd_boolean
! read_section_stabs (abfd, stabsect_name, strsect_name)
!      bfd *abfd;
!      const char *stabsect_name;
!      const char *strsect_name;
  {
    asection *stabsect, *stabstrsect;
  
--- 1800,1807 ----
     Otherwise return FALSE.  */
  
  static bfd_boolean
! read_section_stabs (bfd *abfd, const char *stabsect_name,
! 		    const char *strsect_name)
  {
    asection *stabsect, *stabstrsect;
  
*************** read_section_stabs (abfd, stabsect_name,
*** 1866,1872 ****
    stabs  = (bfd_byte *) xmalloc (stab_size);
    strtab = (char *) xmalloc (stabstr_size);
  
!   if (! bfd_get_section_contents (abfd, stabsect, (PTR) stabs, 0, stab_size))
      {
        non_fatal (_("Reading %s section of %s failed: %s"),
  		 stabsect_name, bfd_get_filename (abfd),
--- 1827,1833 ----
    stabs  = (bfd_byte *) xmalloc (stab_size);
    strtab = (char *) xmalloc (stabstr_size);
  
!   if (! bfd_get_section_contents (abfd, stabsect, (void *) stabs, 0, stab_size))
      {
        non_fatal (_("Reading %s section of %s failed: %s"),
  		 stabsect_name, bfd_get_filename (abfd),
*************** read_section_stabs (abfd, stabsect_name,
*** 1877,1883 ****
        return FALSE;
      }
  
!   if (! bfd_get_section_contents (abfd, stabstrsect, (PTR) strtab, 0,
  				  stabstr_size))
      {
        non_fatal (_("Reading %s section of %s failed: %s\n"),
--- 1838,1844 ----
        return FALSE;
      }
  
!   if (! bfd_get_section_contents (abfd, stabstrsect, (void *) strtab, 0,
  				  stabstr_size))
      {
        non_fatal (_("Reading %s section of %s failed: %s\n"),
*************** read_section_stabs (abfd, stabsect_name,
*** 1900,1923 ****
       4 byte stab value
     FIXME: This will have to change for a 64 bit object format.  */
  
! #define STRDXOFF (0)
! #define TYPEOFF (4)
! #define OTHEROFF (5)
! #define DESCOFF (6)
! #define VALOFF (8)
  #define STABSIZE (12)
  
  /* Print ABFD's stabs section STABSECT_NAME (in `stabs'),
     using string table section STRSECT_NAME (in `strtab').  */
  
  static void
! print_section_stabs (abfd, stabsect_name, strsect_name)
!      bfd *abfd;
!      const char *stabsect_name;
!      const char *strsect_name ATTRIBUTE_UNUSED;
  {
    int i;
!   unsigned file_string_table_offset = 0, next_file_string_table_offset = 0;
    bfd_byte *stabp, *stabs_end;
  
    stabp = stabs;
--- 1861,1883 ----
       4 byte stab value
     FIXME: This will have to change for a 64 bit object format.  */
  
! #define STRDXOFF  (0)
! #define TYPEOFF   (4)
! #define OTHEROFF  (5)
! #define DESCOFF   (6)
! #define VALOFF    (8)
  #define STABSIZE (12)
  
  /* Print ABFD's stabs section STABSECT_NAME (in `stabs'),
     using string table section STRSECT_NAME (in `strtab').  */
  
  static void
! print_section_stabs (bfd *abfd, const char *stabsect_name,
! 		     const char *strsect_name ATTRIBUTE_UNUSED)
  {
    int i;
!   unsigned file_string_table_offset = 0;
!   unsigned next_file_string_table_offset = 0;
    bfd_byte *stabp, *stabs_end;
  
    stabp = stabs;
*************** print_section_stabs (abfd, stabsect_name
*** 1980,1989 ****
  }
  
  static void
! dump_section_stabs (abfd, stabsect_name, strsect_name)
!      bfd *abfd;
!      char *stabsect_name;
!      char *strsect_name;
  {
    asection *s;
  
--- 1940,1946 ----
  }
  
  static void
! dump_section_stabs (bfd *abfd, char *stabsect_name, char *strsect_name)
  {
    asection *s;
  
*************** dump_section_stabs (abfd, stabsect_name,
*** 2016,2023 ****
  
  
  static void
! dump_bfd_header (abfd)
!      bfd *abfd;
  {
    char *comma = "";
  
--- 1973,1979 ----
  
  
  static void
! dump_bfd_header (bfd *abfd)
  {
    char *comma = "";
  
*************** dump_bfd_header (abfd)
*** 2045,2052 ****
  
  
  static void
! dump_bfd_private_header (abfd)
! bfd *abfd;
  {
    bfd_print_private_bfd_data (abfd, stdout);
  }
--- 2001,2007 ----
  
  
  static void
! dump_bfd_private_header (bfd *abfd)
  {
    bfd_print_private_bfd_data (abfd, stdout);
  }
*************** bfd *abfd;
*** 2054,2061 ****
  /* Dump selected contents of ABFD.  */
  
  static void
! dump_bfd (abfd)
!      bfd *abfd;
  {
    /* If we are adjusting section VMA's, change them all now.  Changing
       the BFD information is a hack.  However, we must do it, or
--- 2009,2015 ----
  /* Dump selected contents of ABFD.  */
  
  static void
! dump_bfd (bfd *abfd)
  {
    /* If we are adjusting section VMA's, change them all now.  Changing
       the BFD information is a hack.  However, we must do it, or
*************** dump_bfd (abfd)
*** 2106,2112 ****
      disassemble_data (abfd);
    if (dump_debugging)
      {
!       PTR dhandle;
  
        dhandle = read_debugging_info (abfd, syms, symcount);
        if (dhandle != NULL)
--- 2060,2066 ----
      disassemble_data (abfd);
    if (dump_debugging)
      {
!       void *dhandle;
  
        dhandle = read_debugging_info (abfd, syms, symcount);
        if (dhandle != NULL)
*************** dump_bfd (abfd)
*** 2135,2142 ****
  }
  
  static void
! display_bfd (abfd)
!      bfd *abfd;
  {
    char **matching;
  
--- 2089,2095 ----
  }
  
  static void
! display_bfd (bfd *abfd)
  {
    char **matching;
  
*************** display_bfd (abfd)
*** 2176,2184 ****
  }
  
  static void
! display_file (filename, target)
!      char *filename;
!      char *target;
  {
    bfd *file, *arfile = (bfd *) NULL;
  
--- 2129,2135 ----
  }
  
  static void
! display_file (char *filename, char *target)
  {
    bfd *file, *arfile = (bfd *) NULL;
  
*************** display_file (filename, target)
*** 2225,2232 ****
  /* Actually display the various requested regions.  */
  
  static void
! dump_data (abfd)
!      bfd *abfd;
  {
    asection *section;
    bfd_byte *data = 0;
--- 2176,2182 ----
  /* Actually display the various requested regions.  */
  
  static void
! dump_data (bfd *abfd)
  {
    asection *section;
    bfd_byte *data = 0;
*************** dump_data (abfd)
*** 2256,2266 ****
  
  	      if (bfd_section_size (abfd, section) == 0)
  		continue;
! 	      data = (bfd_byte *) xmalloc ((size_t) bfd_section_size (abfd, section));
  	      datasize = bfd_section_size (abfd, section);
  
  
! 	      bfd_get_section_contents (abfd, section, (PTR) data, 0, bfd_section_size (abfd, section));
  
  	      if (start_address == (bfd_vma) -1
  		  || start_address < section->vma)
--- 2206,2218 ----
  
  	      if (bfd_section_size (abfd, section) == 0)
  		continue;
! 	      data = (bfd_byte *) xmalloc ((size_t) bfd_section_size
! 					   (abfd, section));
  	      datasize = bfd_section_size (abfd, section);
  
  
! 	      bfd_get_section_contents (abfd, section, (void *) data, 0,
! 					bfd_section_size (abfd, section));
  
  	      if (start_address == (bfd_vma) -1
  		  || start_address < section->vma)
*************** dump_data (abfd)
*** 2350,2358 ****
  /* Should perhaps share code and display with nm?  */
  
  static void
! dump_symbols (abfd, dynamic)
!      bfd *abfd ATTRIBUTE_UNUSED;
!      bfd_boolean dynamic;
  {
    asymbol **current;
    long max;
--- 2302,2308 ----
  /* Should perhaps share code and display with nm?  */
  
  static void
! dump_symbols (bfd *abfd ATTRIBUTE_UNUSED, bfd_boolean dynamic)
  {
    asymbol **current;
    long max;
*************** dump_symbols (abfd, dynamic)
*** 2413,2420 ****
  }
  
  static void
! dump_relocs (abfd)
!      bfd *abfd;
  {
    arelent **relpp;
    long relcount;
--- 2363,2369 ----
  }
  
  static void
! dump_relocs (bfd *abfd)
  {
    arelent **relpp;
    long relcount;
*************** dump_relocs (abfd)
*** 2476,2483 ****
  }
  
  static void
! dump_dynamic_relocs (abfd)
!      bfd *abfd;
  {
    long relsize;
    arelent **relpp;
--- 2425,2431 ----
  }
  
  static void
! dump_dynamic_relocs (bfd *abfd)
  {
    long relsize;
    arelent **relpp;
*************** dump_dynamic_relocs (abfd)
*** 2511,2521 ****
  }
  
  static void
! dump_reloc_set (abfd, sec, relpp, relcount)
!      bfd *abfd;
!      asection *sec;
!      arelent **relpp;
!      long relcount;
  {
    arelent **p;
    char *last_filename, *last_functionname;
--- 2459,2465 ----
  }
  
  static void
! dump_reloc_set (bfd *abfd, asection *sec, arelent **relpp, long relcount)
  {
    arelent **p;
    char *last_filename, *last_functionname;
*************** dump_reloc_set (abfd, sec, relpp, relcou
*** 2626,2637 ****
      }
  }
  
- int main PARAMS ((int, char **));
- 
  int
! main (argc, argv)
!      int argc;
!      char **argv;
  {
    int c;
    char *target = default_target;
--- 2570,2577 ----
      }
  }
  
  int
! main (int argc, char **argv)
  {
    int c;
    char *target = default_target;
*************** main (argc, argv)
*** 2668,2674 ****
  	case 'M':
  	  if (disassembler_options)
  	    /* Ignore potential memory leak for now.  */
! 	    disassembler_options = concat (disassembler_options, ",", optarg, NULL);
  	  else
  	    disassembler_options = optarg;
  	  break;
--- 2608,2615 ----
  	case 'M':
  	  if (disassembler_options)
  	    /* Ignore potential memory leak for now.  */
! 	    disassembler_options = concat (disassembler_options, ",",
! 					   optarg, NULL);
  	  else
  	    disassembler_options = optarg;
  	  break;
                


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]