aboutsummaryrefslogtreecommitdiff
path: root/binutils
diff options
context:
space:
mode:
authorSteve Chamberlain <steve@cygnus>1991-04-23 16:02:09 +0000
committerSteve Chamberlain <steve@cygnus>1991-04-23 16:02:09 +0000
commit9872a49c27a0cced505d4d94d543c7d0b647186e (patch)
treef656c6bd7a6bc9bd72abeabc8a1124ba72d4675f /binutils
parenta37cc0c05c5ee0e72a14a09c547555621371ef1d (diff)
downloadfsf-binutils-gdb-9872a49c27a0cced505d4d94d543c7d0b647186e.zip
fsf-binutils-gdb-9872a49c27a0cced505d4d94d543c7d0b647186e.tar.gz
fsf-binutils-gdb-9872a49c27a0cced505d4d94d543c7d0b647186e.tar.bz2
*** empty log message ***
Diffstat (limited to 'binutils')
-rw-r--r--binutils/ar.c4
-rw-r--r--binutils/objdump.c71
2 files changed, 71 insertions, 4 deletions
diff --git a/binutils/ar.c b/binutils/ar.c
index ab01510..0011dd3 100644
--- a/binutils/ar.c
+++ b/binutils/ar.c
@@ -540,7 +540,7 @@ extract_file(abfd)
/* This is ugly! XXX */
-PROTO(struct ar_hdr *, bfd_special_undocumented_glue, (char *filename));
+PROTO(struct ar_hdr *, bfd_special_undocumented_glue, (bfd *abfd, char *filename));
void
do_quick_append(archive_filename, files_to_append)
@@ -598,7 +598,7 @@ do_quick_append(archive_filename, files_to_append)
fseek(ofile, 0, 2);
for (; files_to_append && *files_to_append; ++files_to_append) {
- struct ar_hdr *hdr = bfd_special_undocumented_glue(*files_to_append);
+ struct ar_hdr *hdr = bfd_special_undocumented_glue(temp, *files_to_append);
if (hdr == NULL) {
bfd_perror(*files_to_append);
exit(1);
diff --git a/binutils/objdump.c b/binutils/objdump.c
index 4f764bd..eae1860 100644
--- a/binutils/objdump.c
+++ b/binutils/objdump.c
@@ -48,6 +48,7 @@ int dump_reloc_info; /* -r */
int dump_ar_hdrs; /* -a */
int with_line_numbers; /* -l */
boolean disassemble; /* -d */
+boolean info; /* -i */
char *only;
PROTO (void, display_file, (char *filename, char *target));
@@ -75,7 +76,7 @@ void
usage ()
{
fprintf (stderr,
- "usage: %s [-ahfdrtxsl] [-m machine] [-j section_name] obj ...\n",
+ "usage: %s [-ahifdrtxsl] [-m machine] [-j section_name] obj ...\n",
program_name);
exit (1);
}
@@ -597,7 +598,65 @@ bfd *abfd;
}
}
+static void
+DEFUN_VOID(display_info)
+{
+ unsigned int i;
+ extern bfd_target *target_vector[];
+
+ enum bfd_architecture j;
+ i = 0;
+ printf("BFD header file version %s\n", BFD_VERSION);
+ while (target_vector[i] != (bfd_target *)NULL)
+ {
+ bfd_target *p = target_vector[i];
+ bfd *abfd = bfd_openw("##dummy",p->name);
+ printf("%s\n (header %s, data %s)\n", p->name,
+ p->header_byteorder_big_p ? "big endian" : "little endian",
+ p->byteorder_big_p ? "big endian" : "little endian" );
+ {
+ enum bfd_architecture j;
+ for (j = bfd_arch_obscure +1; j < bfd_arch_last; j++)
+ {
+ if (bfd_set_arch_mach(abfd, j, 0))
+ {
+ printf(" %s\n", bfd_printable_arch_mach(j,0));
+ }
+ }
+ }
+ i++;
+ }
+ /* Again as a table */
+ printf("%12s"," ");
+ for (i = 0; target_vector[i]; i++) {
+ printf("%s ",target_vector[i]->name);
+ }
+ printf("\n");
+ for (j = bfd_arch_obscure +1; j < bfd_arch_last; j++) {
+ printf("%11s ", bfd_printable_arch_mach(j,0));
+ for (i = 0; target_vector[i]; i++) {
+ {
+ bfd_target *p = target_vector[i];
+ bfd *abfd = bfd_openw("##dummy",p->name);
+ int l = strlen(p->name);
+ int ok = bfd_set_arch_mach(abfd, j, 0);
+ if (ok) {
+ printf("%s ", p->name);
+ }
+ else {
+ while (l--) {
+ printf("%c",ok?'*':'-');
+ }
+ printf(" ");
+ }
+
+ }
+ }
+
+ printf("\n");
+ }
+}
/** main and like trivia */
int
main (argc, argv)
@@ -613,7 +672,7 @@ main (argc, argv)
program_name = *argv;
- while ((c = getopt_long (argc, argv, "b:m:dlfahrtxsj:", long_options, &ind))
+ while ((c = getopt_long (argc, argv, "ib:m:dlfahrtxsj:", long_options, &ind))
!= EOF) {
seenflag = true;
switch (c) {
@@ -632,6 +691,9 @@ main (argc, argv)
case 'f':
dump_file_header = true;
break;
+ case 'i':
+ info = true;
+ break;
case 'x':
dump_symtab = 1;
dump_reloc_info = 1;
@@ -654,10 +716,15 @@ main (argc, argv)
if (seenflag == false)
usage ();
+ if (info) {
+ display_info();
+ }
+ else {
if (optind == argc)
display_file ("a.out", target);
else
for (; optind < argc;)
display_file (argv[optind++], target);
+}
return 0;
}