public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [RFC] objcopy/objdump targets list
@ 2003-03-14 17:22 Elias Athanasopoulos
  2003-03-17 11:30 ` Nick Clifton
  0 siblings, 1 reply; 6+ messages in thread
From: Elias Athanasopoulos @ 2003-03-14 17:22 UTC (permalink / raw)
  To: binutils

Hello!

objdump has a very nice and handy -i option to list all the supported
targets. I propose to move this code (display_targets_table, etc) in 
bucomm.c and make objcopy use it, too.

In bucomm.c there is already code to dump the supported targets, but it
is not so handy. If my proposal is approved we can kill this code or 
leave it as a "not so verbose target listing" for objdump/objcopy. 
objdump uses already this code when it is used with the --help switch.

Comments?

Elias

-- 
University of Athens			I bet the human brain 
Physics Department				is a kludge --Marvin Minsky 

	

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [RFC] objcopy/objdump targets list
  2003-03-14 17:22 [RFC] objcopy/objdump targets list Elias Athanasopoulos
@ 2003-03-17 11:30 ` Nick Clifton
  2003-03-24 14:40   ` Elias Athanasopoulos
  0 siblings, 1 reply; 6+ messages in thread
From: Nick Clifton @ 2003-03-17 11:30 UTC (permalink / raw)
  To: Elias Athanasopoulos; +Cc: binutils

Hi Elias,

> objdump has a very nice and handy -i option to list all the
> supported targets. I propose to move this code
> (display_targets_table, etc) in bucomm.c and make objcopy use it,
> too.

This would be OK.  It might also be an idea to tidy up the formatting
slightly, so that for example, there is only one line displayed per
target, and the list of architecture variants is labelled as such.

> In bucomm.c there is already code to dump the supported targets, but
> it is not so handy. If my proposal is approved we can kill this code
> or leave it as a "not so verbose target listing" for
> objdump/objcopy.

I believe that we should leave this code in, and leave it attached to
the --help switch.


Cheers
        Nick

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [RFC] objcopy/objdump targets list
  2003-03-17 11:30 ` Nick Clifton
@ 2003-03-24 14:40   ` Elias Athanasopoulos
  2003-03-24 16:12     ` Nick Clifton
  0 siblings, 1 reply; 6+ messages in thread
From: Elias Athanasopoulos @ 2003-03-24 14:40 UTC (permalink / raw)
  To: Nick Clifton; +Cc: binutils

On Mon, Mar 17, 2003 at 11:30:33AM +0000, Nick Clifton wrote:
> Hi Elias,
> 
> > objdump has a very nice and handy -i option to list all the
> > supported targets. I propose to move this code
> > (display_targets_table, etc) in bucomm.c and make objcopy use it,
> > too.
> 
> This would be OK.  It might also be an idea to tidy up the formatting

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.

Regards,
Elias

ChangeLog

2003-03-24  Elias Athanasopoulos  <elathan@phys.uoa.gr>

	* objdump.c (endian_string): Move to bucomm.c.
	(display_info): Likewise.
	(display_target_list): Likewise.
	(display_info_table): Likewise.
	(display_target_tables): Likewise.
	(main): Assign the return value of display_info to exit_status.

	* bucomm.c: Include bfdver.h
	(display_target_list): Call bfd_nonfatal instead of nonfatal and
	return 0 on a non-fatal errror, 1 on success.
	(display_info_table): Likewise.
	
	* bucomm.h (endian_string): Define. Make it non-static.
	(display_info): Define. Change prototype so as to return int, 
	instead of static void.
	(display_target_list): Likewise.
	(display_info_table): Likewise.
	(display_target_tables): Likewise.


===================================================================
RCS file: /home/anteater/bucvs/src/binutils/objdump.c,v
retrieving revision 1.2
diff -u -r1.2 /home/anteater/bucvs/src/binutils/objdump.c
--- /home/anteater/bucvs/src/binutils/objdump.c	2003/03/20 16:20:39	1.2
+++ /home/anteater/bucvs/src/binutils/objdump.c	2003/03/24 07:54:15
@@ -146,14 +146,6 @@
   PARAMS ((bfd *));
 static void display_bfd
   PARAMS ((bfd *abfd));
-static void display_target_list
-  PARAMS ((void));
-static void display_info_table
-  PARAMS ((int, int));
-static void display_target_tables
-  PARAMS ((void));
-static void display_info
-  PARAMS ((void));
 static void objdump_print_value
   PARAMS ((bfd_vma, struct disassemble_info *, bfd_boolean));
 static void objdump_print_symname
