1 /* objdump.c -- dump information about an object file.
2 Copyright 1990, 1991, 1992 Free Software Foundation, Inc.
4 This file is part of BFD, the Binary File Diddler.
6 BFD 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 BFD 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 BFD; see the file COPYING. If not, write to
18 the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
21 * Until there is other documentation, refer to the manual page dump(1) in
22 * the system 5 program's reference manual
32 #define ELF_STAB_DISPLAY /* This code works, but uses internal
33 bfd and elf stuff. Flip this define
34 off if you need to just use generic
37 #ifdef ELF_STAB_DISPLAY
38 /* Internal headers for the ELF .stab-dump code - sorry. */
39 #define BYTES_IN_WORD 32
40 #include "aout/aout64.h"
41 #include "elf/internal.h"
42 extern Elf32_Internal_Shdr
*bfd_elf32_find_section();
43 #endif /* ELF_STAB_DISPLAY */
45 extern char *xmalloc ();
46 extern int fprintf
PARAMS ((FILE *, CONST
char *, ...));
48 char *default_target
= NULL
; /* default at runtime */
50 extern *program_version
;
51 char *program_name
= NULL
;
53 int show_version
= 0; /* show the version number */
54 int dump_section_contents
; /* -s */
55 int dump_section_headers
; /* -h */
56 boolean dump_file_header
; /* -f */
57 int dump_symtab
; /* -t */
58 int dump_reloc_info
; /* -r */
59 int dump_ar_hdrs
; /* -a */
60 int with_line_numbers
; /* -l */
61 int dump_stab_section_info
; /* -stabs */
62 boolean disassemble
; /* -d */
63 boolean info
; /* -i */
66 char *machine
= (char *) NULL
;
71 unsigned int symcount
= 0;
73 /* Forward declarations. */
76 display_file
PARAMS ((char *filename
, char *target
));
79 dump_data
PARAMS ((bfd
*abfd
));
82 dump_relocs
PARAMS ((bfd
*abfd
));
85 dump_symbols
PARAMS ((bfd
*abfd
));
91 Usage: %s [-ahifdrtxsl] [-m machine] [-j section_name] [-b bfdname]\n\
92 [--syms] [--reloc] [--header] [--version] objfile...\n", program_name
);
96 static struct option long_options
[]=
98 {"syms", no_argument
, &dump_symtab
, 1},
99 {"reloc", no_argument
, &dump_reloc_info
, 1},
100 {"header", no_argument
, &dump_section_headers
, 1},
101 {"version", no_argument
, &show_version
, 1},
102 #ifdef ELF_STAB_DISPLAY
103 {"stabs", no_argument
, &dump_stab_section_info
, 1},
105 {0, no_argument
, 0, 0}
115 for (section
= abfd
->sections
;
116 section
!= (asection
*) NULL
;
117 section
= section
->next
)
122 if (section->flags & x) { printf("%s%s",comma,y); comma = ", "; }
125 printf ("SECTION %d [%s]\t: size %08x",
128 (unsigned) bfd_get_section_size_before_reloc (section
));
130 printf_vma (section
->vma
);
131 printf (" align 2**%u\n ",
132 section
->alignment_power
);
133 PF (SEC_ALLOC
, "ALLOC");
134 PF (SEC_CONSTRUCTOR
, "CONSTRUCTOR");
135 PF (SEC_CONSTRUCTOR_TEXT
, "CONSTRUCTOR TEXT");
136 PF (SEC_CONSTRUCTOR_DATA
, "CONSTRUCTOR DATA");
137 PF (SEC_CONSTRUCTOR_BSS
, "CONSTRUCTOR BSS");
138 PF (SEC_LOAD
, "LOAD");
139 PF (SEC_RELOC
, "RELOC");
140 PF (SEC_BALIGN
, "BALIGN");
141 PF (SEC_READONLY
, "READONLY");
142 PF (SEC_CODE
, "CODE");
143 PF (SEC_DATA
, "DATA");
151 DEFUN (slurp_symtab
, (abfd
),
154 asymbol
**sy
= (asymbol
**) NULL
;
156 if (!(bfd_get_file_flags (abfd
) & HAS_SYMS
))
158 (void) printf ("No symbols in \"%s\".\n", bfd_get_filename (abfd
));
162 storage
= get_symtab_upper_bound (abfd
);
165 sy
= (asymbol
**) malloc (storage
);
168 fprintf (stderr
, "%s: out of memory.\n", program_name
);
172 symcount
= bfd_canonicalize_symtab (abfd
, sy
);
175 fprintf (stderr
, "%s: Bad symbol table in \"%s\".\n",
176 program_name
, bfd_get_filename (abfd
));
182 /* Filter out (in place) symbols that are useless for dis-assemble.
183 Return count of useful symbols. */
185 int remove_useless_symbols (syms
, count
)
189 register asymbol
**in_ptr
= syms
;
190 register asymbol
**out_ptr
= syms
;
192 while ( --count
>= 0 )
194 asymbol
*sym
= *in_ptr
++;
196 if (sym
->name
== NULL
|| sym
->name
[0] == '\0')
198 if (sym
->flags
& (BSF_DEBUGGING
))
200 if (sym
->section
== &bfd_und_section
201 || bfd_is_com_section (sym
->section
))
206 return out_ptr
- syms
;
210 /* Sort symbols into value order */
216 asymbol
*a
= *(asymbol
**)ap
;
217 asymbol
*b
= *(asymbol
**)bp
;
219 if (a
->value
> b
->value
)
221 else if (a
->value
< b
->value
)
224 if (a
->section
> b
->section
)
226 else if (a
->section
< b
->section
)
231 /* Print the supplied address symbolically if possible */
233 objdump_print_address (vma
, info
)
235 struct disassemble_info
*info
;
237 /* Perform a binary search looking for the closest symbol to
238 the required value */
240 unsigned int min
= 0;
241 unsigned int max
= symcount
;
243 unsigned int thisplace
= 1;
244 unsigned int oldthisplace
;
248 fprintf_vma (info
->stream
, vma
);
254 asymbol
*sym
; asection
*sym_sec
;
255 oldthisplace
= thisplace
;
256 thisplace
= (max
+ min
) / 2;
257 if (thisplace
== oldthisplace
)
259 sym
= syms
[thisplace
];
260 vardiff
= sym
->value
- vma
;
261 sym_sec
= sym
->section
;
265 else if (vardiff
< 0)
270 /* We've run out of places to look, print the symbol before this one
271 see if this or the symbol before describes this location the best */
275 if (syms
[thisplace
- 1]->value
- vma
>
276 syms
[thisplace
]->value
- vma
)
278 /* Previous symbol is in correct section and is closer */
284 fprintf (info
->stream
, " <%s", syms
[thisplace
]->name
);
285 if (syms
[thisplace
]->value
> vma
)
287 fprintf (info
->stream
, "-%04x", syms
[thisplace
]->value
- vma
);
289 else if (vma
> syms
[thisplace
]->value
)
291 fprintf (info
->stream
, "+%04x", vma
- syms
[thisplace
]->value
);
293 fprintf (info
->stream
, ">");
298 disassemble_data (abfd
)
301 bfd_byte
*data
= NULL
;
302 bfd_arch_info_type
*info
;
303 bfd_size_type datasize
= 0;
305 unsigned int (*print
) ()= 0; /* Old style */
306 disassembler_ftype disassemble
= 0; /* New style */
307 enum bfd_architecture a
;
308 struct disassemble_info disasm_info
;
311 CONST
char *prev_function
= "";
315 /* Replace symbol section relative values with abs values */
316 boolean done_dot
= false;
318 INIT_DISASSEMBLE_INFO(disasm_info
, stdout
);
319 disasm_info
.print_address_func
= objdump_print_address
;
321 for (i
= 0; i
< symcount
; i
++)
323 syms
[i
]->value
+= syms
[i
]->section
->vma
;
326 symcount
= remove_useless_symbols (syms
, symcount
);
328 /* Sort the symbols into section and symbol order */
329 (void) qsort (syms
, symcount
, sizeof (asymbol
*), comp
);
331 if (machine
!= (char *) NULL
)
333 info
= bfd_scan_arch (machine
);
336 fprintf (stderr
, "%s: Can't use supplied machine %s\n",
341 abfd
->arch_info
= info
;
344 /* See if we can disassemble using bfd */
346 if (abfd
->arch_info
->disassemble
)
348 print
= abfd
->arch_info
->disassemble
;
352 a
= bfd_get_arch (abfd
);
356 disassemble
= print_insn_sparc
;
359 if (bfd_get_mach(abfd
) == bfd_mach_z8001
)
360 disassemble
= print_insn_z8001
;
362 disassemble
= print_insn_z8002
;
365 disassemble
= print_insn_i386
;
368 disassemble
= print_insn_h8500
;
371 if (bfd_get_mach(abfd
) == bfd_mach_h8300h
)
372 disassemble
= print_insn_h8300h
;
374 disassemble
= print_insn_h8300
;
377 disassemble
= print_insn_sh
;
380 disassemble
= print_insn_alpha
;
383 disassemble
= print_insn_m68k
;
386 /* As far as I know we only handle big-endian 29k objects. */
387 disassemble
= print_insn_big_a29k
;
390 disassemble
= print_insn_i960
;
393 if (abfd
->xvec
->byteorder_big_p
)
394 disassemble
= print_insn_big_mips
;
396 disassemble
= print_insn_little_mips
;
399 fprintf (stderr
, "%s: Can't disassemble for architecture %s\n",
401 bfd_printable_arch_mach (bfd_get_arch (abfd
), 0));
407 for (section
= abfd
->sections
;
408 section
!= (asection
*) NULL
;
409 section
= section
->next
)
412 if ((section
->flags
& SEC_LOAD
)
413 && (only
== (char *) NULL
|| strcmp (only
, section
->name
) == 0))
415 printf ("Disassembly of section %s:\n", section
->name
);
417 if (bfd_get_section_size_before_reloc (section
) == 0)
420 data
= (bfd_byte
*) malloc (bfd_get_section_size_before_reloc (section
));
422 if (data
== (bfd_byte
*) NULL
)
424 fprintf (stderr
, "%s: memory exhausted.\n", program_name
);
427 datasize
= bfd_get_section_size_before_reloc (section
);
429 bfd_get_section_contents (abfd
, section
, data
, 0, bfd_get_section_size_before_reloc (section
));
431 disasm_info
.buffer
= data
;
432 disasm_info
.buffer_vma
= section
->vma
;
433 disasm_info
.buffer_length
=
434 bfd_get_section_size_before_reloc (section
);
436 while (i
< disasm_info
.buffer_length
)
438 if (data
[i
] == 0 && data
[i
+ 1] == 0 && data
[i
+ 2] == 0 &&
441 if (done_dot
== false)
451 if (with_line_numbers
)
453 CONST
char *filename
;
454 CONST
char *functionname
;
457 if (bfd_find_nearest_line (abfd
,
465 if (functionname
&& *functionname
466 && strcmp(functionname
, prev_function
))
468 printf ("%s():\n", functionname
);
469 prev_function
= functionname
;
473 if (line
&& line
!= prevline
)
475 printf ("%s:%u\n", filename
, line
);
480 objdump_print_address (section
->vma
+ i
, &disasm_info
);
483 if (disassemble
) /* New style */
485 int bytes
= (*disassemble
)(section
->vma
+ i
,
492 i
+= print (section
->vma
+ i
,
503 #ifdef ELF_STAB_DISPLAY
505 /* Define a table of stab values and print-strings. We wish the initializer
506 could be a direct-mapped table, but instead we build one the first
509 #define STAB_STRING_LENGTH 6
511 char stab_name
[256][STAB_STRING_LENGTH
];
515 char string
[STAB_STRING_LENGTH
];
518 struct stab_print stab_print
[] = {
519 #define __define_stab(NAME, CODE, STRING) {CODE, STRING},
520 #include "aout/stab.def"
525 void dump_elf_stabs_1 ();
527 /* This is a kludge for dumping the stabs section from an ELF file that
528 uses Sun stabs encoding. It has to use some hooks into BFD because
529 string table sections are not normally visible to BFD callers. */
532 dump_elf_stabs (abfd
)
537 /* Initialize stab name array if first time. */
538 if (stab_name
[0][0] == 0)
540 /* Fill in numeric values for all possible strings. */
541 for (i
= 0; i
< 256; i
++)
543 sprintf (stab_name
[i
], "%d", i
);
545 for (i
= 0; stab_print
[i
].string
[0]; i
++)
546 strcpy (stab_name
[stab_print
[i
].value
], stab_print
[i
].string
);
549 if (0 != strncmp ("elf", abfd
->xvec
->name
, 3))
551 fprintf (stderr
, "%s: %s is not in ELF format.\n", program_name
,
556 dump_elf_stabs_1 (abfd
, ".stab", ".stabstr");
557 dump_elf_stabs_1 (abfd
, ".stab.excl", ".stab.exclstr");
558 dump_elf_stabs_1 (abfd
, ".stab.index", ".stab.indexstr");
562 dump_elf_stabs_1 (abfd
, name1
, name2
)
564 char *name1
; /* Section name of .stab */
565 char *name2
; /* Section name of its string section */
567 Elf32_Internal_Shdr
*stab_hdr
, *stabstr_hdr
;
569 struct internal_nlist
*stabs
, *stabs_end
;
571 unsigned file_string_table_offset
, next_file_string_table_offset
;
573 stab_hdr
= bfd_elf32_find_section (abfd
, name1
);
576 printf ("Contents of %s section: none.\n\n", name1
);
580 stabstr_hdr
= bfd_elf32_find_section (abfd
, name2
);
581 if (0 == stabstr_hdr
)
583 fprintf (stderr
, "%s: %s has no %s section.\n", program_name
,
584 abfd
->filename
, name2
);
588 stabs
= (struct internal_nlist
*) xmalloc (stab_hdr
->sh_size
);
589 strtab
= (char *) xmalloc (stabstr_hdr
->sh_size
);
590 stabs_end
= (struct internal_nlist
*) (stab_hdr
->sh_size
+ (char *)stabs
);
592 if (bfd_seek (abfd
, stab_hdr
->sh_offset
, SEEK_SET
) < 0 ||
593 stab_hdr
->sh_size
!= bfd_read ((PTR
)stabs
, stab_hdr
->sh_size
, 1, abfd
))
595 fprintf (stderr
, "%s: reading %s section of %s failed.\n",
601 if (bfd_seek (abfd
, stabstr_hdr
->sh_offset
, SEEK_SET
) < 0 ||
602 stabstr_hdr
->sh_size
!= bfd_read ((PTR
)strtab
, stabstr_hdr
->sh_size
,
605 fprintf (stderr
, "%s: reading %s section of %s failed.\n",
611 #define SWAP_SYMBOL(symp, abfd) \
613 (symp)->n_strx = bfd_h_get_32(abfd, \
614 (unsigned char *)&(symp)->n_strx); \
615 (symp)->n_desc = bfd_h_get_16 (abfd, \
616 (unsigned char *)&(symp)->n_desc); \
617 (symp)->n_value = bfd_h_get_32 (abfd, \
618 (unsigned char *)&(symp)->n_value); \
621 printf ("Contents of %s section:\n\n", name1
);
622 printf ("Symnum n_type n_othr n_desc n_value n_strx String\n");
624 file_string_table_offset
= 0;
625 next_file_string_table_offset
= 0;
627 /* Loop through all symbols and print them.
629 We start the index at -1 because there is a dummy symbol on
630 the front of Sun's stabs-in-elf sections. */
632 for (i
= -1; stabs
< stabs_end
; stabs
++, i
++)
634 SWAP_SYMBOL (stabs
, abfd
);
635 printf ("\n%-6d %-6s %-6d %-6d %08x %-6d", i
,
636 stab_name
[stabs
->n_type
],
637 stabs
->n_other
, stabs
->n_desc
, stabs
->n_value
,
640 /* Symbols with type == 0 (N_UNDF) specify the length of the
641 string table associated with this file. We use that info
642 to know how to relocate the *next* file's string table indices. */
644 if (stabs
->n_type
== N_UNDF
)
646 file_string_table_offset
= next_file_string_table_offset
;
647 next_file_string_table_offset
+= stabs
->n_value
;
650 /* Now, using the possibly updated string table offset, print the
651 string (if any) associated with this symbol. */
653 if ((stabs
->n_strx
+ file_string_table_offset
) < stabstr_hdr
->sh_size
)
654 printf (" %s", &strtab
[stabs
->n_strx
+ file_string_table_offset
]);
660 #endif /* ELF_STAB_DISPLAY */
666 if (!bfd_check_format (abfd
, bfd_object
))
668 fprintf (stderr
, "%s: %s not an object file\n", program_name
,
672 printf ("\n%s: file format %s\n", abfd
->filename
, abfd
->xvec
->name
);
674 print_arelt_descr (stdout
, abfd
, true);
676 if (dump_file_header
)
680 printf ("architecture: %s, ",
681 bfd_printable_arch_mach (bfd_get_arch (abfd
),
682 bfd_get_mach (abfd
)));
683 printf ("flags 0x%08x:\n", abfd
->flags
);
685 #define PF(x, y) if (abfd->flags & x) {printf("%s%s", comma, y); comma=", ";}
686 PF (HAS_RELOC
, "HAS_RELOC");
687 PF (EXEC_P
, "EXEC_P");
688 PF (HAS_LINENO
, "HAS_LINENO");
689 PF (HAS_DEBUG
, "HAS_DEBUG");
690 PF (HAS_SYMS
, "HAS_SYMS");
691 PF (HAS_LOCALS
, "HAS_LOCALS");
692 PF (DYNAMIC
, "DYNAMIC");
693 PF (WP_TEXT
, "WP_TEXT");
694 PF (D_PAGED
, "D_PAGED");
695 PF (BFD_IS_RELAXABLE
, "BFD_IS_RELAXABLE");
696 printf ("\nstart address 0x");
697 printf_vma (abfd
->start_address
);
701 if (dump_section_headers
)
703 if (dump_symtab
|| dump_reloc_info
|| disassemble
)
705 syms
= slurp_symtab (abfd
);
709 #ifdef ELF_STAB_DISPLAY
710 if (dump_stab_section_info
)
711 dump_elf_stabs (abfd
);
715 if (dump_section_contents
)
717 /* Note that disassemble_data re-orders the syms table, but that is
718 safe - as long as it is done last! */
720 disassemble_data (abfd
);
724 display_file (filename
, target
)
728 bfd
*file
, *arfile
= (bfd
*) NULL
;
730 file
= bfd_openr (filename
, target
);
733 fprintf (stderr
, "%s: ", program_name
);
734 bfd_perror (filename
);
738 if (bfd_check_format (file
, bfd_archive
) == true)
740 printf ("In archive %s:\n", bfd_get_filename (file
));
743 bfd_error
= no_error
;
745 arfile
= bfd_openr_next_archived_file (file
, arfile
);
748 if (bfd_error
!= no_more_archived_files
)
750 fprintf (stderr
, "%s: ", program_name
);
751 bfd_perror (bfd_get_filename (file
));
756 display_bfd (arfile
);
757 /* Don't close the archive elements; we need them for next_archive */
766 /* Actually display the various requested regions */
774 bfd_size_type datasize
= 0;
777 for (section
= abfd
->sections
; section
!= NULL
; section
=
782 if (only
== (char *) NULL
||
783 strcmp (only
, section
->name
) == 0)
785 if (section
->flags
& SEC_HAS_CONTENTS
)
787 printf ("Contents of section %s:\n", section
->name
);
789 if (bfd_get_section_size_before_reloc (section
) == 0)
791 data
= (bfd_byte
*) malloc (bfd_get_section_size_before_reloc (section
));
792 if (data
== (bfd_byte
*) NULL
)
794 fprintf (stderr
, "%s: memory exhausted.\n", program_name
);
797 datasize
= bfd_get_section_size_before_reloc (section
);
800 bfd_get_section_contents (abfd
, section
, (PTR
) data
, 0, bfd_get_section_size_before_reloc (section
));
802 for (i
= 0; i
< bfd_get_section_size_before_reloc (section
); i
+= onaline
)
806 printf (" %04lx ", (unsigned long int) (i
+ section
->vma
));
807 for (j
= i
; j
< i
+ onaline
; j
++)
809 if (j
< bfd_get_section_size_before_reloc (section
))
810 printf ("%02x", (unsigned) (data
[j
]));
818 for (j
= i
; j
< i
+ onaline
; j
++)
820 if (j
>= bfd_get_section_size_before_reloc (section
))
823 printf ("%c", isprint (data
[j
]) ? data
[j
] : '.');
833 /* Should perhaps share code and display with nm? */
840 asymbol
**current
= syms
;
842 printf ("SYMBOL TABLE:\n");
844 for (count
= 0; count
< symcount
; count
++)
849 bfd
*cur_bfd
= bfd_asymbol_bfd(*current
);
852 bfd_print_symbol (cur_bfd
,
854 *current
, bfd_print_symbol_all
);
870 unsigned int relcount
;
873 for (a
= abfd
->sections
; a
!= (asection
*) NULL
; a
= a
->next
)
875 if (a
== &bfd_abs_section
)
877 if (a
== &bfd_und_section
)
879 if (bfd_is_com_section (a
))
882 printf ("RELOCATION RECORDS FOR [%s]:", a
->name
);
884 if (bfd_get_reloc_upper_bound (abfd
, a
) == 0)
886 printf (" (none)\n\n");
892 relpp
= (arelent
**) xmalloc (bfd_get_reloc_upper_bound (abfd
, a
));
893 /* Note that this must be done *before* we sort the syms table. */
894 relcount
= bfd_canonicalize_reloc (abfd
, a
, relpp
, syms
);
897 printf (" (none)\n\n");
902 printf ("OFFSET TYPE VALUE \n");
904 for (p
= relpp
; relcount
&& *p
!= (arelent
*) NULL
; p
++,
908 CONST
char *sym_name
;
910 /* CONST char *section_name = q->section == (asection *)NULL ? "*abs" :*/
911 /* q->section->name;*/
912 CONST
char *section_name
= (*(q
->sym_ptr_ptr
))->section
->name
;
914 if (q
->sym_ptr_ptr
&& *q
->sym_ptr_ptr
)
916 sym_name
= (*(q
->sym_ptr_ptr
))->name
;
924 printf_vma (q
->address
);
931 printf_vma (q
->address
);
932 printf (" %-8s [%s]",
939 printf_vma (q
->addend
);
952 #define _DUMMY_NAME_ "/dev/null"
954 #define _DUMMY_NAME_ "##dummy"
957 DEFUN (display_info_table
, (first
, last
),
958 int first AND
int last
)
961 extern bfd_target
*target_vector
[];
963 printf ("\n%12s", " ");
964 for (i
= first
; i
++ < last
&& target_vector
[i
];)
965 printf ("%s ", target_vector
[i
]->name
);
968 for (j
= (int) bfd_arch_obscure
+ 1; (int) j
< (int) bfd_arch_last
; j
++)
969 if (strcmp (bfd_printable_arch_mach (j
, 0), "UNKNOWN!") != 0)
971 printf ("%11s ", bfd_printable_arch_mach (j
, 0));
972 for (i
= first
; i
++ < last
&& target_vector
[i
];)
974 bfd_target
*p
= target_vector
[i
];
975 bfd
*abfd
= bfd_openw (_DUMMY_NAME_
, p
->name
);
976 int l
= strlen (p
->name
);
978 bfd_set_format (abfd
, bfd_object
);
979 ok
= bfd_set_arch_mach (abfd
, j
, 0);
982 printf ("%s ", p
->name
);
986 printf ("%c", ok
? '*' : '-');
995 DEFUN_VOID (display_info
)
998 unsigned int i
, j
, columns
;
999 extern bfd_target
*target_vector
[];
1000 extern char *getenv ();
1002 printf ("BFD header file version %s\n", BFD_VERSION
);
1003 for (i
= 0; target_vector
[i
]; i
++)
1005 bfd_target
*p
= target_vector
[i
];
1006 bfd
*abfd
= bfd_openw (_DUMMY_NAME_
, p
->name
);
1007 bfd_set_format (abfd
, bfd_object
);
1008 printf ("%s\n (header %s, data %s)\n", p
->name
,
1009 p
->header_byteorder_big_p
? "big endian" : "little endian",
1010 p
->byteorder_big_p
? "big endian" : "little endian");
1011 for (j
= (int) bfd_arch_obscure
+ 1; j
< (int) bfd_arch_last
; j
++)
1012 if (bfd_set_arch_mach (abfd
, (enum bfd_architecture
) j
, 0))
1014 bfd_printable_arch_mach ((enum bfd_architecture
) j
, 0));
1017 if (colum
= getenv ("COLUMNS"))
1018 columns
= atoi (colum
);
1021 for (i
= 0; target_vector
[i
];)
1025 for (j
= 12; target_vector
[i
] && j
< columns
; i
++)
1026 j
+= strlen (target_vector
[i
]->name
) + 1;
1030 display_info_table (old
, i
);
1034 /** main and like trivia */
1042 extern char *optarg
;
1043 char *target
= default_target
;
1044 boolean seenflag
= false;
1047 program_name
= *argv
;
1049 while ((c
= getopt_long (argc
, argv
, "ib:m:Vdlfahrtxsj:", long_options
,
1063 with_line_numbers
= 1;
1069 dump_file_header
= true;
1076 dump_reloc_info
= 1;
1077 dump_file_header
= true;
1079 dump_section_headers
= 1;
1082 break; /* we've been given a long option */
1090 dump_section_contents
= 1;
1093 dump_reloc_info
= 1;
1099 dump_section_headers
= 1;
1110 printf ("%s version %s\n", program_name
, program_version
);
1112 if (seenflag
== false)
1122 display_file ("a.out", target
);
1124 for (; optind
< argc
;)
1125 display_file (argv
[optind
++], target
);