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 Elf_Internal_Shdr
*bfd_elf_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
;
72 unsigned int symcount
= 0;
74 /* Forward declarations. */
77 display_file
PARAMS ((char *filename
, char *target
));
80 dump_data
PARAMS ((bfd
*abfd
));
83 dump_relocs
PARAMS ((bfd
*abfd
));
86 dump_symbols
PARAMS ((bfd
*abfd
));
92 usage: %s [-ahifdrtxsl] [-m machine] [-j section_name]\n\
93 [--syms] [--reloc] [--header] [--version] obj ...\n",
98 static struct option long_options
[]=
100 {"syms", no_argument
, &dump_symtab
, 1},
101 {"reloc", no_argument
, &dump_reloc_info
, 1},
102 {"header", no_argument
, &dump_section_headers
, 1},
103 {"version", no_argument
, &show_version
, 1},
104 #ifdef ELF_STAB_DISPLAY
105 {"stabs", no_argument
, &dump_stab_section_info
, 1},
107 {0, no_argument
, 0, 0}};
116 for (section
= abfd
->sections
;
117 section
!= (asection
*) NULL
;
118 section
= section
->next
)
123 if (section->flags & x) { printf("%s%s",comma,y); comma = ", "; }
126 printf ("SECTION %d [%s]\t: size %08x",
129 (unsigned) bfd_get_section_size_before_reloc (section
));
131 printf_vma (section
->vma
);
132 printf (" align 2**%u\n ",
133 section
->alignment_power
);
134 PF (SEC_ALLOC
, "ALLOC");
135 PF (SEC_CONSTRUCTOR
, "CONSTRUCTOR");
136 PF (SEC_CONSTRUCTOR_TEXT
, "CONSTRUCTOR TEXT");
137 PF (SEC_CONSTRUCTOR_DATA
, "CONSTRUCTOR DATA");
138 PF (SEC_CONSTRUCTOR_BSS
, "CONSTRUCTOR BSS");
139 PF (SEC_LOAD
, "LOAD");
140 PF (SEC_RELOC
, "RELOC");
141 PF (SEC_BALIGN
, "BALIGN");
142 PF (SEC_READONLY
, "READONLY");
143 PF (SEC_CODE
, "CODE");
144 PF (SEC_DATA
, "DATA");
152 DEFUN (slurp_symtab
, (abfd
),
155 asymbol
**sy
= (asymbol
**) NULL
;
157 if (!(bfd_get_file_flags (abfd
) & HAS_SYMS
))
159 (void) printf ("No symbols in \"%s\".\n", bfd_get_filename (abfd
));
163 storage
= get_symtab_upper_bound (abfd
);
166 sy
= (asymbol
**) malloc (storage
);
169 fprintf (stderr
, "%s: out of memory.\n", program_name
);
173 symcount
= bfd_canonicalize_symtab (abfd
, sy
);
177 /* Sort symbols into value order */
183 asymbol
*a
= *(asymbol
**)ap
;
184 asymbol
*b
= *(asymbol
**)bp
;
188 if (a
->name
== (char *) NULL
|| (a
->flags
& (BSF_DEBUGGING
)))
191 a_bfd
= bfd_asymbol_bfd(a
);
192 if (b
->name
== (char *) NULL
|| (b
->flags
& (BSF_DEBUGGING
)))
195 b_bfd
= bfd_asymbol_bfd(b
);
197 diff
= a_bfd
- b_bfd
;
202 diff
= a
->value
- b
->value
;
207 return a
->section
- b
->section
;
210 /* Print the supplied address symbolically if possible */
212 print_address (vma
, stream
)
216 /* Perform a binary search looking for the closest symbol to
217 the required value */
219 unsigned int min
= 0;
220 unsigned int max
= symcount
;
222 unsigned int thisplace
= 1;
223 unsigned int oldthisplace
;
229 fprintf_vma (stream
, vma
);
235 oldthisplace
= thisplace
;
236 thisplace
= (max
+ min
) / 2;
237 if (thisplace
== oldthisplace
)
239 vardiff
= syms
[thisplace
]->value
- vma
;
242 /* Check that the value isn't merely a coincidence.
243 (if not checked, we might print some undefined symbol
244 for the address 0 rather than "main", for example. */
245 || !(syms
[thisplace
]->flags
& (BSF_GLOBAL
|BSF_LOCAL
)))
258 /* Totally awesome! the exact right symbol */
259 CONST
char *match_name
= syms
[thisplace
]->name
;
260 int sym_len
= strlen (match_name
);
262 /* Avoid "filename.o" as a match */
264 && match_name
[sym_len
- 2] == '.'
265 && match_name
[sym_len
- 1] == 'o'
266 && thisplace
+ 1 < symcount
267 && syms
[thisplace
+ 1]->value
== vma
)
268 match_name
= syms
[thisplace
+ 1]->name
;
269 /* Totally awesome! the exact right symbol */
270 fprintf_vma (stream
, vma
);
271 fprintf (stream
, " (%s+)0000", syms
[thisplace
]->name
);
275 /* We've run out of places to look, print the symbol before this one
276 see if this or the symbol before describes this location the best */
280 if (syms
[thisplace
- 1]->value
- vma
>
281 syms
[thisplace
]->value
- vma
)
283 /* Previous symbol is in correct section and is closer */
288 fprintf_vma (stream
, vma
);
289 if (syms
[thisplace
]->value
> vma
)
291 fprintf (stream
, " (%s-)", syms
[thisplace
]->name
);
292 fprintf (stream
, "%04x", syms
[thisplace
]->value
- vma
);
296 fprintf (stream
, " (%s+)", syms
[thisplace
]->name
);
297 fprintf (stream
, "%04x", vma
- syms
[thisplace
]->value
);
303 disassemble_data (abfd
)
306 bfd_byte
*data
= NULL
;
307 bfd_arch_info_type
*info
;
308 bfd_size_type datasize
= 0;
310 unsigned int (*print
) ()= 0; /* Old style */
311 disassembler_ftype disassemble
= 0; /* New style */
312 unsigned int print_insn_a29k ();
313 unsigned int print_insn_i960 ();
314 unsigned int print_insn_sparc ();
315 unsigned int print_insn_h8300 ();
316 enum bfd_architecture a
;
317 struct disassemble_info disasm_info
;
320 CONST
char *prev_function
= "";
324 /* Replace symbol section relative values with abs values */
325 boolean done_dot
= false;
327 INIT_DISASSEMBLE_INFO(disasm_info
, stdout
);
329 for (i
= 0; i
< symcount
; i
++)
331 syms
[i
]->value
+= syms
[i
]->section
->vma
;
334 /* We keep a copy of the symbols in the original order */
335 syms2
= slurp_symtab (abfd
);
337 /* Sort the symbols into section and symbol order */
338 (void) qsort (syms
, symcount
, sizeof (asymbol
*), comp
);
340 /* Find the first useless symbol */
344 for (i
= 0; i
< symcount
; i
++)
346 if (syms
[i
]->name
== (char *) NULL
347 || (syms
[i
]->flags
& BSF_DEBUGGING
) != 0)
356 if (machine
!= (char *) NULL
)
358 info
= bfd_scan_arch (machine
);
361 fprintf (stderr
, "%s: Can't use supplied machine %s\n",
366 abfd
->arch_info
= info
;
369 /* See if we can disassemble using bfd */
371 if (abfd
->arch_info
->disassemble
)
373 print
= abfd
->arch_info
->disassemble
;
377 a
= bfd_get_arch (abfd
);
381 print
= print_insn_sparc
;
384 if (bfd_get_mach(abfd
) == bfd_mach_z8001
)
385 disassemble
= print_insn_z8001
;
387 disassemble
= print_insn_z8002
;
390 disassemble
= print_insn_i386
;
393 disassemble
= print_insn_h8500
;
396 disassemble
= print_insn_m68k
;
399 print
= print_insn_a29k
;
402 print
= print_insn_i960
;
405 if (abfd
->xvec
->byteorder_big_p
)
406 disassemble
= print_insn_big_mips
;
408 disassemble
= print_insn_little_mips
;
411 fprintf (stderr
, "%s: Can't disassemble for architecture %s\n",
413 bfd_printable_arch_mach (bfd_get_arch (abfd
), 0));
419 for (section
= abfd
->sections
;
420 section
!= (asection
*) NULL
;
421 section
= section
->next
)
424 if ((section
->flags
& SEC_LOAD
)
425 && (only
== (char *) NULL
|| strcmp (only
, section
->name
) == 0))
427 printf ("Disassembly of section %s:\n", section
->name
);
429 if (bfd_get_section_size_before_reloc (section
) == 0)
432 data
= (bfd_byte
*) malloc (bfd_get_section_size_before_reloc (section
));
434 if (data
== (bfd_byte
*) NULL
)
436 fprintf (stderr
, "%s: memory exhausted.\n", program_name
);
439 datasize
= bfd_get_section_size_before_reloc (section
);
441 bfd_get_section_contents (abfd
, section
, data
, 0, bfd_get_section_size_before_reloc (section
));
443 disasm_info
.buffer
= data
;
444 disasm_info
.buffer_vma
= section
->vma
;
445 disasm_info
.buffer_length
=
446 bfd_get_section_size_before_reloc (section
);
448 while (i
< disasm_info
.buffer_length
)
450 if (data
[i
] == 0 && data
[i
+ 1] == 0 && data
[i
+ 2] == 0 &&
453 if (done_dot
== false)
463 if (with_line_numbers
)
465 CONST
char *filename
;
466 CONST
char *functionname
;
469 if (bfd_find_nearest_line (abfd
,
477 if (functionname
&& *functionname
478 && strcmp(functionname
, prev_function
))
480 printf ("%s():\n", functionname
);
481 prev_function
= functionname
;
485 if (line
&& line
!= prevline
)
487 printf ("%s:%u\n", filename
, line
);
492 print_address (section
->vma
+ i
, stdout
);
495 if (disassemble
) /* New style */
497 int bytes
= (*disassemble
)(section
->vma
+ i
,
504 i
+= print (section
->vma
+ i
,
515 #ifdef ELF_STAB_DISPLAY
517 /* Define a table of stab values and print-strings. We wish the initializer
518 could be a direct-mapped table, but instead we build one the first
521 #define STAB_STRING_LENGTH 6
523 char stab_name
[256][STAB_STRING_LENGTH
];
527 char string
[STAB_STRING_LENGTH
];
530 struct stab_print stab_print
[] = {
531 #define __define_stab(NAME, CODE, STRING) {CODE, STRING},
532 #include "aout/stab.def"
537 void dump_elf_stabs_1 ();
539 /* This is a kludge for dumping the stabs section from an ELF file that
540 uses Sun stabs encoding. It has to use some hooks into BFD because
541 string table sections are not normally visible to BFD callers. */
544 dump_elf_stabs (abfd
)
549 /* Initialize stab name array if first time. */
550 if (stab_name
[0][0] == 0)
552 /* Fill in numeric values for all possible strings. */
553 for (i
= 0; i
< 256; i
++)
555 sprintf (stab_name
[i
], "%d", i
);
557 for (i
= 0; stab_print
[i
].string
[0]; i
++)
558 strcpy (stab_name
[stab_print
[i
].value
], stab_print
[i
].string
);
561 if (0 != strncmp ("elf", abfd
->xvec
->name
, 3))
563 fprintf (stderr
, "%s: %s is not in ELF format.\n", program_name
,
568 dump_elf_stabs_1 (abfd
, ".stab", ".stabstr");
569 dump_elf_stabs_1 (abfd
, ".stab.excl", ".stab.exclstr");
570 dump_elf_stabs_1 (abfd
, ".stab.index", ".stab.indexstr");
574 dump_elf_stabs_1 (abfd
, name1
, name2
)
576 char *name1
; /* Section name of .stab */
577 char *name2
; /* Section name of its string section */
579 Elf_Internal_Shdr
*stab_hdr
, *stabstr_hdr
;
581 struct internal_nlist
*stabs
, *stabs_end
;
583 unsigned file_string_table_offset
, next_file_string_table_offset
;
585 stab_hdr
= bfd_elf_find_section (abfd
, name1
);
588 printf ("Contents of %s section: none.\n\n", name1
);
592 stabstr_hdr
= bfd_elf_find_section (abfd
, name2
);
593 if (0 == stabstr_hdr
)
595 fprintf (stderr
, "%s: %s has no %s section.\n", program_name
,
596 abfd
->filename
, name2
);
600 stabs
= (struct internal_nlist
*) xmalloc (stab_hdr
->sh_size
);
601 strtab
= (char *) xmalloc (stabstr_hdr
->sh_size
);
602 stabs_end
= (struct internal_nlist
*) (stab_hdr
->sh_size
+ (char *)stabs
);
604 if (bfd_seek (abfd
, stab_hdr
->sh_offset
, SEEK_SET
) < 0 ||
605 stab_hdr
->sh_size
!= bfd_read ((PTR
)stabs
, stab_hdr
->sh_size
, 1, abfd
))
607 fprintf (stderr
, "%s: reading %s section of %s failed.\n",
613 if (bfd_seek (abfd
, stabstr_hdr
->sh_offset
, SEEK_SET
) < 0 ||
614 stabstr_hdr
->sh_size
!= bfd_read ((PTR
)strtab
, stabstr_hdr
->sh_size
,
617 fprintf (stderr
, "%s: reading %s section of %s failed.\n",
623 #define SWAP_SYMBOL(symp, abfd) \
625 (symp)->n_strx = bfd_h_get_32(abfd, \
626 (unsigned char *)&(symp)->n_strx); \
627 (symp)->n_desc = bfd_h_get_16 (abfd, \
628 (unsigned char *)&(symp)->n_desc); \
629 (symp)->n_value = bfd_h_get_32 (abfd, \
630 (unsigned char *)&(symp)->n_value); \
633 printf ("Contents of %s section:\n\n", name1
);
634 printf ("Symnum n_type n_othr n_desc n_value n_strx String\n");
636 file_string_table_offset
= 0;
637 next_file_string_table_offset
= 0;
639 /* Loop through all symbols and print them.
641 We start the index at -1 because there is a dummy symbol on
642 the front of Sun's stabs-in-elf sections. */
644 for (i
= -1; stabs
< stabs_end
; stabs
++, i
++)
646 SWAP_SYMBOL (stabs
, abfd
);
647 printf ("\n%-6d %-6s %-6d %-6d %08x %-6d", i
,
648 stab_name
[stabs
->n_type
],
649 stabs
->n_other
, stabs
->n_desc
, stabs
->n_value
,
652 /* Symbols with type == 0 (N_UNDF) specify the length of the
653 string table associated with this file. We use that info
654 to know how to relocate the *next* file's string table indices. */
656 if (stabs
->n_type
== N_UNDF
)
658 file_string_table_offset
= next_file_string_table_offset
;
659 next_file_string_table_offset
+= stabs
->n_value
;
662 /* Now, using the possibly updated string table offset, print the
663 string (if any) associated with this symbol. */
665 if ((stabs
->n_strx
+ file_string_table_offset
) < stabstr_hdr
->sh_size
)
666 printf (" %s", &strtab
[stabs
->n_strx
+ file_string_table_offset
]);
672 #endif /* ELF_STAB_DISPLAY */
678 if (!bfd_check_format (abfd
, bfd_object
))
680 fprintf (stderr
, "%s: %s not an object file\n", program_name
,
684 printf ("\n%s: file format %s\n", abfd
->filename
, abfd
->xvec
->name
);
686 print_arelt_descr (stdout
, abfd
, true);
688 if (dump_file_header
)
692 printf ("architecture: %s, ",
693 bfd_printable_arch_mach (bfd_get_arch (abfd
),
694 bfd_get_mach (abfd
)));
695 printf ("flags 0x%08x:\n", abfd
->flags
);
697 #define PF(x, y) if (abfd->flags & x) {printf("%s%s", comma, y); comma=", ";}
698 PF (HAS_RELOC
, "HAS_RELOC");
699 PF (EXEC_P
, "EXEC_P");
700 PF (HAS_LINENO
, "HAS_LINENO");
701 PF (HAS_DEBUG
, "HAS_DEBUG");
702 PF (HAS_SYMS
, "HAS_SYMS");
703 PF (HAS_LOCALS
, "HAS_LOCALS");
704 PF (DYNAMIC
, "DYNAMIC");
705 PF (WP_TEXT
, "WP_TEXT");
706 PF (D_PAGED
, "D_PAGED");
707 PF (BFD_IS_RELAXABLE
, "BFD_IS_RELAXABLE");
708 printf ("\nstart address 0x");
709 printf_vma (abfd
->start_address
);
713 if (dump_section_headers
)
715 if (dump_symtab
|| dump_reloc_info
|| disassemble
)
717 syms
= slurp_symtab (abfd
);
721 #ifdef ELF_STAB_DISPLAY
722 if (dump_stab_section_info
)
723 dump_elf_stabs (abfd
);
727 if (dump_section_contents
)
730 disassemble_data (abfd
);
734 display_file (filename
, target
)
738 bfd
*file
, *arfile
= (bfd
*) NULL
;
740 file
= bfd_openr (filename
, target
);
743 bfd_perror (filename
);
747 if (bfd_check_format (file
, bfd_archive
) == true)
749 printf ("In archive %s:\n", bfd_get_filename (file
));
752 bfd_error
= no_error
;
754 arfile
= bfd_openr_next_archived_file (file
, arfile
);
757 if (bfd_error
!= no_more_archived_files
)
758 bfd_perror (bfd_get_filename (file
));
762 display_bfd (arfile
);
763 /* Don't close the archive elements; we need them for next_archive */
772 /* Actually display the various requested regions */
780 bfd_size_type datasize
= 0;
783 for (section
= abfd
->sections
; section
!= NULL
; section
=
788 if (only
== (char *) NULL
||
789 strcmp (only
, section
->name
) == 0)
791 if (section
->flags
& SEC_HAS_CONTENTS
)
793 printf ("Contents of section %s:\n", section
->name
);
795 if (bfd_get_section_size_before_reloc (section
) == 0)
797 data
= (bfd_byte
*) malloc (bfd_get_section_size_before_reloc (section
));
798 if (data
== (bfd_byte
*) NULL
)
800 fprintf (stderr
, "%s: memory exhausted.\n", program_name
);
803 datasize
= bfd_get_section_size_before_reloc (section
);
806 bfd_get_section_contents (abfd
, section
, (PTR
) data
, 0, bfd_get_section_size_before_reloc (section
));
808 for (i
= 0; i
< bfd_get_section_size_before_reloc (section
); i
+= onaline
)
812 printf (" %04lx ", (unsigned long int) (i
+ section
->vma
));
813 for (j
= i
; j
< i
+ onaline
; j
++)
815 if (j
< bfd_get_section_size_before_reloc (section
))
816 printf ("%02x", (unsigned) (data
[j
]));
824 for (j
= i
; j
< i
+ onaline
; j
++)
826 if (j
>= bfd_get_section_size_before_reloc (section
))
829 printf ("%c", isprint (data
[j
]) ? data
[j
] : '.');
839 /* Should perhaps share code and display with nm? */
846 asymbol
**current
= syms
;
848 printf ("SYMBOL TABLE:\n");
850 for (count
= 0; count
< symcount
; count
++)
855 bfd
*cur_bfd
= bfd_asymbol_bfd(*current
);
858 bfd_print_symbol (cur_bfd
,
860 *current
, bfd_print_symbol_all
);
876 unsigned int relcount
;
879 for (a
= abfd
->sections
; a
!= (asection
*) NULL
; a
= a
->next
)
881 if (a
== &bfd_abs_section
)
883 if (a
== &bfd_und_section
)
885 if (bfd_is_com_section (a
))
888 printf ("RELOCATION RECORDS FOR [%s]:", a
->name
);
890 if (bfd_get_reloc_upper_bound (abfd
, a
) == 0)
892 printf (" (none)\n\n");
898 relpp
= (arelent
**) xmalloc (bfd_get_reloc_upper_bound (abfd
, a
));
899 relcount
= bfd_canonicalize_reloc (abfd
, a
, relpp
, syms
);
902 printf (" (none)\n\n");
907 printf ("OFFSET TYPE VALUE \n");
909 for (p
= relpp
; relcount
&& *p
!= (arelent
*) NULL
; p
++,
913 CONST
char *sym_name
;
915 /* CONST char *section_name = q->section == (asection *)NULL ? "*abs" :*/
916 /* q->section->name;*/
917 CONST
char *section_name
= (*(q
->sym_ptr_ptr
))->section
->name
;
919 if (q
->sym_ptr_ptr
&& *q
->sym_ptr_ptr
)
921 sym_name
= (*(q
->sym_ptr_ptr
))->name
;
929 printf_vma (q
->address
);
936 printf_vma (q
->address
);
937 printf (" %-8s [%s]",
944 printf_vma (q
->addend
);
957 #define _DUMMY_NAME_ "/dev/null"
959 #define _DUMMY_NAME_ "##dummy"
962 DEFUN (display_info_table
, (first
, last
),
963 int first AND
int last
)
966 extern bfd_target
*target_vector
[];
968 printf ("\n%12s", " ");
969 for (i
= first
; i
++ < last
&& target_vector
[i
];)
970 printf ("%s ", target_vector
[i
]->name
);
973 for (j
= (int) bfd_arch_obscure
+ 1; (int) j
< (int) bfd_arch_last
; j
++)
974 if (strcmp (bfd_printable_arch_mach (j
, 0), "UNKNOWN!") != 0)
976 printf ("%11s ", bfd_printable_arch_mach (j
, 0));
977 for (i
= first
; i
++ < last
&& target_vector
[i
];)
979 bfd_target
*p
= target_vector
[i
];
980 bfd
*abfd
= bfd_openw (_DUMMY_NAME_
, p
->name
);
981 int l
= strlen (p
->name
);
983 bfd_set_format (abfd
, bfd_object
);
984 ok
= bfd_set_arch_mach (abfd
, j
, 0);
987 printf ("%s ", p
->name
);
991 printf ("%c", ok
? '*' : '-');
1000 DEFUN_VOID (display_info
)
1003 unsigned int i
, j
, columns
;
1004 extern bfd_target
*target_vector
[];
1005 extern char *getenv ();
1007 printf ("BFD header file version %s\n", BFD_VERSION
);
1008 for (i
= 0; target_vector
[i
]; i
++)
1010 bfd_target
*p
= target_vector
[i
];
1011 bfd
*abfd
= bfd_openw (_DUMMY_NAME_
, p
->name
);
1012 bfd_set_format (abfd
, bfd_object
);
1013 printf ("%s\n (header %s, data %s)\n", p
->name
,
1014 p
->header_byteorder_big_p
? "big endian" : "little endian",
1015 p
->byteorder_big_p
? "big endian" : "little endian");
1016 for (j
= (int) bfd_arch_obscure
+ 1; j
< (int) bfd_arch_last
; j
++)
1017 if (bfd_set_arch_mach (abfd
, (enum bfd_architecture
) j
, 0))
1019 bfd_printable_arch_mach ((enum bfd_architecture
) j
, 0));
1022 if (colum
= getenv ("COLUMNS"))
1023 columns
= atoi (colum
);
1026 for (i
= 0; target_vector
[i
];)
1030 for (j
= 12; target_vector
[i
] && j
< columns
; i
++)
1031 j
+= strlen (target_vector
[i
]->name
) + 1;
1035 display_info_table (old
, i
);
1039 /** main and like trivia */
1047 extern char *optarg
;
1048 char *target
= default_target
;
1049 boolean seenflag
= false;
1053 program_name
= *argv
;
1055 while ((c
= getopt_long (argc
, argv
, "ib:m:Vdlfahrtxsj:", long_options
, &ind
))
1068 with_line_numbers
= 1;
1074 dump_file_header
= true;
1081 dump_reloc_info
= 1;
1082 dump_file_header
= true;
1084 dump_section_headers
= 1;
1087 break; /* we've been given a long option */
1095 dump_section_contents
= 1;
1098 dump_reloc_info
= 1;
1104 dump_section_headers
= 1;
1115 printf ("%s version %s\n", program_name
, program_version
);
1117 if (seenflag
== false)
1127 display_file ("a.out", target
);
1129 for (; optind
< argc
;)
1130 display_file (argv
[optind
++], target
);