@@ -176,8 +168,6 @@
 	   bfd_byte *, bfd_vma, bfd_vma, arelent ***, arelent **));
 static void disassemble_data
   PARAMS ((bfd *));
-static const char *endian_string
-  PARAMS ((enum bfd_endian));
 static asymbol ** slurp_symtab
   PARAMS ((bfd *));
 static asymbol ** slurp_dynamic_symtab
@@ -2570,183 +2560,6 @@
       printf ("\n");
     }
 }
-\f
-/* The length of the longest architecture name + 1.  */
-#define LONGEST_ARCH sizeof("powerpc:common")
-
-static const char *
-endian_string (endian)
-     enum bfd_endian endian;
-{
-  if (endian == BFD_ENDIAN_BIG)
-    return "big endian";
-  else if (endian == BFD_ENDIAN_LITTLE)
-    return "little endian";
-  else
-    return "endianness unknown";
-}
-
-/* List the targets that BFD is configured to support, each followed
-   by its endianness and the architectures it supports.  */
-
-static void
-display_target_list ()
-{
-  extern const bfd_target *const *bfd_target_vector;
-  char *dummy_name;
-  int t;
-
-  dummy_name = make_temp_file (NULL);
-  for (t = 0; bfd_target_vector[t]; t++)
-    {
-      const bfd_target *p = bfd_target_vector[t];
-      bfd *abfd = bfd_openw (dummy_name, p->name);
-      int a;
-
-      printf ("%s\n (header %s, data %s)\n", p->name,
-	      endian_string (p->header_byteorder),
-	      endian_string (p->byteorder));
-
-      if (abfd == NULL)
-	{
-	  nonfatal (dummy_name);
-	  continue;
-	}
-
-      if (! bfd_set_format (abfd, bfd_object))
-	{
-	  if (bfd_get_error () != bfd_error_invalid_operation)
-	    nonfatal (p->name);
-	  bfd_close_all_done (abfd);
-	  continue;
-	}
-
-      for (a = (int) bfd_arch_obscure + 1; a < (int) bfd_arch_last; a++)
-	if (bfd_set_arch_mach (abfd, (enum bfd_architecture) a, 0))
-	  printf ("  %s\n",
-		  bfd_printable_arch_mach ((enum bfd_architecture) a, 0));
-      bfd_close_all_done (abfd);
-    }
-  unlink (dummy_name);
-  free (dummy_name);
-}
-
-/* Print a table showing which architectures are supported for entries
-   FIRST through LAST-1 of bfd_target_vector (targets across,
-   architectures down).  */
-
-static void
-display_info_table (first, last)
-     int first;
-     int last;
-{
-  extern const bfd_target *const *bfd_target_vector;
-  int t, a;
-  char *dummy_name;
-
-  /* Print heading of target names.  */
-  printf ("\n%*s", (int) LONGEST_ARCH, " ");
-  for (t = first; t < last && bfd_target_vector[t]; t++)
-    printf ("%s ", bfd_target_vector[t]->name);
-  putchar ('\n');
-
-  dummy_name = make_temp_file (NULL);
-  for (a = (int) bfd_arch_obscure + 1; a < (int) bfd_arch_last; a++)
-    if (strcmp (bfd_printable_arch_mach (a, 0), "UNKNOWN!") != 0)
-      {
-	printf ("%*s ", (int) LONGEST_ARCH - 1,
-		bfd_printable_arch_mach (a, 0));
-	for (t = first; t < last && bfd_target_vector[t]; t++)
-	  {
-	    const bfd_target *p = bfd_target_vector[t];
-	    bfd_boolean ok = TRUE;
-	    bfd *abfd = bfd_openw (dummy_name, p->name);
-
-	    if (abfd == NULL)
-	      {
-		nonfatal (p->name);
-		ok = FALSE;
-	      }
-
-	    if (ok)
-	      {
-		if (! bfd_set_format (abfd, bfd_object))
-		  {
-		    if (bfd_get_error () != bfd_error_invalid_operation)
-		      nonfatal (p->name);
-		    ok = FALSE;
-		  }
-	      }
-
-	    if (ok)
-	      {
-		if (! bfd_set_arch_mach (abfd, a, 0))
-		  ok = FALSE;
-	      }
-
-	    if (ok)
-	      printf ("%s ", p->name);
-	    else
-	      {
-		int l = strlen (p->name);
-		while (l--)
-		  putchar ('-');
-		putchar (' ');
-	      }
-	    if (abfd != NULL)
-	      bfd_close_all_done (abfd);
-	  }
-	putchar ('\n');
-      }
-  unlink (dummy_name);
-  free (dummy_name);
-}
-
-/* Print tables of all the target-architecture combinations that
-   BFD has been configured to support.  */
-
-static void
-display_target_tables ()
-{
-  int t, columns;
-  extern const bfd_target *const *bfd_target_vector;
-  char *colum;
-
-  columns = 0;
-  colum = getenv ("COLUMNS");
-  if (colum != NULL)
-    columns = atoi (colum);
-  if (columns == 0)
-    columns = 80;
-
-  t = 0;
-  while (bfd_target_vector[t] != NULL)
-    {
-      int oldt = t, wid;
-
-      wid = LONGEST_ARCH + strlen (bfd_target_vector[t]->name) + 1;
-      ++t;
-      while (wid < columns && bfd_target_vector[t] != NULL)
-	{
-	  int newwid;
-
-	  newwid = wid + strlen (bfd_target_vector[t]->name) + 1;
-	  if (newwid >= columns)
-	    break;
-	  wid = newwid;
-	  ++t;
-	}
-      display_info_table (oldt, t);
-    }
-}
-
-static void
-display_info ()
-{
-  printf (_("BFD header file version %s\n"), BFD_VERSION_STRING);
-  display_target_list ();
-  display_target_tables ();
-}
 
 int main PARAMS ((int, char **));
 
