1 /* objdump.c -- dump information about an object file.
2 Copyright 1990, 91, 92, 93, 94, 95, 1996 Free Software Foundation, Inc.
4 This file is part of GNU Binutils.
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2, or (at your option)
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
26 #include "libiberty.h"
30 #ifdef ANSI_PROTOTYPES
36 /* Internal headers for the ELF .stab-dump code - sorry. */
37 #define BYTES_IN_WORD 32
38 #include "aout/aout64.h"
40 #ifdef NEED_DECLARATION_FPRINTF
41 /* This is needed by INIT_DISASSEMBLE_INFO. */
42 extern int fprintf
PARAMS ((FILE *, const char *, ...));
45 char *default_target
= NULL
; /* default at runtime */
47 extern char *program_version
;
49 int show_version
= 0; /* show the version number */
50 int dump_section_contents
; /* -s */
51 int dump_section_headers
; /* -h */
52 boolean dump_file_header
; /* -f */
53 int dump_symtab
; /* -t */
54 int dump_dynamic_symtab
; /* -T */
55 int dump_reloc_info
; /* -r */
56 int dump_dynamic_reloc_info
; /* -R */
57 int dump_ar_hdrs
; /* -a */
58 int dump_private_headers
; /* -p */
59 int with_line_numbers
; /* -l */
60 boolean with_source_code
; /* -S */
61 int show_raw_insn
; /* --show-raw-insn */
62 int dump_stab_section_info
; /* --stabs */
63 boolean disassemble
; /* -d */
64 boolean disassemble_all
; /* -D */
65 boolean formats_info
; /* -i */
66 char *only
; /* -j secname */
67 int wide_output
; /* -w */
68 bfd_vma start_address
= (bfd_vma
) -1; /* --start-address */
69 bfd_vma stop_address
= (bfd_vma
) -1; /* --stop-address */
70 int dump_debugging
; /* --debugging */
72 /* Extra info to pass to the disassembler address printing function. */
73 struct objdump_disasm_info
{
79 /* Architecture to disassemble for, or default if NULL. */
80 char *machine
= (char *) NULL
;
82 /* The symbol table. */
85 /* Number of symbols in `syms'. */
88 /* The sorted symbol table. */
89 asymbol
**sorted_syms
;
91 /* Number of symbols in `sorted_syms'. */
92 long sorted_symcount
= 0;
94 /* The dynamic symbol table. */
97 /* Number of symbols in `dynsyms'. */
100 /* Forward declarations. */
103 display_file
PARAMS ((char *filename
, char *target
));
106 dump_data
PARAMS ((bfd
*abfd
));
109 dump_relocs
PARAMS ((bfd
*abfd
));
112 dump_dynamic_relocs
PARAMS ((bfd
* abfd
));
115 dump_reloc_set
PARAMS ((bfd
*, arelent
**, long));
118 dump_symbols
PARAMS ((bfd
*abfd
, boolean dynamic
));
121 display_bfd
PARAMS ((bfd
*abfd
));
124 objdump_print_value
PARAMS ((bfd_vma
, struct disassemble_info
*));
127 objdump_print_address
PARAMS ((bfd_vma
, struct disassemble_info
*));
130 show_line
PARAMS ((bfd
*, asection
*, bfd_vma
));
133 endian_string
PARAMS ((enum bfd_endian
));
136 usage (stream
, status
)
141 Usage: %s [-ahifdDprRtTxsSlw] [-b bfdname] [-m machine] [-j section-name]\n\
142 [--archive-headers] [--target=bfdname] [--debugging] [--disassemble]\n\
143 [--disassemble-all] [--file-headers] [--section-headers] [--headers]\n\
144 [--info] [--section=section-name] [--line-numbers] [--source]\n",
147 [--architecture=machine] [--reloc] [--full-contents] [--stabs]\n\
148 [--syms] [--all-headers] [--dynamic-syms] [--dynamic-reloc]\n\
149 [--wide] [--version] [--help] [--private-headers]\n\
150 [--start-address=addr] [--stop-address=addr]\n\
151 [--show-raw-insn] objfile...\n\
152 at least one option besides -l (--line-numbers) must be given\n");
153 list_supported_targets (program_name
, stream
);
157 /* 150 isn't special; it's just an arbitrary non-ASCII char value. */
159 #define OPTION_START_ADDRESS (150)
160 #define OPTION_STOP_ADDRESS (OPTION_START_ADDRESS + 1)
162 static struct option long_options
[]=
164 {"all-headers", no_argument
, NULL
, 'x'},
165 {"private-headers", no_argument
, NULL
, 'p'},
166 {"architecture", required_argument
, NULL
, 'm'},
167 {"archive-headers", no_argument
, NULL
, 'a'},
168 {"debugging", no_argument
, &dump_debugging
, 1},
169 {"disassemble", no_argument
, NULL
, 'd'},
170 {"disassemble-all", no_argument
, NULL
, 'D'},
171 {"dynamic-reloc", no_argument
, NULL
, 'R'},
172 {"dynamic-syms", no_argument
, NULL
, 'T'},
173 {"file-headers", no_argument
, NULL
, 'f'},
174 {"full-contents", no_argument
, NULL
, 's'},
175 {"headers", no_argument
, NULL
, 'h'},
176 {"help", no_argument
, NULL
, 'H'},
177 {"info", no_argument
, NULL
, 'i'},
178 {"line-numbers", no_argument
, NULL
, 'l'},
179 {"reloc", no_argument
, NULL
, 'r'},
180 {"section", required_argument
, NULL
, 'j'},
181 {"section-headers", no_argument
, NULL
, 'h'},
182 {"show-raw-insn", no_argument
, &show_raw_insn
, 1},
183 {"source", no_argument
, NULL
, 'S'},
184 {"stabs", no_argument
, &dump_stab_section_info
, 1},
185 {"start-address", required_argument
, NULL
, OPTION_START_ADDRESS
},
186 {"stop-address", required_argument
, NULL
, OPTION_STOP_ADDRESS
},
187 {"syms", no_argument
, NULL
, 't'},
188 {"target", required_argument
, NULL
, 'b'},
189 {"version", no_argument
, &show_version
, 1},
190 {"wide", no_argument
, &wide_output
, 'w'},
191 {0, no_argument
, 0, 0}
195 dump_section_header (abfd
, section
, ignored
)
202 printf ("%3d %-13s %08lx ", section
->index
,
203 bfd_get_section_name (abfd
, section
),
204 (unsigned long) bfd_section_size (abfd
, section
));
205 printf_vma (bfd_get_section_vma (abfd
, section
));
207 printf_vma (section
->lma
);
208 printf (" %08lx 2**%u", section
->filepos
,
209 bfd_get_section_alignment (abfd
, section
));
215 if (section->flags & x) { printf ("%s%s", comma, y); comma = ", "; }
217 PF (SEC_HAS_CONTENTS
, "CONTENTS");
218 PF (SEC_ALLOC
, "ALLOC");
219 PF (SEC_CONSTRUCTOR
, "CONSTRUCTOR");
220 PF (SEC_CONSTRUCTOR_TEXT
, "CONSTRUCTOR TEXT");
221 PF (SEC_CONSTRUCTOR_DATA
, "CONSTRUCTOR DATA");
222 PF (SEC_CONSTRUCTOR_BSS
, "CONSTRUCTOR BSS");
223 PF (SEC_LOAD
, "LOAD");
224 PF (SEC_RELOC
, "RELOC");
226 PF (SEC_BALIGN
, "BALIGN");
228 PF (SEC_READONLY
, "READONLY");
229 PF (SEC_CODE
, "CODE");
230 PF (SEC_DATA
, "DATA");
232 PF (SEC_DEBUGGING
, "DEBUGGING");
233 PF (SEC_NEVER_LOAD
, "NEVER_LOAD");
234 PF (SEC_EXCLUDE
, "EXCLUDE");
235 PF (SEC_SORT_ENTRIES
, "SORT_ENTRIES");
237 if ((section
->flags
& SEC_LINK_ONCE
) != 0)
241 switch (section
->flags
& SEC_LINK_DUPLICATES
)
245 case SEC_LINK_DUPLICATES_DISCARD
:
246 ls
= "LINK_ONCE_DISCARD";
248 case SEC_LINK_DUPLICATES_ONE_ONLY
:
249 ls
= "LINK_ONCE_ONE_ONLY";
251 case SEC_LINK_DUPLICATES_SAME_SIZE
:
252 ls
= "LINK_ONCE_SAME_SIZE";
254 case SEC_LINK_DUPLICATES_SAME_CONTENTS
:
255 ls
= "LINK_ONCE_SAME_CONTENTS";
258 printf ("%s%s", comma
, ls
);
270 printf ("Sections:\n");
272 printf ("Idx Name Size VMA LMA File off Algn\n");
274 printf ("Idx Name Size VMA LMA File off Algn\n");
276 bfd_map_over_sections (abfd
, dump_section_header
, (PTR
) NULL
);
283 asymbol
**sy
= (asymbol
**) NULL
;
286 if (!(bfd_get_file_flags (abfd
) & HAS_SYMS
))
288 printf ("No symbols in \"%s\".\n", bfd_get_filename (abfd
));
293 storage
= bfd_get_symtab_upper_bound (abfd
);
295 bfd_fatal (bfd_get_filename (abfd
));
299 sy
= (asymbol
**) xmalloc (storage
);
301 symcount
= bfd_canonicalize_symtab (abfd
, sy
);
303 bfd_fatal (bfd_get_filename (abfd
));
305 fprintf (stderr
, "%s: %s: No symbols\n",
306 program_name
, bfd_get_filename (abfd
));
310 /* Read in the dynamic symbols. */
313 slurp_dynamic_symtab (abfd
)
316 asymbol
**sy
= (asymbol
**) NULL
;
319 storage
= bfd_get_dynamic_symtab_upper_bound (abfd
);
322 if (!(bfd_get_file_flags (abfd
) & DYNAMIC
))
324 fprintf (stderr
, "%s: %s: not a dynamic object\n",
325 program_name
, bfd_get_filename (abfd
));
330 bfd_fatal (bfd_get_filename (abfd
));
335 sy
= (asymbol
**) xmalloc (storage
);
337 dynsymcount
= bfd_canonicalize_dynamic_symtab (abfd
, sy
);
339 bfd_fatal (bfd_get_filename (abfd
));
340 if (dynsymcount
== 0)
341 fprintf (stderr
, "%s: %s: No dynamic symbols\n",
342 program_name
, bfd_get_filename (abfd
));
346 /* Filter out (in place) symbols that are useless for disassembly.
347 COUNT is the number of elements in SYMBOLS.
348 Return the number of useful symbols. */
351 remove_useless_symbols (symbols
, count
)
355 register asymbol
**in_ptr
= symbols
, **out_ptr
= symbols
;
359 asymbol
*sym
= *in_ptr
++;
361 if (sym
->name
== NULL
|| sym
->name
[0] == '\0')
363 if (sym
->flags
& (BSF_DEBUGGING
))
365 if (bfd_is_und_section (sym
->section
)
366 || bfd_is_com_section (sym
->section
))
371 return out_ptr
- symbols
;
374 /* Sort symbols into value order. */
377 compare_symbols (ap
, bp
)
381 const asymbol
*a
= *(const asymbol
**)ap
;
382 const asymbol
*b
= *(const asymbol
**)bp
;
386 flagword aflags
, bflags
;
388 if (bfd_asymbol_value (a
) > bfd_asymbol_value (b
))
390 else if (bfd_asymbol_value (a
) < bfd_asymbol_value (b
))
393 if (a
->section
> b
->section
)
395 else if (a
->section
< b
->section
)
398 an
= bfd_asymbol_name (a
);
399 bn
= bfd_asymbol_name (b
);
403 /* The symbols gnu_compiled and gcc2_compiled convey no real
404 information, so put them after other symbols with the same value. */
406 af
= (strstr (an
, "gnu_compiled") != NULL
407 || strstr (an
, "gcc2_compiled") != NULL
);
408 bf
= (strstr (bn
, "gnu_compiled") != NULL
409 || strstr (bn
, "gcc2_compiled") != NULL
);
416 /* We use a heuristic for the file name, to try to sort it after
417 more useful symbols. It may not work on non Unix systems, but it
418 doesn't really matter; the only difference is precisely which
419 symbol names get printed. */
421 #define file_symbol(s, sn, snl) \
422 (((s)->flags & BSF_FILE) != 0 \
423 || ((sn)[(snl) - 2] == '.' \
424 && ((sn)[(snl) - 1] == 'o' \
425 || (sn)[(snl) - 1] == 'a')))
427 af
= file_symbol (a
, an
, anl
);
428 bf
= file_symbol (b
, bn
, bnl
);
435 /* Finally, try to sort global symbols before local symbols before
436 debugging symbols. */
441 if ((aflags
& BSF_DEBUGGING
) != (bflags
& BSF_DEBUGGING
))
443 if ((aflags
& BSF_DEBUGGING
) != 0)
448 if ((aflags
& BSF_LOCAL
) != (bflags
& BSF_LOCAL
))
450 if ((aflags
& BSF_LOCAL
) != 0)
459 /* Sort relocs into address order. */
462 compare_relocs (ap
, bp
)
466 const arelent
*a
= *(const arelent
**)ap
;
467 const arelent
*b
= *(const arelent
**)bp
;
469 if (a
->address
> b
->address
)
471 else if (a
->address
< b
->address
)
474 /* So that associated relocations tied to the same address show up
475 in the correct order, we don't do any further sorting. */
484 /* Print VMA to STREAM with no leading zeroes. */
487 objdump_print_value (vma
, info
)
489 struct disassemble_info
*info
;
494 sprintf_vma (buf
, vma
);
495 for (p
= buf
; *p
== '0'; ++p
)
497 (*info
->fprintf_func
) (info
->stream
, "%s", p
);
500 /* Print VMA symbolically to INFO if possible. */
503 objdump_print_address (vma
, info
)
505 struct disassemble_info
*info
;
509 /* @@ Would it speed things up to cache the last two symbols returned,
510 and maybe their address ranges? For many processors, only one memory
511 operand can be present at a time, so the 2-entry cache wouldn't be
512 constantly churned by code doing heavy memory accesses. */
514 /* Indices in `sorted_syms'. */
516 long max
= sorted_symcount
;
519 sprintf_vma (buf
, vma
);
520 (*info
->fprintf_func
) (info
->stream
, "%s", buf
);
522 if (sorted_symcount
< 1)
525 /* Perform a binary search looking for the closest symbol to the
526 required value. We are searching the range (min, max]. */
527 while (min
+ 1 < max
)
531 thisplace
= (max
+ min
) / 2;
532 sym
= sorted_syms
[thisplace
];
534 if (bfd_asymbol_value (sym
) > vma
)
536 else if (bfd_asymbol_value (sym
) < vma
)
545 /* The symbol we want is now in min, the low end of the range we
546 were searching. If there are several symbols with the same
547 value, we want the first one. */
550 && (bfd_asymbol_value (sorted_syms
[thisplace
])
551 == bfd_asymbol_value (sorted_syms
[thisplace
- 1])))
555 /* If the file is relocateable, and the symbol could be from this
556 section, prefer a symbol from this section over symbols from
557 others, even if the other symbol's value might be closer.
559 Note that this may be wrong for some symbol references if the
560 sections have overlapping memory ranges, but in that case there's
561 no way to tell what's desired without looking at the relocation
563 struct objdump_disasm_info
*aux
;
566 aux
= (struct objdump_disasm_info
*) info
->application_data
;
567 if (sorted_syms
[thisplace
]->section
!= aux
->sec
569 || ((aux
->abfd
->flags
& HAS_RELOC
) != 0
570 && vma
>= bfd_get_section_vma (aux
->abfd
, aux
->sec
)
571 && vma
< (bfd_get_section_vma (aux
->abfd
, aux
->sec
)
572 + bfd_section_size (aux
->abfd
, aux
->sec
)))))
574 for (i
= thisplace
+ 1; i
< sorted_symcount
; i
++)
576 if (bfd_asymbol_value (sorted_syms
[i
])
577 != bfd_asymbol_value (sorted_syms
[thisplace
]))
583 if (sorted_syms
[i
]->section
== aux
->sec
585 || sorted_syms
[i
- 1]->section
!= aux
->sec
586 || (bfd_asymbol_value (sorted_syms
[i
])
587 != bfd_asymbol_value (sorted_syms
[i
- 1]))))
594 if (sorted_syms
[thisplace
]->section
!= aux
->sec
)
596 /* We didn't find a good symbol with a smaller value.
597 Look for one with a larger value. */
598 for (i
= thisplace
+ 1; i
< sorted_symcount
; i
++)
600 if (sorted_syms
[i
]->section
== aux
->sec
)
608 if (sorted_syms
[thisplace
]->section
!= aux
->sec
610 || ((aux
->abfd
->flags
& HAS_RELOC
) != 0
611 && vma
>= bfd_get_section_vma (aux
->abfd
, aux
->sec
)
612 && vma
< (bfd_get_section_vma (aux
->abfd
, aux
->sec
)
613 + bfd_section_size (aux
->abfd
, aux
->sec
)))))
617 (*info
->fprintf_func
) (info
->stream
, " <%s",
618 bfd_get_section_name (aux
->abfd
, aux
->sec
));
619 secaddr
= bfd_get_section_vma (aux
->abfd
, aux
->sec
);
622 (*info
->fprintf_func
) (info
->stream
, "-");
623 objdump_print_value (secaddr
- vma
, info
);
625 else if (vma
> secaddr
)
627 (*info
->fprintf_func
) (info
->stream
, "+");
628 objdump_print_value (vma
- secaddr
, info
);
630 (*info
->fprintf_func
) (info
->stream
, ">");
636 (*info
->fprintf_func
) (info
->stream
, " <%s", sorted_syms
[thisplace
]->name
);
637 if (bfd_asymbol_value (sorted_syms
[thisplace
]) > vma
)
639 (*info
->fprintf_func
) (info
->stream
, "-");
640 objdump_print_value (bfd_asymbol_value (sorted_syms
[thisplace
]) - vma
,
643 else if (vma
> bfd_asymbol_value (sorted_syms
[thisplace
]))
645 (*info
->fprintf_func
) (info
->stream
, "+");
646 objdump_print_value (vma
- bfd_asymbol_value (sorted_syms
[thisplace
]),
649 (*info
->fprintf_func
) (info
->stream
, ">");
652 /* Hold the last function name and the last line number we displayed
655 static char *prev_functionname
;
656 static unsigned int prev_line
;
658 /* We keep a list of all files that we have seen when doing a
659 dissassembly with source, so that we know how much of the file to
660 display. This can be important for inlined functions. */
662 struct print_file_list
664 struct print_file_list
*next
;
670 static struct print_file_list
*print_files
;
672 /* The number of preceding context lines to show when we start
673 displaying a file for the first time. */
675 #define SHOW_PRECEDING_CONTEXT_LINES (5)
677 /* Skip ahead to a given line in a file, optionally printing each
681 skip_to_line
PARAMS ((struct print_file_list
*, unsigned int, boolean
));
684 skip_to_line (p
, line
, show
)
685 struct print_file_list
*p
;
689 while (p
->line
< line
)
693 if (fgets (buf
, sizeof buf
, p
->f
) == NULL
)
703 if (strchr (buf
, '\n') != NULL
)
708 /* Show the line number, or the source line, in a dissassembly
712 show_line (abfd
, section
, off
)
717 CONST
char *filename
;
718 CONST
char *functionname
;
721 if (! with_line_numbers
&& ! with_source_code
)
724 if (! bfd_find_nearest_line (abfd
, section
, syms
, off
, &filename
,
725 &functionname
, &line
))
728 if (filename
!= NULL
&& *filename
== '\0')
730 if (functionname
!= NULL
&& *functionname
== '\0')
733 if (with_line_numbers
)
735 if (functionname
!= NULL
736 && (prev_functionname
== NULL
737 || strcmp (functionname
, prev_functionname
) != 0))
738 printf ("%s():\n", functionname
);
739 if (line
> 0 && line
!= prev_line
)
740 printf ("%s:%u\n", filename
== NULL
? "???" : filename
, line
);
747 struct print_file_list
**pp
, *p
;
749 for (pp
= &print_files
; *pp
!= NULL
; pp
= &(*pp
)->next
)
750 if (strcmp ((*pp
)->filename
, filename
) == 0)
756 if (p
!= print_files
)
760 /* We have reencountered a file name which we saw
761 earlier. This implies that either we are dumping out
762 code from an included file, or the same file was
763 linked in more than once. There are two common cases
764 of an included file: inline functions in a header
765 file, and a bison or flex skeleton file. In the
766 former case we want to just start printing (but we
767 back up a few lines to give context); in the latter
768 case we want to continue from where we left off. I
769 can't think of a good way to distinguish the cases,
770 so I used a heuristic based on the file name. */
771 if (strcmp (p
->filename
+ strlen (p
->filename
) - 2, ".h") != 0)
775 l
= line
- SHOW_PRECEDING_CONTEXT_LINES
;
782 p
->f
= fopen (p
->filename
, "r");
786 skip_to_line (p
, l
, false);
788 if (print_files
->f
!= NULL
)
790 fclose (print_files
->f
);
791 print_files
->f
= NULL
;
797 skip_to_line (p
, line
, true);
799 p
->next
= print_files
;
807 f
= fopen (filename
, "r");
812 p
= ((struct print_file_list
*)
813 xmalloc (sizeof (struct print_file_list
)));
814 p
->filename
= xmalloc (strlen (filename
) + 1);
815 strcpy (p
->filename
, filename
);
819 if (print_files
!= NULL
&& print_files
->f
!= NULL
)
821 fclose (print_files
->f
);
822 print_files
->f
= NULL
;
824 p
->next
= print_files
;
827 l
= line
- SHOW_PRECEDING_CONTEXT_LINES
;
830 skip_to_line (p
, l
, false);
832 skip_to_line (p
, line
, true);
837 if (functionname
!= NULL
838 && (prev_functionname
== NULL
839 || strcmp (functionname
, prev_functionname
) != 0))
841 if (prev_functionname
!= NULL
)
842 free (prev_functionname
);
843 prev_functionname
= xmalloc (strlen (functionname
) + 1);
844 strcpy (prev_functionname
, functionname
);
847 if (line
> 0 && line
!= prev_line
)
851 /* Pseudo FILE object for strings. */
857 /* sprintf to a "stream" */
859 #ifdef ANSI_PROTOTYPES
861 objdump_sprintf (SFILE
*f
, const char *format
, ...)
866 va_start (args
, format
);
867 vsprintf (f
->current
, format
, args
);
868 f
->current
+= n
= strlen (f
->current
);
874 objdump_sprintf (va_alist
)
883 f
= va_arg (args
, SFILE
*);
884 format
= va_arg (args
, const char *);
885 vsprintf (f
->current
, format
, args
);
886 f
->current
+= n
= strlen (f
->current
);
893 disassemble_data (abfd
)
897 disassembler_ftype disassemble_fn
= 0; /* New style */
898 struct disassemble_info disasm_info
;
899 struct objdump_disasm_info aux
;
901 boolean done_dot
= false;
906 prev_functionname
= NULL
;
909 /* We make a copy of syms to sort. We don't want to sort syms
910 because that will screw up the relocs. */
911 sorted_syms
= (asymbol
**) xmalloc (symcount
* sizeof (asymbol
*));
912 memcpy (sorted_syms
, syms
, symcount
* sizeof (asymbol
*));
914 sorted_symcount
= remove_useless_symbols (sorted_syms
, symcount
);
916 /* Sort the symbols into section and symbol order */
917 qsort (sorted_syms
, sorted_symcount
, sizeof (asymbol
*), compare_symbols
);
919 INIT_DISASSEMBLE_INFO(disasm_info
, stdout
, fprintf
);
920 disasm_info
.application_data
= (PTR
) &aux
;
922 disasm_info
.print_address_func
= objdump_print_address
;
924 if (machine
!= (char *) NULL
)
926 const bfd_arch_info_type
*info
= bfd_scan_arch (machine
);
929 fprintf (stderr
, "%s: Can't use supplied machine %s\n",
934 abfd
->arch_info
= info
;
937 disassemble_fn
= disassembler (abfd
);
940 fprintf (stderr
, "%s: Can't disassemble for architecture %s\n",
942 bfd_printable_arch_mach (bfd_get_arch (abfd
), 0));
946 disasm_info
.arch
= bfd_get_arch (abfd
);
947 disasm_info
.mach
= bfd_get_mach (abfd
);
948 if (bfd_big_endian (abfd
))
949 disasm_info
.endian
= BFD_ENDIAN_BIG
;
950 else if (bfd_little_endian (abfd
))
951 disasm_info
.endian
= BFD_ENDIAN_LITTLE
;
953 /* ??? Aborting here seems too drastic. We could default to big or little
955 disasm_info
.endian
= BFD_ENDIAN_UNKNOWN
;
957 for (section
= abfd
->sections
;
958 section
!= (asection
*) NULL
;
959 section
= section
->next
)
961 bfd_byte
*data
= NULL
;
962 bfd_size_type datasize
= 0;
963 arelent
**relbuf
= NULL
;
964 arelent
**relpp
= NULL
;
965 arelent
**relppend
= NULL
;
968 if ((section
->flags
& SEC_LOAD
) == 0
969 || (! disassemble_all
971 && (section
->flags
& SEC_CODE
) == 0))
973 if (only
!= (char *) NULL
&& strcmp (only
, section
->name
) != 0)
977 && (section
->flags
& SEC_RELOC
) != 0)
981 relsize
= bfd_get_reloc_upper_bound (abfd
, section
);
983 bfd_fatal (bfd_get_filename (abfd
));
989 relbuf
= (arelent
**) xmalloc (relsize
);
990 relcount
= bfd_canonicalize_reloc (abfd
, section
, relbuf
, syms
);
992 bfd_fatal (bfd_get_filename (abfd
));
994 /* Sort the relocs by address. */
995 qsort (relbuf
, relcount
, sizeof (arelent
*), compare_relocs
);
998 relppend
= relpp
+ relcount
;
1002 printf ("Disassembly of section %s:\n", section
->name
);
1004 datasize
= bfd_get_section_size_before_reloc (section
);
1008 data
= (bfd_byte
*) xmalloc ((size_t) datasize
);
1010 bfd_get_section_contents (abfd
, section
, data
, 0, datasize
);
1013 disasm_info
.buffer
= data
;
1014 disasm_info
.buffer_vma
= section
->vma
;
1015 disasm_info
.buffer_length
= datasize
;
1016 if (start_address
== (bfd_vma
) -1
1017 || start_address
< disasm_info
.buffer_vma
)
1020 i
= start_address
- disasm_info
.buffer_vma
;
1021 if (stop_address
== (bfd_vma
) -1)
1025 if (stop_address
< disasm_info
.buffer_vma
)
1028 stop
= stop_address
- disasm_info
.buffer_vma
;
1029 if (stop
> disasm_info
.buffer_length
)
1030 stop
= disasm_info
.buffer_length
;
1035 boolean need_nl
= false;
1037 if (data
[i
] == 0 && data
[i
+ 1] == 0 && data
[i
+ 2] == 0 &&
1040 if (done_dot
== false)
1050 if (with_line_numbers
|| with_source_code
)
1051 show_line (abfd
, section
, i
);
1052 aux
.require_sec
= true;
1053 objdump_print_address (section
->vma
+ i
, &disasm_info
);
1054 aux
.require_sec
= false;
1057 sfile
.buffer
= sfile
.current
= buf
;
1058 disasm_info
.fprintf_func
= (fprintf_ftype
) objdump_sprintf
;
1059 disasm_info
.stream
= (FILE *) &sfile
;
1060 bytes
= (*disassemble_fn
) (section
->vma
+ i
, &disasm_info
);
1061 disasm_info
.fprintf_func
= (fprintf_ftype
) fprintf
;
1062 disasm_info
.stream
= stdout
;
1069 for (j
= i
; j
< i
+ bytes
; ++j
)
1071 printf ("%02x", (unsigned) data
[j
]);
1074 /* Separate raw data from instruction by extra space. */
1078 printf ("%s", sfile
.buffer
);
1087 && (section
->flags
& SEC_RELOC
) != 0)
1089 while (relpp
< relppend
1090 && ((*relpp
)->address
>= (bfd_vma
) i
1091 && (*relpp
)->address
< (bfd_vma
) i
+ bytes
))
1094 const char *sym_name
;
1098 printf ("\t\tRELOC: ");
1100 printf_vma (section
->vma
+ q
->address
);
1102 printf (" %s ", q
->howto
->name
);
1104 if (q
->sym_ptr_ptr
!= NULL
1105 && *q
->sym_ptr_ptr
!= NULL
)
1107 sym_name
= bfd_asymbol_name (*q
->sym_ptr_ptr
);
1108 if (sym_name
== NULL
|| *sym_name
== '\0')
1112 sym_sec
= bfd_get_section (*q
->sym_ptr_ptr
);
1113 sym_name
= bfd_get_section_name (abfd
, sym_sec
);
1114 if (sym_name
== NULL
|| *sym_name
== '\0')
1115 sym_name
= "*unknown*";
1119 sym_name
= "*unknown*";
1121 printf ("%s", sym_name
);
1126 printf_vma (q
->addend
);
1149 /* Define a table of stab values and print-strings. We wish the initializer
1150 could be a direct-mapped table, but instead we build one the first
1153 void dump_section_stabs
PARAMS ((bfd
*abfd
, char *stabsect_name
,
1154 char *strsect_name
));
1156 /* Dump the stabs sections from an object file that has a section that
1157 uses Sun stabs encoding. It has to use some hooks into BFD because
1158 string table sections are not normally visible to BFD callers. */
1164 dump_section_stabs (abfd
, ".stab", ".stabstr");
1165 dump_section_stabs (abfd
, ".stab.excl", ".stab.exclstr");
1166 dump_section_stabs (abfd
, ".stab.index", ".stab.indexstr");
1167 dump_section_stabs (abfd
, "$GDB_SYMBOLS$", "$GDB_STRINGS$");
1170 static struct internal_nlist
*stabs
;
1171 static bfd_size_type stab_size
;
1173 static char *strtab
;
1174 static bfd_size_type stabstr_size
;
1176 /* Read ABFD's stabs section STABSECT_NAME into `stabs'
1177 and string table section STRSECT_NAME into `strtab'.
1178 If the section exists and was read, allocate the space and return true.
1179 Otherwise return false. */
1182 read_section_stabs (abfd
, stabsect_name
, strsect_name
)
1184 char *stabsect_name
;
1187 asection
*stabsect
, *stabstrsect
;
1189 stabsect
= bfd_get_section_by_name (abfd
, stabsect_name
);
1192 printf ("No %s section present\n\n", stabsect_name
);
1196 stabstrsect
= bfd_get_section_by_name (abfd
, strsect_name
);
1197 if (0 == stabstrsect
)
1199 fprintf (stderr
, "%s: %s has no %s section\n", program_name
,
1200 bfd_get_filename (abfd
), strsect_name
);
1204 stab_size
= bfd_section_size (abfd
, stabsect
);
1205 stabstr_size
= bfd_section_size (abfd
, stabstrsect
);
1207 stabs
= (struct internal_nlist
*) xmalloc (stab_size
);
1208 strtab
= (char *) xmalloc (stabstr_size
);
1210 if (! bfd_get_section_contents (abfd
, stabsect
, (PTR
) stabs
, 0, stab_size
))
1212 fprintf (stderr
, "%s: Reading %s section of %s failed: %s\n",
1213 program_name
, stabsect_name
, bfd_get_filename (abfd
),
1214 bfd_errmsg (bfd_get_error ()));
1220 if (! bfd_get_section_contents (abfd
, stabstrsect
, (PTR
) strtab
, 0,
1223 fprintf (stderr
, "%s: Reading %s section of %s failed: %s\n",
1224 program_name
, strsect_name
, bfd_get_filename (abfd
),
1225 bfd_errmsg (bfd_get_error ()));
1234 #define SWAP_SYMBOL(symp, abfd) \
1236 (symp)->n_strx = bfd_h_get_32(abfd, \
1237 (unsigned char *)&(symp)->n_strx); \
1238 (symp)->n_desc = bfd_h_get_16 (abfd, \
1239 (unsigned char *)&(symp)->n_desc); \
1240 (symp)->n_value = bfd_h_get_32 (abfd, \
1241 (unsigned char *)&(symp)->n_value); \
1244 /* Print ABFD's stabs section STABSECT_NAME (in `stabs'),
1245 using string table section STRSECT_NAME (in `strtab'). */
1248 print_section_stabs (abfd
, stabsect_name
, strsect_name
)
1250 char *stabsect_name
;
1254 unsigned file_string_table_offset
= 0, next_file_string_table_offset
= 0;
1255 struct internal_nlist
*stabp
= stabs
,
1256 *stabs_end
= (struct internal_nlist
*) (stab_size
+ (char *) stabs
);
1258 printf ("Contents of %s section:\n\n", stabsect_name
);
1259 printf ("Symnum n_type n_othr n_desc n_value n_strx String\n");
1261 /* Loop through all symbols and print them.
1263 We start the index at -1 because there is a dummy symbol on
1264 the front of stabs-in-{coff,elf} sections that supplies sizes. */
1266 for (i
= -1; stabp
< stabs_end
; stabp
++, i
++)
1270 SWAP_SYMBOL (stabp
, abfd
);
1271 printf ("\n%-6d ", i
);
1272 /* Either print the stab name, or, if unnamed, print its number
1273 again (makes consistent formatting for tools like awk). */
1274 name
= bfd_get_stab_name (stabp
->n_type
);
1276 printf ("%-6s", name
);
1277 else if (stabp
->n_type
== N_UNDF
)
1280 printf ("%-6d", stabp
->n_type
);
1281 printf (" %-6d %-6d ", stabp
->n_other
, stabp
->n_desc
);
1282 printf_vma (stabp
->n_value
);
1283 printf (" %-6lu", stabp
->n_strx
);
1285 /* Symbols with type == 0 (N_UNDF) specify the length of the
1286 string table associated with this file. We use that info
1287 to know how to relocate the *next* file's string table indices. */
1289 if (stabp
->n_type
== N_UNDF
)
1291 file_string_table_offset
= next_file_string_table_offset
;
1292 next_file_string_table_offset
+= stabp
->n_value
;
1296 /* Using the (possibly updated) string table offset, print the
1297 string (if any) associated with this symbol. */
1299 if ((stabp
->n_strx
+ file_string_table_offset
) < stabstr_size
)
1300 printf (" %s", &strtab
[stabp
->n_strx
+ file_string_table_offset
]);
1309 dump_section_stabs (abfd
, stabsect_name
, strsect_name
)
1311 char *stabsect_name
;
1316 /* Check for section names for which stabsect_name is a prefix, to
1317 handle .stab0, etc. */
1318 for (s
= abfd
->sections
;
1322 if (strncmp (stabsect_name
, s
->name
, strlen (stabsect_name
)) == 0
1323 && strncmp (strsect_name
, s
->name
, strlen (strsect_name
)) != 0)
1325 if (read_section_stabs (abfd
, s
->name
, strsect_name
))
1327 print_section_stabs (abfd
, s
->name
, strsect_name
);
1336 dump_bfd_header (abfd
)
1341 printf ("architecture: %s, ",
1342 bfd_printable_arch_mach (bfd_get_arch (abfd
),
1343 bfd_get_mach (abfd
)));
1344 printf ("flags 0x%08x:\n", abfd
->flags
);
1346 #define PF(x, y) if (abfd->flags & x) {printf("%s%s", comma, y); comma=", ";}
1347 PF (HAS_RELOC
, "HAS_RELOC");
1348 PF (EXEC_P
, "EXEC_P");
1349 PF (HAS_LINENO
, "HAS_LINENO");
1350 PF (HAS_DEBUG
, "HAS_DEBUG");
1351 PF (HAS_SYMS
, "HAS_SYMS");
1352 PF (HAS_LOCALS
, "HAS_LOCALS");
1353 PF (DYNAMIC
, "DYNAMIC");
1354 PF (WP_TEXT
, "WP_TEXT");
1355 PF (D_PAGED
, "D_PAGED");
1356 PF (BFD_IS_RELAXABLE
, "BFD_IS_RELAXABLE");
1357 printf ("\nstart address 0x");
1358 printf_vma (abfd
->start_address
);
1363 dump_bfd_private_header (abfd
)
1366 bfd_print_private_bfd_data (abfd
, stdout
);
1374 if (!bfd_check_format_matches (abfd
, bfd_object
, &matching
))
1376 bfd_nonfatal (bfd_get_filename (abfd
));
1377 if (bfd_get_error () == bfd_error_file_ambiguously_recognized
)
1379 list_matching_formats (matching
);
1385 printf ("\n%s: file format %s\n", bfd_get_filename (abfd
),
1388 print_arelt_descr (stdout
, abfd
, true);
1389 if (dump_file_header
)
1390 dump_bfd_header (abfd
);
1391 if (dump_private_headers
)
1392 dump_bfd_private_header (abfd
);
1394 if (dump_section_headers
)
1395 dump_headers (abfd
);
1396 if (dump_symtab
|| dump_reloc_info
|| disassemble
|| dump_debugging
)
1398 syms
= slurp_symtab (abfd
);
1400 if (dump_dynamic_symtab
|| dump_dynamic_reloc_info
)
1402 dynsyms
= slurp_dynamic_symtab (abfd
);
1405 dump_symbols (abfd
, false);
1406 if (dump_dynamic_symtab
)
1407 dump_symbols (abfd
, true);
1408 if (dump_stab_section_info
)
1410 if (dump_reloc_info
&& ! disassemble
)
1412 if (dump_dynamic_reloc_info
)
1413 dump_dynamic_relocs (abfd
);
1414 if (dump_section_contents
)
1417 disassemble_data (abfd
);
1422 dhandle
= read_debugging_info (abfd
, syms
, symcount
);
1423 if (dhandle
!= NULL
)
1425 if (! print_debugging_info (stdout
, dhandle
))
1426 fprintf (stderr
, "%s: printing debugging information failed\n",
1427 bfd_get_filename (abfd
));
1443 display_file (filename
, target
)
1447 bfd
*file
, *arfile
= (bfd
*) NULL
;
1449 file
= bfd_openr (filename
, target
);
1452 bfd_nonfatal (filename
);
1456 if (bfd_check_format (file
, bfd_archive
) == true)
1458 bfd
*last_arfile
= NULL
;
1460 printf ("In archive %s:\n", bfd_get_filename (file
));
1463 bfd_set_error (bfd_error_no_error
);
1465 arfile
= bfd_openr_next_archived_file (file
, arfile
);
1468 if (bfd_get_error () != bfd_error_no_more_archived_files
)
1470 bfd_nonfatal (bfd_get_filename (file
));
1475 display_bfd (arfile
);
1477 if (last_arfile
!= NULL
)
1478 bfd_close (last_arfile
);
1479 last_arfile
= arfile
;
1482 if (last_arfile
!= NULL
)
1483 bfd_close (last_arfile
);
1491 /* Actually display the various requested regions */
1499 bfd_size_type datasize
= 0;
1501 bfd_size_type start
, stop
;
1503 for (section
= abfd
->sections
; section
!= NULL
; section
=
1508 if (only
== (char *) NULL
||
1509 strcmp (only
, section
->name
) == 0)
1511 if (section
->flags
& SEC_HAS_CONTENTS
)
1513 printf ("Contents of section %s:\n", section
->name
);
1515 if (bfd_section_size (abfd
, section
) == 0)
1517 data
= (bfd_byte
*) xmalloc ((size_t) bfd_section_size (abfd
, section
));
1518 datasize
= bfd_section_size (abfd
, section
);
1521 bfd_get_section_contents (abfd
, section
, (PTR
) data
, 0, bfd_section_size (abfd
, section
));
1523 if (start_address
== (bfd_vma
) -1
1524 || start_address
< section
->vma
)
1527 start
= start_address
- section
->vma
;
1528 if (stop_address
== (bfd_vma
) -1)
1529 stop
= bfd_section_size (abfd
, section
);
1532 if (stop_address
< section
->vma
)
1535 stop
= stop_address
- section
->vma
;
1536 if (stop
> bfd_section_size (abfd
, section
))
1537 stop
= bfd_section_size (abfd
, section
);
1539 for (i
= start
; i
< stop
; i
+= onaline
)
1543 printf (" %04lx ", (unsigned long int) (i
+ section
->vma
));
1544 for (j
= i
; j
< i
+ onaline
; j
++)
1547 printf ("%02x", (unsigned) (data
[j
]));
1555 for (j
= i
; j
< i
+ onaline
; j
++)
1560 printf ("%c", isprint (data
[j
]) ? data
[j
] : '.');
1570 /* Should perhaps share code and display with nm? */
1572 dump_symbols (abfd
, dynamic
)
1586 printf ("DYNAMIC SYMBOL TABLE:\n");
1594 printf ("SYMBOL TABLE:\n");
1597 for (count
= 0; count
< max
; count
++)
1601 bfd
*cur_bfd
= bfd_asymbol_bfd(*current
);
1604 bfd_print_symbol (cur_bfd
,
1606 *current
, bfd_print_symbol_all
);
1624 for (a
= abfd
->sections
; a
!= (asection
*) NULL
; a
= a
->next
)
1628 if (bfd_is_abs_section (a
))
1630 if (bfd_is_und_section (a
))
1632 if (bfd_is_com_section (a
))
1637 if (strcmp (only
, a
->name
))
1640 else if ((a
->flags
& SEC_RELOC
) == 0)
1643 relsize
= bfd_get_reloc_upper_bound (abfd
, a
);
1645 bfd_fatal (bfd_get_filename (abfd
));
1647 printf ("RELOCATION RECORDS FOR [%s]:", a
->name
);
1651 printf (" (none)\n\n");
1655 relpp
= (arelent
**) xmalloc (relsize
);
1656 relcount
= bfd_canonicalize_reloc (abfd
, a
, relpp
, syms
);
1658 bfd_fatal (bfd_get_filename (abfd
));
1659 else if (relcount
== 0)
1661 printf (" (none)\n\n");
1666 dump_reloc_set (abfd
, relpp
, relcount
);
1675 dump_dynamic_relocs (abfd
)
1682 relsize
= bfd_get_dynamic_reloc_upper_bound (abfd
);
1684 bfd_fatal (bfd_get_filename (abfd
));
1686 printf ("DYNAMIC RELOCATION RECORDS");
1690 printf (" (none)\n\n");
1694 relpp
= (arelent
**) xmalloc (relsize
);
1695 relcount
= bfd_canonicalize_dynamic_reloc (abfd
, relpp
, dynsyms
);
1697 bfd_fatal (bfd_get_filename (abfd
));
1698 else if (relcount
== 0)
1700 printf (" (none)\n\n");
1705 dump_reloc_set (abfd
, relpp
, relcount
);
1713 dump_reloc_set (abfd
, relpp
, relcount
)
1720 /* Get column headers lined up reasonably. */
1726 sprintf_vma (buf
, (bfd_vma
) -1);
1727 width
= strlen (buf
) - 7;
1729 printf ("OFFSET %*s TYPE %*s VALUE \n", width
, "", 12, "");
1732 for (p
= relpp
; relcount
&& *p
!= (arelent
*) NULL
; p
++, relcount
--)
1735 CONST
char *sym_name
;
1736 CONST
char *section_name
;
1738 if (start_address
!= (bfd_vma
) -1
1739 && q
->address
< start_address
)
1741 if (stop_address
!= (bfd_vma
) -1
1742 && q
->address
> stop_address
)
1745 if (q
->sym_ptr_ptr
&& *q
->sym_ptr_ptr
)
1747 sym_name
= (*(q
->sym_ptr_ptr
))->name
;
1748 section_name
= (*(q
->sym_ptr_ptr
))->section
->name
;
1753 section_name
= NULL
;
1757 printf_vma (q
->address
);
1758 printf (" %-16s %s",
1764 if (section_name
== (CONST
char *) NULL
)
1765 section_name
= "*unknown*";
1766 printf_vma (q
->address
);
1767 printf (" %-16s [%s]",
1774 printf_vma (q
->addend
);
1780 /* The length of the longest architecture name + 1. */
1781 #define LONGEST_ARCH sizeof("rs6000:6000")
1788 endian_string (endian
)
1789 enum bfd_endian endian
;
1791 if (endian
== BFD_ENDIAN_BIG
)
1792 return "big endian";
1793 else if (endian
== BFD_ENDIAN_LITTLE
)
1794 return "little endian";
1796 return "endianness unknown";
1799 /* List the targets that BFD is configured to support, each followed
1800 by its endianness and the architectures it supports. */
1803 display_target_list ()
1805 extern char *tmpnam ();
1806 extern bfd_target
*bfd_target_vector
[];
1807 char tmparg
[L_tmpnam
];
1811 dummy_name
= tmpnam (tmparg
);
1812 for (t
= 0; bfd_target_vector
[t
]; t
++)
1814 bfd_target
*p
= bfd_target_vector
[t
];
1815 bfd
*abfd
= bfd_openw (dummy_name
, p
->name
);
1818 printf ("%s\n (header %s, data %s)\n", p
->name
,
1819 endian_string (p
->header_byteorder
),
1820 endian_string (p
->byteorder
));
1824 bfd_nonfatal (dummy_name
);
1828 if (! bfd_set_format (abfd
, bfd_object
))
1830 if (bfd_get_error () != bfd_error_invalid_operation
)
1831 bfd_nonfatal (p
->name
);
1835 for (a
= (int) bfd_arch_obscure
+ 1; a
< (int) bfd_arch_last
; a
++)
1836 if (bfd_set_arch_mach (abfd
, (enum bfd_architecture
) a
, 0))
1838 bfd_printable_arch_mach ((enum bfd_architecture
) a
, 0));
1840 unlink (dummy_name
);
1843 /* Print a table showing which architectures are supported for entries
1844 FIRST through LAST-1 of bfd_target_vector (targets across,
1845 architectures down). */
1848 display_info_table (first
, last
)
1852 extern bfd_target
*bfd_target_vector
[];
1853 extern char *tmpnam ();
1854 char tmparg
[L_tmpnam
];
1858 /* Print heading of target names. */
1859 printf ("\n%*s", (int) LONGEST_ARCH
, " ");
1860 for (t
= first
; t
< last
&& bfd_target_vector
[t
]; t
++)
1861 printf ("%s ", bfd_target_vector
[t
]->name
);
1864 dummy_name
= tmpnam (tmparg
);
1865 for (a
= (int) bfd_arch_obscure
+ 1; a
< (int) bfd_arch_last
; a
++)
1866 if (strcmp (bfd_printable_arch_mach (a
, 0), "UNKNOWN!") != 0)
1868 printf ("%*s ", (int) LONGEST_ARCH
- 1,
1869 bfd_printable_arch_mach (a
, 0));
1870 for (t
= first
; t
< last
&& bfd_target_vector
[t
]; t
++)
1872 bfd_target
*p
= bfd_target_vector
[t
];
1874 bfd
*abfd
= bfd_openw (dummy_name
, p
->name
);
1878 bfd_nonfatal (p
->name
);
1884 if (! bfd_set_format (abfd
, bfd_object
))
1886 if (bfd_get_error () != bfd_error_invalid_operation
)
1887 bfd_nonfatal (p
->name
);
1894 if (! bfd_set_arch_mach (abfd
, a
, 0))
1899 printf ("%s ", p
->name
);
1902 int l
= strlen (p
->name
);
1910 unlink (dummy_name
);
1913 /* Print tables of all the target-architecture combinations that
1914 BFD has been configured to support. */
1917 display_target_tables ()
1920 extern bfd_target
*bfd_target_vector
[];
1922 extern char *getenv ();
1925 colum
= getenv ("COLUMNS");
1927 columns
= atoi (colum
);
1932 while (bfd_target_vector
[t
] != NULL
)
1936 wid
= LONGEST_ARCH
+ strlen (bfd_target_vector
[t
]->name
) + 1;
1938 while (wid
< columns
&& bfd_target_vector
[t
] != NULL
)
1942 newwid
= wid
+ strlen (bfd_target_vector
[t
]->name
) + 1;
1943 if (newwid
>= columns
)
1948 display_info_table (oldt
, t
);
1955 printf ("BFD header file version %s\n", BFD_VERSION
);
1956 display_target_list ();
1957 display_target_tables ();
1966 char *target
= default_target
;
1967 boolean seenflag
= false;
1969 program_name
= *argv
;
1970 xmalloc_set_program_name (program_name
);
1972 START_PROGRESS (program_name
, 0);
1976 while ((c
= getopt_long (argc
, argv
, "pib:m:VdDlfahrRtTxsSj:w", long_options
,
1980 if (c
!= 'l' && c
!= OPTION_START_ADDRESS
&& c
!= OPTION_STOP_ADDRESS
)
1985 break; /* we've been given a long option */
1993 with_line_numbers
= 1;
1999 dump_file_header
= true;
2002 formats_info
= true;
2005 dump_private_headers
= 1;
2008 dump_private_headers
= 1;
2010 dump_reloc_info
= 1;
2011 dump_file_header
= true;
2013 dump_section_headers
= 1;
2019 dump_dynamic_symtab
= 1;
2025 disassemble
= disassemble_all
= true;
2029 with_source_code
= true;
2032 dump_section_contents
= 1;
2035 dump_reloc_info
= 1;
2038 dump_dynamic_reloc_info
= 1;
2044 dump_section_headers
= 1;
2054 case OPTION_START_ADDRESS
:
2055 start_address
= parse_vma (optarg
, "--start-address");
2057 case OPTION_STOP_ADDRESS
:
2058 stop_address
= parse_vma (optarg
, "--stop-address");
2067 printf ("GNU %s version %s\n", program_name
, program_version
);
2071 if (seenflag
== false)
2081 display_file ("a.out", target
);
2083 for (; optind
< argc
;)
2084 display_file (argv
[optind
++], target
);
2087 END_PROGRESS (program_name
);