This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFC] objcopy/objdump targets list


Hi Nick,

On Mon, Mar 24, 2003 at 11:27:51AM +0000, Nick Clifton wrote:
> > Here is a patch that moves all the needed stuff from objdump.c to bucomm.c.
> > If it is approved I'm going to change objcopy to use the 'new' functions.
> 
> I made a couple of small changes:

Thanx. I am attaching the objcopy changes.

Regards,
Elias

ChangeLog

2003-03-24  Elias Athanasopoulos  <elathan at phys dot uoa dot 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.


===================================================================
RCS file: /home/anteater/bucvs/src/binutils/objcopy.c,v
retrieving revision 1.2
diff -u -r1.2 /home/anteater/bucvs/src/binutils/objcopy.c
--- /home/anteater/bucvs/src/binutils/objcopy.c	2003/03/24 12:14:40	1.2
+++ /home/anteater/bucvs/src/binutils/objcopy.c	2003/03/24 15:01:14
@@ -275,6 +275,7 @@
 #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 @@
   {"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 @@
   {"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 @@
   -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 and architectures supported\n\
 "));
   list_supported_targets (program_name, stream);
   if (exit_status == 0)
@@ -488,6 +492,7 @@
   -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 and architectures supported\n\
   -o <file>                        Place stripped output into <file>\n\
 "));
 
@@ -2083,6 +2088,7 @@
 {
   char *input_target = NULL, *output_target = NULL;
   bfd_boolean show_version = FALSE;
+  bfd_boolean formats_info = FALSE;
   int c, i;
   struct section_list *p;
   char *output_file = NULL;
@@ -2141,6 +2147,9 @@
 	case 'V':
 	  show_version = TRUE;
 	  break;
+        case OPTION_FORMATS_INFO:
+          formats_info = TRUE;
+          break;
 	case 0:
 	  /* We've been given a long option.  */
 	  break;
@@ -2155,6 +2164,12 @@
   if (show_version)
     print_version ("strip");
 
+  if (formats_info)
+    {
+      status = display_info ();
+      return 0;
+    }
+  
   /* Default is to strip all symbols.  */
   if (strip_symbols == STRIP_UNDEF
       && discard_locals == LOCALS_UNDEF
@@ -2217,6 +2232,7 @@
   char *input_filename = NULL, *output_filename = NULL;
   char *input_target = NULL, *output_target = NULL;
   bfd_boolean show_version = FALSE;
+  bfd_boolean formats_info = FALSE;
   bfd_boolean change_warn = TRUE;
   int c;
   struct section_list *p;
@@ -2324,7 +2340,11 @@
 	case 'V':
 	  show_version = TRUE;
 	  break;
-
+          
+        case OPTION_FORMATS_INFO:
+          formats_info = TRUE;
+          break;
+          
 	case OPTION_WEAKEN:
 	  weaken = TRUE;
 	  break;
@@ -2662,6 +2682,12 @@
   if (show_version)
     print_version ("objcopy");
 
+  if (formats_info)
+    {
+      status = display_info ();
+      return 0;
+    }
+  
   if (copy_byte >= interleave)
     fatal (_("byte number must be less than interleave"));
 
	
===================================================================
RCS file: /home/anteater/bucvs/src/binutils/doc/binutils.texi,v
retrieving revision 1.2
diff -u -r1.2 /home/anteater/bucvs/src/binutils/doc/binutils.texi
--- /home/anteater/bucvs/src/binutils/doc/binutils.texi	2003/03/24 14:54:09	1.2
+++ /home/anteater/bucvs/src/binutils/doc/binutils.texi	2003/03/24 14:59:42
@@ -1348,6 +1348,9 @@
 
 @item --help
 Show a summary of the options to @command{objcopy}.
+
+ at item --info
+Display a list showing all architectures and object formats available.
 @end table
 
 @c man end
@@ -2079,6 +2082,9 @@
 @item --help
 Show a summary of the options to @command{strip} and exit.
 
+ at item --info
+Display a list showing all architectures and object formats available.
+
 @item -I @var{bfdname}
 @itemx --input-target= at var{bfdname}
 Treat the original @var{objfile} as a file with the object


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]