@@ -2943,7 +2756,7 @@
     usage (stderr, 2);
 
   if (formats_info)
-    display_info ();
+    exit_status = display_info ();
   else
     {
       if (optind == argc)
	

===================================================================
RCS file: /home/anteater/bucvs/src/binutils/bucomm.c,v
retrieving revision 1.2
diff -u -r1.2 /home/anteater/bucvs/src/binutils/bucomm.c
--- /home/anteater/bucvs/src/binutils/bucomm.c	2003/03/20 16:20:44	1.2
+++ /home/anteater/bucvs/src/binutils/bucomm.c	2003/03/24 07:52:19
@@ -1,5 +1,6 @@
 /* bucomm.c -- Bin Utils COMmon code.
-   Copyright 1991, 1992, 1993, 1994, 1995, 1997, 1998, 2000, 2001, 2002
+   Copyright 1991, 1992, 1993, 1994, 1995, 1997, 1998, 2000, 2001, 2002,
+   2003
    Free Software Foundation, Inc.
 
    This file is part of GNU Binutils.
@@ -23,6 +24,7 @@
    loaded, but for now it's not necessary.  */
 
 #include "bfd.h"
+#include "bfdver.h"
 #include "libiberty.h"
 #include "bucomm.h"
 #include "filenames.h"
@@ -160,7 +162,201 @@
     fprintf (f, " %s", *arch);
   fprintf (f, "\n");
 }
