diff options
author | Nick Clifton <nickc@redhat.com> | 2003-03-24 16:11:46 +0000 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2003-03-24 16:11:46 +0000 |
commit | 10f48263ffcb713b7282db3349f0551334f7cfa1 (patch) | |
tree | c04d1e7165ebe53a8f72e57cc7b2b4952fd2926c | |
parent | afc01256bcff44ed19d4faf3bbdc5b435717914c (diff) | |
download | binutils-redhat-10f48263ffcb713b7282db3349f0551334f7cfa1.tar.gz |
Add --info command line switch
-rw-r--r-- | binutils/ChangeLog | 12 | ||||
-rw-r--r-- | binutils/NEWS | 2 | ||||
-rw-r--r-- | binutils/doc/binutils.texi | 11 | ||||
-rw-r--r-- | binutils/objcopy.c | 39 |
4 files changed, 57 insertions, 7 deletions
diff --git a/binutils/ChangeLog b/binutils/ChangeLog index e1c79ed8a0..276a3eb387 100644 --- a/binutils/ChangeLog +++ b/binutils/ChangeLog @@ -1,5 +1,17 @@ 2003-03-24 Elias Athanasopoulos <elathan@phys.uoa.gr> + * objcopy (OPTION_FORMATS_INFO): Define. + (strip_options): Add "info"/OPTION_FORMATS_INFO option. + (copy_options): Likewise. + (strip_usage): Add "--info" to usage. + (copy_usage): Likewise. + (strip_main): Declare formats_info. Iniatilize it to FALSE. + Handle "info". + (copy_main). Likewise. + * doc/binutils.texi. Document the "--info" option for + objcopy/strip. + * NEWS: Mention the new command line switch. + * objdump.c (endian_string): Move to bucomm.c. (display_info): Likewise. (display_target_list): Likewise. diff --git a/binutils/NEWS b/binutils/NEWS index d538cb42a7..3730a7b926 100644 --- a/binutils/NEWS +++ b/binutils/NEWS @@ -1,5 +1,7 @@ -*- text -*- +* Added --info switch to objcopy and strip. + * Support for Vitesse IQ2000 added by Red Hat. * Added 'S' encoding to strings to allow the display of 8-bit characters. diff --git a/binutils/doc/binutils.texi b/binutils/doc/binutils.texi index 5c38b84e73..4afcb6d45b 100644 --- a/binutils/doc/binutils.texi +++ b/binutils/doc/binutils.texi @@ -970,7 +970,7 @@ objcopy [@option{-F} @var{bfdname}|@option{--target=}@var{bfdname}] [@option{--prefix-alloc-sections=}@var{string}] [@option{-v}|@option{--verbose}] [@option{-V}|@option{--version}] - [@option{--help}] + [@option{--help}] [@option{--info}] @var{infile} [@var{outfile}] @c man end @end smallexample @@ -1348,6 +1348,9 @@ archives, @samp{objcopy -V} lists all members of the archive. @item --help Show a summary of the options to @command{objcopy}. + +@item --info +Display a list showing all architectures and object formats available. @end table @c man end @@ -2051,7 +2054,8 @@ strip [@option{-F} @var{bfdname} |@option{--target=}@var{bfdname} ] [@option{-x}|@option{--discard-all} ] [@option{-X} |@option{--discard-locals}] [@option{-R} @var{sectionname} |@option{--remove-section=}@var{sectionname} ] [@option{-o} @var{file} ] [@option{-p}|@option{--preserve-dates}] - [@option{-v} |@option{--verbose}] [@option{-V}|@option{--version}] [@option{--help}] + [@option{-v} |@option{--verbose}] [@option{-V}|@option{--version}] + [@option{--help}] [@option{--info}] @var{objfile}@dots{} @c man end @end smallexample @@ -2079,6 +2083,9 @@ code format @var{bfdname}, and rewrite it in the same format. @item --help Show a summary of the options to @command{strip} and exit. +@item --info +Display a list showing all architectures and object formats available. + @item -I @var{bfdname} @itemx --input-target=@var{bfdname} Treat the original @var{objfile} as a file with the object diff --git a/binutils/objcopy.c b/binutils/objcopy.c index f62ed694ee..45072495c1 100644 --- a/binutils/objcopy.c +++ b/binutils/objcopy.c @@ -275,6 +275,7 @@ static char *prefix_alloc_sections_string = 0; #define OPTION_PREFIX_SYMBOLS (OPTION_ALT_MACH_CODE + 1) #define OPTION_PREFIX_SECTIONS (OPTION_PREFIX_SYMBOLS + 1) #define OPTION_PREFIX_ALLOC_SECTIONS (OPTION_PREFIX_SECTIONS + 1) +#define OPTION_FORMATS_INFO (OPTION_PREFIX_ALLOC_SECTIONS + 1) /* Options to handle if running as "strip". */ @@ -284,6 +285,7 @@ static struct option strip_options[] = {"discard-locals", no_argument, 0, 'X'}, {"format", required_argument, 0, 'F'}, /* Obsolete */ {"help", no_argument, 0, 'h'}, + {"info", no_argument, 0, OPTION_FORMATS_INFO}, {"input-format", required_argument, 0, 'I'}, /* Obsolete */ {"input-target", required_argument, 0, 'I'}, {"keep-symbol", required_argument, 0, 'K'}, @@ -327,6 +329,7 @@ static struct option copy_options[] = {"format", required_argument, 0, 'F'}, /* Obsolete */ {"gap-fill", required_argument, 0, OPTION_GAP_FILL}, {"help", no_argument, 0, 'h'}, + {"info", no_argument, 0, OPTION_FORMATS_INFO}, {"input-format", required_argument, 0, 'I'}, /* Obsolete */ {"input-target", required_argument, 0, 'I'}, {"interleave", required_argument, 0, 'i'}, @@ -457,6 +460,7 @@ copy_usage (stream, exit_status) -v --verbose List all object files modified\n\ -V --version Display this program's version number\n\ -h --help Display this output\n\ + --info List object formats & architectures supported\n\ ")); list_supported_targets (program_name, stream); if (exit_status == 0) @@ -488,6 +492,7 @@ strip_usage (stream, exit_status) -v --verbose List all object files modified\n\ -V --version Display this program's version number\n\ -h --help Display this output\n\ + --info List object formats & architectures supported\n\ -o <file> Place stripped output into <file>\n\ ")); @@ -2081,9 +2086,12 @@ strip_main (argc, argv) int argc; char *argv[]; { - char *input_target = NULL, *output_target = NULL; + char *input_target = NULL; + char *output_target = NULL; bfd_boolean show_version = FALSE; - int c, i; + bfd_boolean formats_info = FALSE; + int c; + int i; struct section_list *p; char *output_file = NULL; @@ -2141,6 +2149,9 @@ strip_main (argc, argv) case 'V': show_version = TRUE; break; + case OPTION_FORMATS_INFO: + formats_info = TRUE; + break; case 0: /* We've been given a long option. */ break; @@ -2152,6 +2163,12 @@ strip_main (argc, argv) } } + if (formats_info) + { + display_info (); + return 0; + } + if (show_version) print_version ("strip"); @@ -2214,10 +2231,13 @@ copy_main (argc, argv) char *argv[]; { char * binary_architecture = NULL; - char *input_filename = NULL, *output_filename = NULL; - char *input_target = NULL, *output_target = NULL; + char *input_filename = NULL; + char *output_filename = NULL; + char *input_target = NULL; + char *output_target = NULL; bfd_boolean show_version = FALSE; bfd_boolean change_warn = TRUE; + bfd_boolean formats_info = FALSE; int c; struct section_list *p; struct stat statbuf; @@ -2325,6 +2345,10 @@ copy_main (argc, argv) show_version = TRUE; break; + case OPTION_FORMATS_INFO: + formats_info = TRUE; + break; + case OPTION_WEAKEN: weaken = TRUE; break; @@ -2659,6 +2683,12 @@ copy_main (argc, argv) } } + if (formats_info) + { + display_info (); + return 0; + } + if (show_version) print_version ("objcopy"); @@ -2705,7 +2735,6 @@ copy_main (argc, argv) /* If there is no destination file then create a temp and rename the result into the input. */ - if (output_filename == (char *) NULL) { char *tmpname = make_tempname (input_filename); |