-\f
+
+/* The length of the longest architecture name + 1.  */
+#define LONGEST_ARCH sizeof("powerpc:common")
+
+const char *
+endian_string (endian)
+     enum bfd_endian endian;
+{
+  if (endian == BFD_ENDIAN_BIG)
+    return "big endian";
+  else if (endian == BFD_ENDIAN_LITTLE)
+    return "little endian";
+  else
+    return "endianness unknown";
+}
+
+/* List the targets that BFD is configured to support, each followed
+   by its endianness and the architectures it supports.  */
+
+int
+display_target_list ()
+{
+  extern const bfd_target *const *bfd_target_vector;
+  char *dummy_name;
+  int t, ret = 1;
+
+  dummy_name = make_temp_file (NULL);
+  for (t = 0; bfd_target_vector[t]; t++)
+    {
+      const bfd_target *p = bfd_target_vector[t];
+      bfd *abfd = bfd_openw (dummy_name, p->name);
+      int a;
+
+      printf ("%s\n (header %s, data %s)\n", p->name,
+	      endian_string (p->header_byteorder),
+	      endian_string (p->byteorder));
+
+      if (abfd == NULL)
+	{
+          bfd_nonfatal (dummy_name);
+          ret = 0;
+	  continue;
+	}
+
+      if (! bfd_set_format (abfd, bfd_object))
+	{
+	  if (bfd_get_error () != bfd_error_invalid_operation)
+            {
+	      bfd_nonfatal (p->name);
+              ret = 0;
+            }
+	  bfd_close_all_done (abfd);
+	  continue;
+	}
+
+      for (a = (int) bfd_arch_obscure + 1; a < (int) bfd_arch_last; a++)
+	if (bfd_set_arch_mach (abfd, (enum bfd_architecture) a, 0))
+	  printf ("  %s\n",
+		  bfd_printable_arch_mach ((enum bfd_architecture) a, 0));
+      bfd_close_all_done (abfd);
+    }
+  unlink (dummy_name);
+  free (dummy_name);
+
+  return ret;
+}
+
+/* Print a table showing which architectures are supported for entries
+   FIRST through LAST-1 of bfd_target_vector (targets across,
+   architectures down).  */
+
+int
+display_info_table (first, last)
+     int first;
+     int last;
+{
+  extern const bfd_target *const *bfd_target_vector;
+  int t, a, ret = 1;
+  char *dummy_name;
+
+  /* Print heading of target names.  */
+  printf ("\n%*s", (int) LONGEST_ARCH, " ");
+  for (t = first; t < last && bfd_target_vector[t]; t++)
+    printf ("%s ", bfd_target_vector[t]->name);
+  putchar ('\n');
+
+  dummy_name = make_temp_file (NULL);
+  for (a = (int) bfd_arch_obscure + 1; a < (int) bfd_arch_last; a++)
+    if (strcmp (bfd_printable_arch_mach (a, 0), "UNKNOWN!") != 0)
+      {
+	printf ("%*s ", (int) LONGEST_ARCH - 1,
+		bfd_printable_arch_mach (a, 0));
+	for (t = first; t < last && bfd_target_vector[t]; t++)
+	  {
+	    const bfd_target *p = bfd_target_vector[t];
+	    bfd_boolean ok = TRUE;
+	    bfd *abfd = bfd_openw (dummy_name, p->name);
+
+	    if (abfd == NULL)
+	      {
+		bfd_nonfatal (p->name);
+                ret = 0;
+		ok = FALSE;
+	      }
+
+	    if (ok)
+	      {
+		if (! bfd_set_format (abfd, bfd_object))
+		  {
+		    if (bfd_get_error () != bfd_error_invalid_operation)
+                      {
+		        bfd_nonfatal (p->name);
+                        ret = 0;
+                      }
+		    ok = FALSE;
+		  }
+	      }
+
+	    if (ok)
+	      {
+		if (! bfd_set_arch_mach (abfd, a, 0))
+		  ok = FALSE;
+	      }
+
+	    if (ok)
+	      printf ("%s ", p->name);
+	    else
+	      {
+		int l = strlen (p->name);
+		while (l--)
+		  putchar ('-');
+		putchar (' ');
+	      }
+	    if (abfd != NULL)
+	      bfd_close_all_done (abfd);
+	  }
+	putchar ('\n');
+      }
+  unlink (dummy_name);
+  free (dummy_name);
+
+  return ret;
+}
+
+/* Print tables of all the target-architecture combinations that
+   BFD has been configured to support.  */
+
+int
+display_target_tables ()
+{
+  int t, columns, ret = 1;
+  extern const bfd_target *const *bfd_target_vector;
+  char *colum;
+
+  columns = 0;
+  colum = getenv ("COLUMNS");
+  if (colum != NULL)
+    columns = atoi (colum);
+  if (columns == 0)
+    columns = 80;
+
+  t = 0;
+  while (bfd_target_vector[t] != NULL)
+    {
+      int oldt = t, wid;
+
+      wid = LONGEST_ARCH + strlen (bfd_target_vector[t]->name) + 1;
+      ++t;
+      while (wid < columns && bfd_target_vector[t] != NULL)
+	{
+	  int newwid;
+
+	  newwid = wid + strlen (bfd_target_vector[t]->name) + 1;
+	  if (newwid >= columns)
+	    break;
+	  wid = newwid;
+	  ++t;
+	}
+      if (! display_info_table (oldt, t))
+        ret = 0;
+    }
+
+  return ret;
+}
+
+int
+display_info ()
+{
+  printf (_("BFD header file version %s\n"), BFD_VERSION_STRING);
+  if (! display_target_list () || ! display_target_tables ())
+    return 1;
+  else
+    return 0;
+}
+
 /* Display the archive header for an element as if it were an ls -l listing:
 
    Mode       User\tGroup\tSize\tDate               Name */

===================================================================
RCS file: /home/anteater/bucvs/src/binutils/bucomm.h,v
retrieving revision 1.1
diff -u -r1.1 /home/anteater/bucvs/src/binutils/bucomm.h
--- /home/anteater/bucvs/src/binutils/bucomm.h	2003/03/20 16:34:06	1.1
+++ /home/anteater/bucvs/src/binutils/bucomm.h	2003/03/24 07:52:34
@@ -1,6 +1,6 @@
 /* bucomm.h -- binutils common include file.
    Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
-   2002 Free Software Foundation, Inc.
+   2002, 2003 Free Software Foundation, Inc.
 
 This file is part of GNU Binutils.
 
@@ -175,6 +175,21 @@
 void list_supported_architectures
   PARAMS ((const char *, FILE *));
 
+const char * endian_string
+  PARAMS ((enum bfd_endian));
+
+int display_info
+  PARAMS ((void));
+  
+int display_target_list
+  PARAMS ((void));
+
+int display_info_table
+  PARAMS ((int, int));
+
+int display_target_tables 
+  PARAMS ((void));
+
 void print_arelt_descr
   PARAMS ((FILE *file, bfd *abfd, bfd_boolean verbose));
 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [RFC] objcopy/objdump targets list
  2003-03-24 14:40   ` Elias Athanasopoulos
@ 2003-03-24 16:12     ` Nick Clifton
  2003-03-24 16:44       ` Elias Athanasopoulos
  0 siblings, 1 reply; 6+ messages in thread
From: Nick Clifton @ 2003-03-24 16:12 UTC (permalink / raw)
  To: Elias Athanasopoulos; +Cc: binutils

Hi Elias,

> 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:

  * Not exporting display_target_list, display_info_table and
    endian_string.  I am not sure why you wanted to export them, but
    you can always change this if you need to.

  * Including libbfd.h instead of using explicit imports of
    'bfd_target_vector'.

  * Adding dependencies to bfdver.h and libbfd.h for building bucomm.o
    into Makefile.am and then rebuilding Makefile.in.

  * Using a switch() instead of a multiple if() statements in
    endian_string().  I just think that it looks nicer.

Cheers
        Nick

> 2003-03-24  Elias Athanasopoulos  <elathan@phys.uoa.gr>
> 
> 	* objdump.c (endian_string): Move to bucomm.c.
> 	(display_info): Likewise.
> 	(display_target_list): Likewise.
> 	(display_info_table): Likewise.
> 	(display_target_tables): Likewise.
> 	(main): Assign the return value of display_info to exit_status.
> 
> 	* bucomm.c: Include bfdver.h
> 	(display_target_list): Call bfd_nonfatal instead of nonfatal and
> 	return 0 on a non-fatal errror, 1 on success.
> 	(display_info_table): Likewise.
> 	
> 	* bucomm.h (endian_string): Define. Make it non-static.
> 	(display_info): Define. Change prototype so as to return int, 
> 	instead of static void.
> 	(display_target_list): Likewise.
> 	(display_info_table): Likewise.
> 	(display_target_tables): Likewise.

Approved and applied.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [RFC] objcopy/objdump targets list
  2003-03-24 16:12     ` Nick Clifton
@ 2003-03-24 16:44       ` Elias Athanasopoulos
  2003-03-24 19:26         ` Nick Clifton
  0 siblings, 1 reply; 6+ messages in thread
From: Elias Athanasopoulos @ 2003-03-24 16:44 UTC (permalink / raw)
  To: Nick Clifton; +Cc: binutils

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@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.


===================================================================
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}.
+
+@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.
 
+@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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [RFC] objcopy/objdump targets list
  2003-03-24 16:44       ` Elias Athanasopoulos
@ 2003-03-24 19:26         ` Nick Clifton
  0 siblings, 0 replies; 6+ messages in thread
From: Nick Clifton @ 2003-03-24 19:26 UTC (permalink / raw)
  To: Elias Athanasopoulos; +Cc: binutils

Hi Elias,

> 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.

Approved and applied.

Cheers
        Nick

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2003-03-24 16:12 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-03-14 17:22 [RFC] objcopy/objdump targets list Elias Athanasopoulos
2003-03-17 11:30 ` Nick Clifton
2003-03-24 14:40   ` Elias Athanasopoulos
2003-03-24 16:12     ` Nick Clifton
2003-03-24 16:44       ` Elias Athanasopoulos
2003-03-24 19:26         ` Nick Clifton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).