public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [rfa] Add bfd_runtime
@ 2004-06-29 23:47 Andrew Cagney
  2004-06-30  2:08 ` Ian Lance Taylor
  0 siblings, 1 reply; 18+ messages in thread
From: Andrew Cagney @ 2004-06-29 23:47 UTC (permalink / raw)
  To: binutils

[-- Attachment #1: Type: text/plain, Size: 228 bytes --]

Hello,

This follows up an earlier thread by adding the bfd_format type 
bfd_runtime.  It just pads out all the architecture vectors, not doing 
anything useful.

ok?
Andrew
(attempt two to post, I think my mailer ate my patch)

[-- Attachment #2: diffs --]
[-- Type: text/plain, Size: 70257 bytes --]

2004-06-29  Andrew Cagney  <cagney@redhat.com>

	* bfd-in.h (bfd_format): Add "bfd_runtime".
	* bfd-in2.h: Regenerate.
	* pe-mips.c (mipslpe_vec): Update.
	* coff-i386.c (i386coff_vec): Update.
	* coff-i960.c (icoff_big_vec): Update.
	* coff-i860.c (i860coff_vec): Update.
	* coff-tic30.c (tic30_coff_vec): Update.
	* coff-rs6000.c (pmac_xcoff_vec, rs6000coff_vec): Update.
	* coff-ppc.c (TARGET_LITTLE_SYM, TARGET_BIG_SYM): Update.
	* coff-tic54x.c (tic54x_coff0_vec, tic54x_coff1_vec)
	(tic54x_coff0_beh_vec, tic54x_coff1_beh_vec)
	(tic54x_coff2_vec, tic54x_coff2_beh_vec): Update.
	* coff-mips.c (ecoff_little_vec, ecoff_big_vec) 
	(ecoff_biglittle_vec): Update.
	* coff-or32.c (or32coff_big_vec): Update.
	* ppcboot.c (ppcboot_vec): Update.
	* i386os9k.c (i386os9k_vec): Update.
	* i386msdos.c (i386msdos_vec): Update.
	* coff-sh.c (shcoff_small_vec, shlcoff_small_vec): Update.
	* coff64-rs6000.c (rs6000coff64_vec, aix5coff64_vec): Update.
	* ieee.c (ieee_vec): Update.
	* osf-core.c (osf_core_vec): Update.
	* pdp11.c (MY(vec)): Update.
	* pef.c (pef_vec, pef_xlib_vec): Update.
	* coff-alpha.c (ecoffalpha_little_vec): Update.
	* cisco-core.c (cisco_core_big_vec)
	(cisco_core_little_vec): Update.
	* bout.c (b_out_vec_big_host, b_out_vec_little_host): Update.
	* nlm-target.h (TARGET_BIG_SYM, TARGET_LITTLE_SYM): Update.
	* elfxx-target.h (TARGET_BIG_SYM, TARGET_LITTLE_SYM): Update.
	* coffcode.h (CREATE_BIG_COFF_TARGET_VEC) 
	(CREATE_BIGHDR_COFF_TARGET_VEC, CREATE_LITTLE_COFF_TARGET_VEC): Update.
	* aout-target.h (MY(vec)): Update.
	* xcoff-target.h (TARGET_SYM): Update.
	* ptrace-core.c (ptrace_core_vec): Update.
	* aout-tic30.c (tic30_aout_vec): Update.
	* vms.c (vms_alpha_vec, vms_vax_vec): Update.
	* versados.c (versados_vec): Update.
	* som.c (som_vec): Update.
	* irix-core.c (irix_core_vec): Update.
	* mmo.c (bfd_mmo_vec): Update.
	* mipsbsd.c (aout_mips_little_vec, aout_mips_big_vec): Update.
	* mach-o-target.c (TARGET_NAME): Update.
	* srec.c (srec_vec, symbolsrec_vec): Update.
	* tekhex.c (tekhex_vec): Update.
	* binary.c (binary_vec): Update.
	* ihex.c (ihex_vec): Update.
	* netbsd-core.c (netbsd_core_vec): Update.
	* aout-adobe.c (a_out_adobe_vec): Update.
	* aix386-core.c (aix386_core_vec): Update.
	* xsym.c (sym_vec): Update.

Index: aix386-core.c
===================================================================
RCS file: /cvs/src/src/bfd/aix386-core.c,v
retrieving revision 1.12
diff -p -u -r1.12 aix386-core.c
--- aix386-core.c	24 Jun 2004 04:46:14 -0000	1.12
+++ aix386-core.c	29 Jun 2004 23:19:08 -0000
@@ -249,12 +249,27 @@ const bfd_target aix386_core_vec = {
   NO_GET, NO_GETS, NO_PUT,
   NO_GET, NO_GETS, NO_PUT,	/* hdrs */
 
-  {_bfd_dummy_target, _bfd_dummy_target,
-   _bfd_dummy_target, aix386_core_file_p},
-  {bfd_false, bfd_false,	/* bfd_create_object */
-   bfd_false, bfd_false},
-  {bfd_false, bfd_false,	/* bfd_write_contents */
-   bfd_false, bfd_false},
+  {				/* bfd_check_format */
+    _bfd_dummy_target,
+    _bfd_dummy_target,
+    _bfd_dummy_target,
+    aix386_core_file_p,
+    _bfd_dummy_target,
+  },
+  {				/* bfd_set_format */
+    bfd_false,
+    bfd_false,
+    bfd_false,
+    bfd_false,
+    bfd_false,
+  },
+  {				/* bfd_write_contents */
+    bfd_false,
+    bfd_false,
+    bfd_false,
+    bfd_false,
+    bfd_false,
+  },
 
   BFD_JUMP_TABLE_GENERIC (_bfd_generic),
   BFD_JUMP_TABLE_COPY (_bfd_generic),
Index: aout-adobe.c
===================================================================
RCS file: /cvs/src/src/bfd/aout-adobe.c,v
retrieving revision 1.19
diff -p -u -r1.19 aout-adobe.c
--- aout-adobe.c	24 Jun 2004 04:46:14 -0000	1.19
+++ aout-adobe.c	29 Jun 2004 23:19:08 -0000
@@ -548,12 +548,27 @@ const bfd_target a_out_adobe_vec =
     bfd_getb64, bfd_getb_signed_64, bfd_putb64,
     bfd_getb32, bfd_getb_signed_32, bfd_putb32,
     bfd_getb16, bfd_getb_signed_16, bfd_putb16,	/* hdrs */
-    {_bfd_dummy_target, aout_adobe_object_p,	/* bfd_check_format */
-     bfd_generic_archive_p, _bfd_dummy_target},
-    {bfd_false, aout_adobe_mkobject,		/* bfd_set_format */
-     _bfd_generic_mkarchive, bfd_false},
-    {bfd_false, aout_adobe_write_object_contents,/* bfd_write_contents */
-     _bfd_write_archive_contents, bfd_false},
+    {				/* bfd_check_format */
+      _bfd_dummy_target,
+      aout_adobe_object_p,
+      bfd_generic_archive_p,
+      _bfd_dummy_target,
+      _bfd_dummy_target,
+    },
+    {				/* bfd_set_format */
+      bfd_false,
+      aout_adobe_mkobject,
+      _bfd_generic_mkarchive,
+      bfd_false,
+      bfd_false,
+    },
+    {				/* bfd_write_contents */
+      bfd_false,
+      aout_adobe_write_object_contents,
+      _bfd_write_archive_contents,
+      bfd_false,
+      bfd_false,
+    },
 
     BFD_JUMP_TABLE_GENERIC (aout_32),
     BFD_JUMP_TABLE_COPY (_bfd_generic),
Index: aout-target.h
===================================================================
RCS file: /cvs/src/src/bfd/aout-target.h,v
retrieving revision 1.25
diff -p -u -r1.25 aout-target.h
--- aout-target.h	24 Jun 2004 04:46:14 -0000	1.25
+++ aout-target.h	29 Jun 2004 23:19:08 -0000
@@ -648,12 +648,27 @@ const bfd_target MY(vec) =
      bfd_getl32, bfd_getl_signed_32, bfd_putl32,
      bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* hdrs */
 #endif
-    {_bfd_dummy_target, MY_object_p, /* bfd_check_format */
-       bfd_generic_archive_p, MY_core_file_p},
-    {bfd_false, MY_mkobject,	/* bfd_set_format */
-       _bfd_generic_mkarchive, bfd_false},
-    {bfd_false, MY_write_object_contents, /* bfd_write_contents */
-       _bfd_write_archive_contents, bfd_false},
+  {
+    _bfd_dummy_target,
+    MY_object_p, /* bfd_check_format */
+    bfd_generic_archive_p,
+    MY_core_file_p,
+    _bfd_dummy_target,
+  },
+  {
+    bfd_false,
+    MY_mkobject,	/* bfd_set_format */
+    _bfd_generic_mkarchive,
+    bfd_false,
+    bfd_false,
+  },
+  {
+    bfd_false,
+    MY_write_object_contents, /* bfd_write_contents */
+    _bfd_write_archive_contents,
+    bfd_false,
+    bfd_false,
+  },
 
      BFD_JUMP_TABLE_GENERIC (MY),
      BFD_JUMP_TABLE_COPY (MY),
Index: aout-tic30.c
===================================================================
RCS file: /cvs/src/src/bfd/aout-tic30.c,v
retrieving revision 1.25
diff -p -u -r1.25 aout-tic30.c
--- aout-tic30.c	29 Jun 2004 13:46:29 -0000	1.25
+++ aout-tic30.c	29 Jun 2004 23:19:10 -0000
@@ -1090,12 +1090,27 @@ const bfd_target tic30_aout_vec =
   bfd_getb64, bfd_getb_signed_64, bfd_putb64,
   bfd_getb32, bfd_getb_signed_32, bfd_putb32,
   bfd_getb16, bfd_getb_signed_16, bfd_putb16,	/* hdrs */
-  {_bfd_dummy_target, MY_object_p,	/* bfd_check_format */
-   bfd_generic_archive_p, MY_core_file_p},
-  {bfd_false, MY_mkobject,	/* bfd_set_format */
-   _bfd_generic_mkarchive, bfd_false},
-  {bfd_false, MY_write_object_contents,		/* bfd_write_contents */
-   _bfd_write_archive_contents, bfd_false},
+  {
+    _bfd_dummy_target,
+    MY_object_p,	/* bfd_check_format */
+    bfd_generic_archive_p,
+    MY_core_file_p,
+    _bfd_dummy_target,
+  },
+  {
+    bfd_false,
+    MY_mkobject,	/* bfd_set_format */
+    _bfd_generic_mkarchive,
+    bfd_false,
+    bfd_false,
+  },
+  {
+    bfd_false,
+    MY_write_object_contents,		/* bfd_write_contents */
+    _bfd_write_archive_contents,
+    bfd_false,
+    bfd_false,
+  },
 
   BFD_JUMP_TABLE_GENERIC (MY),
   BFD_JUMP_TABLE_COPY (MY),
Index: bfd-in.h
===================================================================
RCS file: /cvs/src/src/bfd/bfd-in.h,v
retrieving revision 1.85
diff -p -u -r1.85 bfd-in.h
--- bfd-in.h	29 Jun 2004 13:46:29 -0000	1.85
+++ bfd-in.h	29 Jun 2004 23:19:11 -0000
@@ -175,6 +175,7 @@ typedef enum bfd_format
   bfd_object,		/* Linker/assembler/compiler output.  */
   bfd_archive,		/* Object archive file.  */
   bfd_core,		/* Core dump.  */
+  bfd_runtime,		/* In-memory runtime image.  */
   bfd_type_end		/* Marks the end; don't use it!  */
 }
 bfd_format;
Index: bfd-in2.h
===================================================================
RCS file: /cvs/src/src/bfd/bfd-in2.h,v
retrieving revision 1.286
diff -p -u -r1.286 bfd-in2.h
--- bfd-in2.h	29 Jun 2004 14:13:44 -0000	1.286
+++ bfd-in2.h	29 Jun 2004 23:19:12 -0000
@@ -182,6 +182,7 @@ typedef enum bfd_format
   bfd_object,		/* Linker/assembler/compiler output.  */
   bfd_archive,		/* Object archive file.  */
   bfd_core,		/* Core dump.  */
+  bfd_runtime,		/* In-memory runtime image.  */
   bfd_type_end		/* Marks the end; don't use it!  */
 }
 bfd_format;
Index: binary.c
===================================================================
RCS file: /cvs/src/src/bfd/binary.c,v
retrieving revision 1.22
diff -p -u -r1.22 binary.c
--- binary.c	24 Jun 2004 04:46:15 -0000	1.22
+++ binary.c	29 Jun 2004 23:19:12 -0000
@@ -373,18 +373,21 @@ const bfd_target binary_vec =
     binary_object_p,		/* bfd_check_format */
     _bfd_dummy_target,
     _bfd_dummy_target,
+    _bfd_dummy_target,
   },
   {				/* bfd_set_format */
     bfd_false,
     binary_mkobject,
     bfd_false,
     bfd_false,
+    bfd_false,
   },
   {				/* bfd_write_contents */
     bfd_false,
     bfd_true,
     bfd_false,
     bfd_false,
+    bfd_false,
   },
 
   BFD_JUMP_TABLE_GENERIC (binary),
Index: bout.c
===================================================================
RCS file: /cvs/src/src/bfd/bout.c,v
retrieving revision 1.21
diff -p -u -r1.21 bout.c
--- bout.c	24 Jun 2004 04:46:15 -0000	1.21
+++ bout.c	29 Jun 2004 23:19:12 -0000
@@ -1513,12 +1513,27 @@ const bfd_target b_out_vec_big_host =
   bfd_getb64, bfd_getb_signed_64, bfd_putb64,
      bfd_getb32, bfd_getb_signed_32, bfd_putb32,
      bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* hdrs */
- {_bfd_dummy_target, b_out_object_p, /* bfd_check_format */
-   bfd_generic_archive_p, _bfd_dummy_target},
- {bfd_false, b_out_mkobject,	/* bfd_set_format */
-   _bfd_generic_mkarchive, bfd_false},
- {bfd_false, b_out_write_object_contents, /* bfd_write_contents */
-   _bfd_write_archive_contents, bfd_false},
+ {
+   _bfd_dummy_target,
+   b_out_object_p, /* bfd_check_format */
+   bfd_generic_archive_p,
+   _bfd_dummy_target,
+   _bfd_dummy_target,
+ },
+ {
+   bfd_false,
+   b_out_mkobject,	/* bfd_set_format */
+   _bfd_generic_mkarchive,
+   bfd_false,
+   bfd_false,
+ },
+ {
+   bfd_false,
+   b_out_write_object_contents, /* bfd_write_contents */
+   _bfd_write_archive_contents,
+   bfd_false,
+   bfd_false,
+ },
 
      BFD_JUMP_TABLE_GENERIC (aout_32),
      BFD_JUMP_TABLE_COPY (_bfd_generic),
@@ -1555,12 +1570,27 @@ const bfd_target b_out_vec_little_host =
      bfd_getl32, bfd_getl_signed_32, bfd_putl32,
      bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* hdrs */
 
-  {_bfd_dummy_target, b_out_object_p, /* bfd_check_format */
-     bfd_generic_archive_p, _bfd_dummy_target},
-  {bfd_false, b_out_mkobject,	/* bfd_set_format */
-     _bfd_generic_mkarchive, bfd_false},
-  {bfd_false, b_out_write_object_contents, /* bfd_write_contents */
-     _bfd_write_archive_contents, bfd_false},
+  {
+    _bfd_dummy_target,
+    b_out_object_p, /* bfd_check_format */
+    bfd_generic_archive_p,
+    _bfd_dummy_target,
+    _bfd_dummy_target,
+  },
+  {
+    bfd_false,
+    b_out_mkobject,	/* bfd_set_format */
+    _bfd_generic_mkarchive,
+    bfd_false,
+    bfd_false,
+  },
+  {
+    bfd_false,
+    b_out_write_object_contents, /* bfd_write_contents */
+    _bfd_write_archive_contents,
+    bfd_false,
+    bfd_false,
+  },
 
      BFD_JUMP_TABLE_GENERIC (aout_32),
      BFD_JUMP_TABLE_COPY (_bfd_generic),
Index: cisco-core.c
===================================================================
RCS file: /cvs/src/src/bfd/cisco-core.c,v
retrieving revision 1.9
diff -p -u -r1.9 cisco-core.c
--- cisco-core.c	24 Jun 2004 04:46:15 -0000	1.9
+++ cisco-core.c	29 Jun 2004 23:19:12 -0000
@@ -349,18 +349,25 @@ const bfd_target cisco_core_big_vec =
     bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* hdrs */
 
     {				/* bfd_check_format */
-     _bfd_dummy_target,		/* unknown format */
-     _bfd_dummy_target,		/* object file */
-     _bfd_dummy_target,		/* archive */
-     cisco_core_file_p	/* a core file */
+      _bfd_dummy_target,		/* unknown format */
+      _bfd_dummy_target,		/* object file */
+      _bfd_dummy_target,		/* archive */
+      cisco_core_file_p,	/* a core file */
+      _bfd_dummy_target,		/* runtime */
     },
     {				/* bfd_set_format */
-     bfd_false, bfd_false,
-     bfd_false, bfd_false
+      bfd_false,
+      bfd_false,
+      bfd_false,
+      bfd_false,
+      bfd_false,
     },
     {				/* bfd_write_contents */
-     bfd_false, bfd_false,
-     bfd_false, bfd_false
+      bfd_false,
+      bfd_false,
+      bfd_false,
+      bfd_false,
+      bfd_false,
     },
 
        BFD_JUMP_TABLE_GENERIC (_bfd_generic),
@@ -399,18 +406,25 @@ const bfd_target cisco_core_little_vec =
     bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* hdrs */
 
     {				/* bfd_check_format */
-     _bfd_dummy_target,		/* unknown format */
-     _bfd_dummy_target,		/* object file */
-     _bfd_dummy_target,		/* archive */
-     cisco_core_file_p	/* a core file */
+      _bfd_dummy_target,		/* unknown format */
+      _bfd_dummy_target,		/* object file */
+      _bfd_dummy_target,		/* archive */
+      cisco_core_file_p,	/* a core file */
+      _bfd_dummy_target,		/* runtime */
     },
     {				/* bfd_set_format */
-     bfd_false, bfd_false,
-     bfd_false, bfd_false
+      bfd_false,
+      bfd_false,
+      bfd_false,
+      bfd_false,
+      bfd_false,
     },
     {				/* bfd_write_contents */
-     bfd_false, bfd_false,
-     bfd_false, bfd_false
+      bfd_false,
+      bfd_false,
+      bfd_false,
+      bfd_false,
+      bfd_false,
     },
 
        BFD_JUMP_TABLE_GENERIC (_bfd_generic),
Index: coff-alpha.c
===================================================================
RCS file: /cvs/src/src/bfd/coff-alpha.c,v
retrieving revision 1.23
diff -p -u -r1.23 coff-alpha.c
--- coff-alpha.c	24 Jun 2004 04:46:15 -0000	1.23
+++ coff-alpha.c	29 Jun 2004 23:19:13 -0000
@@ -2379,12 +2379,26 @@ const bfd_target ecoffalpha_little_vec =
      bfd_getl32, bfd_getl_signed_32, bfd_putl32,
      bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* hdrs */
 
-  {_bfd_dummy_target, alpha_ecoff_object_p, /* bfd_check_format */
-     _bfd_ecoff_archive_p, _bfd_dummy_target},
-  {bfd_false, _bfd_ecoff_mkobject,  /* bfd_set_format */
-     _bfd_generic_mkarchive, bfd_false},
-  {bfd_false, _bfd_ecoff_write_object_contents, /* bfd_write_contents */
-     _bfd_write_archive_contents, bfd_false},
+  {
+    _bfd_dummy_target,
+    alpha_ecoff_object_p, /* bfd_check_format */
+    _bfd_ecoff_archive_p,
+    _bfd_dummy_target,
+    _bfd_dummy_target,
+  },
+  {
+    bfd_false,
+    _bfd_ecoff_mkobject,  /* bfd_set_format */
+    _bfd_generic_mkarchive,
+    bfd_false,
+    bfd_false,
+  },
+  {
+    bfd_false,
+    _bfd_ecoff_write_object_contents, /* bfd_write_contents */
+    _bfd_write_archive_contents,
+    bfd_false,
+  },
 
      BFD_JUMP_TABLE_GENERIC (_bfd_ecoff),
      BFD_JUMP_TABLE_COPY (_bfd_ecoff),
Index: coff-i386.c
===================================================================
RCS file: /cvs/src/src/bfd/coff-i386.c,v
retrieving revision 1.20
diff -p -u -r1.20 coff-i386.c
--- coff-i386.c	22 Jun 2004 05:35:37 -0000	1.20
+++ coff-i386.c	29 Jun 2004 23:19:13 -0000
@@ -646,12 +646,27 @@ const bfd_target
      bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* hdrs */
 
 /* Note that we allow an object file to be treated as a core file as well.  */
-    {_bfd_dummy_target, coff_object_p, /* bfd_check_format */
-       bfd_generic_archive_p, coff_object_p},
-    {bfd_false, coff_mkobject, _bfd_generic_mkarchive, /* bfd_set_format */
-       bfd_false},
-    {bfd_false, coff_write_object_contents, /* bfd_write_contents */
-       _bfd_write_archive_contents, bfd_false},
+  {
+    _bfd_dummy_target,
+    coff_object_p, /* bfd_check_format */
+    bfd_generic_archive_p,
+    coff_object_p,
+    _bfd_dummy_target,
+  },
+  {
+    bfd_false,
+    coff_mkobject,
+    _bfd_generic_mkarchive, /* bfd_set_format */
+    bfd_false,
+    bfd_false,
+  },
+  {
+    bfd_false,
+    coff_write_object_contents, /* bfd_write_contents */
+    _bfd_write_archive_contents,
+    bfd_false,
+    bfd_false,
+  },
 
      BFD_JUMP_TABLE_GENERIC (coff),
      BFD_JUMP_TABLE_COPY (coff),
Index: coff-i860.c
===================================================================
RCS file: /cvs/src/src/bfd/coff-i860.c,v
retrieving revision 1.14
diff -p -u -r1.14 coff-i860.c
--- coff-i860.c	4 Dec 2003 12:08:42 -0000	1.14
+++ coff-i860.c	29 Jun 2004 23:19:13 -0000
@@ -689,12 +689,27 @@ const bfd_target
      bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* hdrs */
 
 /* Note that we allow an object file to be treated as a core file as well.  */
-    {_bfd_dummy_target, i3coff_object_p, /* bfd_check_format */
-       bfd_generic_archive_p, i3coff_object_p},
-    {bfd_false, coff_mkobject, _bfd_generic_mkarchive, /* bfd_set_format */
-       bfd_false},
-    {bfd_false, coff_write_object_contents, /* bfd_write_contents */
-       _bfd_write_archive_contents, bfd_false},
+  {
+    _bfd_dummy_target,
+    i3coff_object_p, /* bfd_check_format */
+    bfd_generic_archive_p,
+    i3coff_object_p,
+    _bfd_dummy_target,
+  },
+  {
+    bfd_false,
+    coff_mkobject,
+    _bfd_generic_mkarchive, /* bfd_set_format */
+    bfd_false,
+    bfd_false,
+  },
+  {
+    bfd_false,
+    coff_write_object_contents, /* bfd_write_contents */
+    _bfd_write_archive_contents,
+    bfd_false,
+    bfd_false,
+  },
 
      BFD_JUMP_TABLE_GENERIC (coff),
      BFD_JUMP_TABLE_COPY (coff),
Index: coff-i960.c
===================================================================
RCS file: /cvs/src/src/bfd/coff-i960.c,v
retrieving revision 1.12
diff -p -u -r1.12 coff-i960.c
--- coff-i960.c	25 Jun 2003 06:40:18 -0000	1.12
+++ coff-i960.c	29 Jun 2004 23:19:13 -0000
@@ -642,12 +642,27 @@ bfd_getb64, bfd_getb_signed_64, bfd_putb
      bfd_getb32, bfd_getb_signed_32, bfd_putb32,
      bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* hdrs */
 
-  {_bfd_dummy_target, coff_object_p, /* bfd_check_format */
-     bfd_generic_archive_p, _bfd_dummy_target},
-  {bfd_false, coff_mkobject,	/* bfd_set_format */
-     _bfd_generic_mkarchive, bfd_false},
-  {bfd_false, coff_write_object_contents,	/* bfd_write_contents */
-     _bfd_write_archive_contents, bfd_false},
+  {
+    _bfd_dummy_target,
+    coff_object_p, /* bfd_check_format */
+    bfd_generic_archive_p,
+    _bfd_dummy_target,
+    _bfd_dummy_target,
+  },
+  {
+    bfd_false,
+    coff_mkobject,	/* bfd_set_format */
+    _bfd_generic_mkarchive,
+    bfd_false,
+    bfd_false,
+  },
+  {
+    bfd_false,
+    coff_write_object_contents,	/* bfd_write_contents */
+    _bfd_write_archive_contents,
+    bfd_false,
+    bfd_false,
+  },
 
      BFD_JUMP_TABLE_GENERIC (coff),
      BFD_JUMP_TABLE_COPY (coff),
Index: coff-mips.c
===================================================================
RCS file: /cvs/src/src/bfd/coff-mips.c,v
retrieving revision 1.26
diff -p -u -r1.26 coff-mips.c
--- coff-mips.c	29 Jun 2004 13:46:29 -0000	1.26
+++ coff-mips.c	29 Jun 2004 23:19:13 -0000
@@ -1420,12 +1420,27 @@ const bfd_target ecoff_little_vec =
      bfd_getl32, bfd_getl_signed_32, bfd_putl32,
      bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* hdrs */
 
-  {_bfd_dummy_target, coff_object_p, /* bfd_check_format */
-     _bfd_ecoff_archive_p, _bfd_dummy_target},
-  {bfd_false, _bfd_ecoff_mkobject,  /* bfd_set_format */
-     _bfd_generic_mkarchive, bfd_false},
-  {bfd_false, _bfd_ecoff_write_object_contents, /* bfd_write_contents */
-     _bfd_write_archive_contents, bfd_false},
+  {
+    _bfd_dummy_target,
+    coff_object_p, /* bfd_check_format */
+    _bfd_ecoff_archive_p,
+    _bfd_dummy_target,
+    _bfd_dummy_target,
+  },
+  {
+    bfd_false,
+    _bfd_ecoff_mkobject,  /* bfd_set_format */
+    _bfd_generic_mkarchive,
+    bfd_false,
+    bfd_false,
+  },
+  {
+    bfd_false,
+    _bfd_ecoff_write_object_contents, /* bfd_write_contents */
+    _bfd_write_archive_contents,
+    bfd_false,
+    bfd_false,
+  },
 
      BFD_JUMP_TABLE_GENERIC (_bfd_ecoff),
      BFD_JUMP_TABLE_COPY (_bfd_ecoff),
@@ -1463,12 +1478,27 @@ const bfd_target ecoff_big_vec =
   bfd_getb64, bfd_getb_signed_64, bfd_putb64,
      bfd_getb32, bfd_getb_signed_32, bfd_putb32,
      bfd_getb16, bfd_getb_signed_16, bfd_putb16,
- {_bfd_dummy_target, coff_object_p, /* bfd_check_format */
-    _bfd_ecoff_archive_p, _bfd_dummy_target},
- {bfd_false, _bfd_ecoff_mkobject, /* bfd_set_format */
-    _bfd_generic_mkarchive, bfd_false},
- {bfd_false, _bfd_ecoff_write_object_contents, /* bfd_write_contents */
-    _bfd_write_archive_contents, bfd_false},
+ {
+   _bfd_dummy_target,
+   coff_object_p, /* bfd_check_format */
+   _bfd_ecoff_archive_p,
+   _bfd_dummy_target,
+   _bfd_dummy_target,
+ },
+ {
+   bfd_false,
+   _bfd_ecoff_mkobject, /* bfd_set_format */
+   _bfd_generic_mkarchive,
+   bfd_false,
+   bfd_false,
+ },
+ {
+   bfd_false,
+   _bfd_ecoff_write_object_contents, /* bfd_write_contents */
+   _bfd_write_archive_contents,
+   bfd_false,
+   bfd_false,
+ },
 
      BFD_JUMP_TABLE_GENERIC (_bfd_ecoff),
      BFD_JUMP_TABLE_COPY (_bfd_ecoff),
@@ -1507,12 +1537,27 @@ const bfd_target ecoff_biglittle_vec =
      bfd_getb32, bfd_getb_signed_32, bfd_putb32,
      bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* hdrs */
 
-  {_bfd_dummy_target, coff_object_p, /* bfd_check_format */
-     _bfd_ecoff_archive_p, _bfd_dummy_target},
-  {bfd_false, _bfd_ecoff_mkobject,  /* bfd_set_format */
-     _bfd_generic_mkarchive, bfd_false},
-  {bfd_false, _bfd_ecoff_write_object_contents, /* bfd_write_contents */
-     _bfd_write_archive_contents, bfd_false},
+  {
+    _bfd_dummy_target,
+    coff_object_p, /* bfd_check_format */
+    _bfd_ecoff_archive_p,
+    _bfd_dummy_target,
+    _bfd_dummy_target,
+  },
+  {
+    bfd_false,
+    _bfd_ecoff_mkobject,  /* bfd_set_format */
+    _bfd_generic_mkarchive,
+    bfd_false,
+    bfd_false,
+  },
+  {
+    bfd_false,
+    _bfd_ecoff_write_object_contents, /* bfd_write_contents */
+    _bfd_write_archive_contents,
+    bfd_false,
+    bfd_false,
+  },
 
      BFD_JUMP_TABLE_GENERIC (_bfd_ecoff),
      BFD_JUMP_TABLE_COPY (_bfd_ecoff),
Index: coff-or32.c
===================================================================
RCS file: /cvs/src/src/bfd/coff-or32.c,v
retrieving revision 1.5
diff -p -u -r1.5 coff-or32.c
--- coff-or32.c	25 Jun 2003 06:40:24 -0000	1.5
+++ coff-or32.c	29 Jun 2004 23:19:13 -0000
@@ -626,19 +626,22 @@ const bfd_target or32coff_big_vec =
     _bfd_dummy_target,
     coff_object_p,
     bfd_generic_archive_p,
-    _bfd_dummy_target
+    _bfd_dummy_target,
+    _bfd_dummy_target,
   },
   {
     bfd_false,
     coff_mkobject,
     _bfd_generic_mkarchive,
-    bfd_false
+    bfd_false,
+    bfd_false,
   },
   {
     bfd_false,
     coff_write_object_contents,
     _bfd_write_archive_contents,
-    bfd_false
+    bfd_false,
+    bfd_false,
   },
 
   BFD_JUMP_TABLE_GENERIC (coff),
Index: coff-ppc.c
===================================================================
RCS file: /cvs/src/src/bfd/coff-ppc.c,v
retrieving revision 1.21
diff -p -u -r1.21 coff-ppc.c
--- coff-ppc.c	28 Jun 2004 13:57:58 -0000	1.21
+++ coff-ppc.c	29 Jun 2004 23:19:16 -0000
@@ -2782,12 +2782,27 @@ const bfd_target TARGET_LITTLE_SYM =
   bfd_getl32, bfd_getl_signed_32, bfd_putl32,
   bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* hdrs */
 
-  {_bfd_dummy_target, coff_object_p, 	/* bfd_check_format */
-     bfd_generic_archive_p, /* _bfd_dummy_target */ coff_object_p },
-  {bfd_false, coff_mkobject, _bfd_generic_mkarchive, /* bfd_set_format */
-     bfd_false},
-  {bfd_false, coff_write_object_contents,	/* bfd_write_contents */
-     _bfd_write_archive_contents, bfd_false},
+  {
+    _bfd_dummy_target,
+    coff_object_p, 	/* bfd_check_format */
+    bfd_generic_archive_p, /* _bfd_dummy_target */
+    coff_object_p,
+    _bfd_dummy_target,
+  },
+  {
+    bfd_false,
+    coff_mkobject,
+    _bfd_generic_mkarchive, /* bfd_set_format */
+    bfd_false,
+    bfd_false,
+  },
+  {
+    bfd_false,
+    coff_write_object_contents,	/* bfd_write_contents */
+    _bfd_write_archive_contents,
+    bfd_false,
+    bfd_false,
+  },
 
   BFD_JUMP_TABLE_GENERIC (coff),
   BFD_JUMP_TABLE_COPY (coff),
@@ -2841,12 +2856,27 @@ const bfd_target TARGET_BIG_SYM =
   bfd_getb32, bfd_getb_signed_32, bfd_putb32,
   bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* hdrs */
 
-  {_bfd_dummy_target, coff_object_p, 	/* bfd_check_format */
-     bfd_generic_archive_p, /* _bfd_dummy_target */ coff_object_p },
-  {bfd_false, coff_mkobject, _bfd_generic_mkarchive, /* bfd_set_format */
-     bfd_false},
-  {bfd_false, coff_write_object_contents,	/* bfd_write_contents */
-     _bfd_write_archive_contents, bfd_false},
+  {
+    _bfd_dummy_target,
+    coff_object_p, 	/* bfd_check_format */
+    bfd_generic_archive_p, /* _bfd_dummy_target */
+    coff_object_p,
+    _bfd_dummy_target,
+  },
+  {
+    bfd_false,
+    coff_mkobject,
+    _bfd_generic_mkarchive, /* bfd_set_format */
+    bfd_false,
+    bfd_false,
+  },
+  {
+    bfd_false,
+    coff_write_object_contents,	/* bfd_write_contents */
+    _bfd_write_archive_contents,
+    bfd_false,
+    bfd_false,
+  },
 
   BFD_JUMP_TABLE_GENERIC (coff),
   BFD_JUMP_TABLE_COPY (coff),
Index: coff-rs6000.c
===================================================================
RCS file: /cvs/src/src/bfd/coff-rs6000.c,v
retrieving revision 1.61
diff -p -u -r1.61 coff-rs6000.c
--- coff-rs6000.c	24 Jun 2004 04:46:15 -0000	1.61
+++ coff-rs6000.c	29 Jun 2004 23:19:18 -0000
@@ -4112,21 +4112,24 @@ const bfd_target rs6000coff_vec =
       _bfd_dummy_target,
       coff_object_p,
       _bfd_xcoff_archive_p,
-      CORE_FILE_P
+      CORE_FILE_P,
+      _bfd_dummy_target,
     },
 
     { /* bfd_set_format */
       bfd_false,
       coff_mkobject,
       _bfd_generic_mkarchive,
-      bfd_false
+      bfd_false,
+      bfd_false,
     },
 
     {/* bfd_write_contents */
       bfd_false,
       coff_write_object_contents,
       _bfd_xcoff_write_archive_contents,
-      bfd_false
+      bfd_false,
+      bfd_false,
     },
 
     /* Generic */
@@ -4357,21 +4360,24 @@ const bfd_target pmac_xcoff_vec =
       _bfd_dummy_target,
       coff_object_p,
       _bfd_xcoff_archive_p,
-      CORE_FILE_P
+      CORE_FILE_P,
+      _bfd_dummy_target,
     },
 
     { /* bfd_set_format */
       bfd_false,
       coff_mkobject,
       _bfd_generic_mkarchive,
-      bfd_false
+      bfd_false,
+      bfd_false,
     },
 
     {/* bfd_write_contents */
       bfd_false,
       coff_write_object_contents,
       _bfd_xcoff_write_archive_contents,
-      bfd_false
+      bfd_false,
+      bfd_false,
     },
 
     /* Generic */
Index: coff-sh.c
===================================================================
RCS file: /cvs/src/src/bfd/coff-sh.c,v
retrieving revision 1.27
diff -p -u -r1.27 coff-sh.c
--- coff-sh.c	24 Jun 2004 04:46:16 -0000	1.27
+++ coff-sh.c	29 Jun 2004 23:19:18 -0000
@@ -3228,12 +3228,27 @@ const bfd_target shcoff_small_vec =
   bfd_getb32, bfd_getb_signed_32, bfd_putb32,
   bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* hdrs */
 
-  {_bfd_dummy_target, coff_small_object_p, /* bfd_check_format */
-     bfd_generic_archive_p, _bfd_dummy_target},
-  {bfd_false, coff_mkobject, _bfd_generic_mkarchive, /* bfd_set_format */
-     bfd_false},
-  {bfd_false, coff_write_object_contents, /* bfd_write_contents */
-     _bfd_write_archive_contents, bfd_false},
+  {
+    _bfd_dummy_target,
+    coff_small_object_p, /* bfd_check_format */
+    bfd_generic_archive_p,
+    _bfd_dummy_target,
+    _bfd_dummy_target,
+  },
+  {
+    bfd_false,
+    coff_mkobject,
+    _bfd_generic_mkarchive, /* bfd_set_format */
+    bfd_false,
+    bfd_false,
+  },
+  {
+    bfd_false,
+    coff_write_object_contents, /* bfd_write_contents */
+    _bfd_write_archive_contents,
+    bfd_false,
+    bfd_false,
+  },
 
   BFD_JUMP_TABLE_GENERIC (coff_small),
   BFD_JUMP_TABLE_COPY (coff),
@@ -3272,12 +3287,27 @@ const bfd_target shlcoff_small_vec =
   bfd_getl32, bfd_getl_signed_32, bfd_putl32,
   bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* hdrs */
 
-  {_bfd_dummy_target, coff_small_object_p, /* bfd_check_format */
-     bfd_generic_archive_p, _bfd_dummy_target},
-  {bfd_false, coff_mkobject, _bfd_generic_mkarchive, /* bfd_set_format */
-     bfd_false},
-  {bfd_false, coff_write_object_contents, /* bfd_write_contents */
-     _bfd_write_archive_contents, bfd_false},
+  {
+    _bfd_dummy_target,
+    coff_small_object_p, /* bfd_check_format */
+    bfd_generic_archive_p,
+    _bfd_dummy_target,
+    _bfd_dummy_target,
+  },
+  {
+    bfd_false,
+    coff_mkobject,
+    _bfd_generic_mkarchive, /* bfd_set_format */
+    bfd_false,
+    bfd_false,
+  },
+  {
+    bfd_false,
+    coff_write_object_contents, /* bfd_write_contents */
+    _bfd_write_archive_contents,
+    bfd_false,
+    bfd_false,
+  },
 
   BFD_JUMP_TABLE_GENERIC (coff_small),
   BFD_JUMP_TABLE_COPY (coff),
Index: coff-tic30.c
===================================================================
RCS file: /cvs/src/src/bfd/coff-tic30.c,v
retrieving revision 1.8
diff -p -u -r1.8 coff-tic30.c
--- coff-tic30.c	30 Nov 2002 08:39:36 -0000	1.8
+++ coff-tic30.c	29 Jun 2004 23:19:18 -0000
@@ -187,12 +187,27 @@ const bfd_target tic30_coff_vec =
   bfd_getl32, bfd_getl_signed_32, bfd_putl32,
   bfd_getl16, bfd_getl_signed_16, bfd_putl16,	/* hdrs */
 
-  {_bfd_dummy_target, coff_object_p,	/* bfd_check_format */
-   bfd_generic_archive_p, _bfd_dummy_target},
-  {bfd_false, coff_mkobject, _bfd_generic_mkarchive,	/* bfd_set_format */
-   bfd_false},
-  {bfd_false, coff_write_object_contents,	/* bfd_write_contents */
-   _bfd_write_archive_contents, bfd_false},
+  {
+    _bfd_dummy_target,
+    coff_object_p,	/* bfd_check_format */
+    bfd_generic_archive_p,
+    _bfd_dummy_target,
+    _bfd_dummy_target,
+  },
+  {
+    bfd_false,
+    coff_mkobject,
+    _bfd_generic_mkarchive,	/* bfd_set_format */
+    bfd_false,
+    bfd_false,
+  },
+  {
+    bfd_false,
+    coff_write_object_contents,	/* bfd_write_contents */
+    _bfd_write_archive_contents,
+    bfd_false,
+    bfd_false,
+  },
 
   BFD_JUMP_TABLE_GENERIC (coff),
   BFD_JUMP_TABLE_COPY (coff),
Index: coff-tic54x.c
===================================================================
RCS file: /cvs/src/src/bfd/coff-tic54x.c,v
retrieving revision 1.15
diff -p -u -r1.15 coff-tic54x.c
--- coff-tic54x.c	15 Mar 2004 12:23:10 -0000	1.15
+++ coff-tic54x.c	29 Jun 2004 23:19:18 -0000
@@ -421,12 +421,27 @@ const bfd_target tic54x_coff0_vec =
     bfd_getl32, bfd_getl_signed_32, bfd_putl32,
     bfd_getl16, bfd_getl_signed_16, bfd_putl16,	/* hdrs */
 
-    {_bfd_dummy_target, coff_object_p,	/* bfd_check_format */
-     bfd_generic_archive_p, _bfd_dummy_target},
-    {bfd_false, coff_mkobject, _bfd_generic_mkarchive,	/* bfd_set_format */
-     bfd_false},
-    {bfd_false, coff_write_object_contents,	/* bfd_write_contents */
-     _bfd_write_archive_contents, bfd_false},
+    {
+      _bfd_dummy_target,
+      coff_object_p,	/* bfd_check_format */
+      bfd_generic_archive_p,
+      _bfd_dummy_target,
+      _bfd_dummy_target,
+    },
+    {
+      bfd_false,
+      coff_mkobject,
+      _bfd_generic_mkarchive,	/* bfd_set_format */
+      bfd_false,
+      bfd_false,
+    },
+    {
+      bfd_false,
+      coff_write_object_contents,	/* bfd_write_contents */
+     _bfd_write_archive_contents,
+      bfd_false,
+      bfd_false,
+    },
 
     BFD_JUMP_TABLE_GENERIC (coff),
     BFD_JUMP_TABLE_COPY (coff),
@@ -465,12 +480,27 @@ const bfd_target tic54x_coff0_beh_vec =
     bfd_getb32, bfd_getb_signed_32, bfd_putb32,
     bfd_getb16, bfd_getb_signed_16, bfd_putb16,	/* hdrs */
 
-    {_bfd_dummy_target, coff_object_p,	/* bfd_check_format */
-     bfd_generic_archive_p, _bfd_dummy_target},
-    {bfd_false, coff_mkobject, _bfd_generic_mkarchive,	/* bfd_set_format */
-     bfd_false},
-    {bfd_false, coff_write_object_contents,	/* bfd_write_contents */
-     _bfd_write_archive_contents, bfd_false},
+    {
+      _bfd_dummy_target,
+      coff_object_p,	/* bfd_check_format */
+      bfd_generic_archive_p,
+      _bfd_dummy_target,
+      _bfd_dummy_target,
+    },
+    {
+      bfd_false,
+      coff_mkobject,
+      _bfd_generic_mkarchive,	/* bfd_set_format */
+      bfd_false,
+      bfd_false,
+    },
+    {
+      bfd_false,
+      coff_write_object_contents,	/* bfd_write_contents */
+      _bfd_write_archive_contents,
+      bfd_false,
+      bfd_false,
+    },
 
     BFD_JUMP_TABLE_GENERIC (coff),
     BFD_JUMP_TABLE_COPY (coff),
@@ -510,12 +540,27 @@ const bfd_target tic54x_coff1_vec =
     bfd_getl32, bfd_getl_signed_32, bfd_putl32,
     bfd_getl16, bfd_getl_signed_16, bfd_putl16,	/* hdrs */
 
-    {_bfd_dummy_target, coff_object_p,	/* bfd_check_format */
-     bfd_generic_archive_p, _bfd_dummy_target},
-    {bfd_false, coff_mkobject, _bfd_generic_mkarchive,	/* bfd_set_format */
-     bfd_false},
-    {bfd_false, coff_write_object_contents,	/* bfd_write_contents */
-     _bfd_write_archive_contents, bfd_false},
+    {
+      _bfd_dummy_target,
+      coff_object_p,	/* bfd_check_format */
+      bfd_generic_archive_p,
+      _bfd_dummy_target,
+      _bfd_dummy_target,
+    },
+    {
+      bfd_false,
+      coff_mkobject,
+      _bfd_generic_mkarchive,	/* bfd_set_format */
+      bfd_false,
+      bfd_false,
+    },
+    {
+      bfd_false,
+      coff_write_object_contents,	/* bfd_write_contents */
+      _bfd_write_archive_contents,
+      bfd_false,
+      bfd_false,
+    },
 
     BFD_JUMP_TABLE_GENERIC (coff),
     BFD_JUMP_TABLE_COPY (coff),
@@ -555,12 +600,27 @@ const bfd_target tic54x_coff1_beh_vec =
     bfd_getb32, bfd_getb_signed_32, bfd_putb32,
     bfd_getb16, bfd_getb_signed_16, bfd_putb16,	/* hdrs */
 
-    {_bfd_dummy_target, coff_object_p,	/* bfd_check_format */
-     bfd_generic_archive_p, _bfd_dummy_target},
-    {bfd_false, coff_mkobject, _bfd_generic_mkarchive,	/* bfd_set_format */
-     bfd_false},
-    {bfd_false, coff_write_object_contents,	/* bfd_write_contents */
-     _bfd_write_archive_contents, bfd_false},
+    {
+      _bfd_dummy_target,
+      coff_object_p,	/* bfd_check_format */
+      bfd_generic_archive_p,
+      _bfd_dummy_target,
+      _bfd_dummy_target,
+    },
+    {
+      bfd_false,
+      coff_mkobject,
+      _bfd_generic_mkarchive,	/* bfd_set_format */
+      bfd_false,
+      bfd_false,
+    },
+    {
+      bfd_false,
+      coff_write_object_contents,	/* bfd_write_contents */
+      _bfd_write_archive_contents,
+      bfd_false,
+      bfd_false,
+    },
 
     BFD_JUMP_TABLE_GENERIC (coff),
     BFD_JUMP_TABLE_COPY (coff),
@@ -600,12 +660,27 @@ const bfd_target tic54x_coff2_vec =
     bfd_getl32, bfd_getl_signed_32, bfd_putl32,
     bfd_getl16, bfd_getl_signed_16, bfd_putl16,	/* hdrs */
 
-    {_bfd_dummy_target, coff_object_p,	/* bfd_check_format */
-     bfd_generic_archive_p, _bfd_dummy_target},
-    {bfd_false, coff_mkobject, _bfd_generic_mkarchive,	/* bfd_set_format */
-     bfd_false},
-    {bfd_false, coff_write_object_contents,	/* bfd_write_contents */
-     _bfd_write_archive_contents, bfd_false},
+    {
+      _bfd_dummy_target,
+      coff_object_p,	/* bfd_check_format */
+      bfd_generic_archive_p,
+      _bfd_dummy_target,
+      _bfd_dummy_target,
+    },
+    {
+      bfd_false,
+      coff_mkobject,
+      _bfd_generic_mkarchive,	/* bfd_set_format */
+      bfd_false,
+      bfd_false,
+    },
+    {
+      bfd_false,
+      coff_write_object_contents,	/* bfd_write_contents */
+      _bfd_write_archive_contents,
+      bfd_false,
+      bfd_false,
+    },
 
     BFD_JUMP_TABLE_GENERIC (coff),
     BFD_JUMP_TABLE_COPY (coff),
@@ -645,12 +720,27 @@ const bfd_target tic54x_coff2_beh_vec =
     bfd_getb32, bfd_getb_signed_32, bfd_putb32,
     bfd_getb16, bfd_getb_signed_16, bfd_putb16,	/* hdrs */
 
-    {_bfd_dummy_target, coff_object_p,	/* bfd_check_format */
-     bfd_generic_archive_p, _bfd_dummy_target},
-    {bfd_false, coff_mkobject, _bfd_generic_mkarchive,	/* bfd_set_format */
-     bfd_false},
-    {bfd_false, coff_write_object_contents,	/* bfd_write_contents */
-     _bfd_write_archive_contents, bfd_false},
+    {
+      _bfd_dummy_target,
+      coff_object_p,	/* bfd_check_format */
+      bfd_generic_archive_p,
+      _bfd_dummy_target,
+      _bfd_dummy_target,
+    },
+    {
+      bfd_false,
+      coff_mkobject,
+      _bfd_generic_mkarchive,	/* bfd_set_format */
+      bfd_false,
+      bfd_false,
+    },
+    {
+      bfd_false,
+      coff_write_object_contents,	/* bfd_write_contents */
+      _bfd_write_archive_contents,
+      bfd_false,
+      bfd_false,
+    },
 
     BFD_JUMP_TABLE_GENERIC (coff),
     BFD_JUMP_TABLE_COPY (coff),
Index: coff64-rs6000.c
===================================================================
RCS file: /cvs/src/src/bfd/coff64-rs6000.c,v
retrieving revision 1.53
diff -p -u -r1.53 coff64-rs6000.c
--- coff64-rs6000.c	24 Jun 2004 04:46:16 -0000	1.53
+++ coff64-rs6000.c	29 Jun 2004 23:19:18 -0000
@@ -2653,21 +2653,24 @@ const bfd_target rs6000coff64_vec =
       _bfd_dummy_target,
       coff_object_p,
       xcoff64_archive_p,
-      CORE_FILE_P
+      CORE_FILE_P,
+      _bfd_dummy_target,
     },
 
     { /* bfd_set_format */
       bfd_false,
       coff_mkobject,
       _bfd_generic_mkarchive,
-      bfd_false
+      bfd_false,
+      bfd_false,
     },
 
     {/* bfd_write_contents */
       bfd_false,
       xcoff64_write_object_contents,
       _bfd_xcoff_write_archive_contents,
-      bfd_false
+      bfd_false,
+      bfd_false,
     },
 
     /* Generic */
@@ -2899,21 +2902,24 @@ const bfd_target aix5coff64_vec =
       _bfd_dummy_target,
       coff_object_p,
       xcoff64_archive_p,
-      xcoff64_core_p
+      xcoff64_core_p,
+      _bfd_dummy_target,
     },
 
     { /* bfd_set_format */
       bfd_false,
       coff_mkobject,
       _bfd_generic_mkarchive,
-      bfd_false
+      bfd_false,
+      bfd_false,
     },
 
     {/* bfd_write_contents */
       bfd_false,
       xcoff64_write_object_contents,
       _bfd_xcoff_write_archive_contents,
-      bfd_false
+      bfd_false,
+      bfd_false,
     },
 
     /* Generic */
Index: coffcode.h
===================================================================
RCS file: /cvs/src/src/bfd/coffcode.h,v
retrieving revision 1.108
diff -p -u -r1.108 coffcode.h
--- coffcode.h	24 Jun 2004 04:46:16 -0000	1.108
+++ coffcode.h	29 Jun 2004 23:19:20 -0000
@@ -5614,12 +5614,13 @@ const bfd_target VAR =							\
 									\
 	/* bfd_check_format */						\
   { _bfd_dummy_target, coff_object_p, bfd_generic_archive_p,		\
-    _bfd_dummy_target },						\
+    _bfd_dummy_target, _bfd_dummy_target, },				\
 	/* bfd_set_format */						\
-  { bfd_false, coff_mkobject, _bfd_generic_mkarchive, bfd_false },	\
+  { bfd_false, coff_mkobject, _bfd_generic_mkarchive, 			\
+    bfd_false, bfd_false, },	\
 	/* bfd_write_contents */					\
   { bfd_false, coff_write_object_contents, _bfd_write_archive_contents,	\
-    bfd_false },							\
+    bfd_false, bfd_false, },						\
 									\
   BFD_JUMP_TABLE_GENERIC (coff),					\
   BFD_JUMP_TABLE_COPY (coff),						\
@@ -5664,12 +5665,13 @@ const bfd_target VAR =							\
 									\
 	/* bfd_check_format */						\
   { _bfd_dummy_target, coff_object_p, bfd_generic_archive_p,		\
-    _bfd_dummy_target },						\
+    _bfd_dummy_target, _bfd_dummy_target, },				\
 	/* bfd_set_format */						\
-  { bfd_false, coff_mkobject, _bfd_generic_mkarchive, bfd_false },	\
+  { bfd_false, coff_mkobject, _bfd_generic_mkarchive, 			\
+    bfd_false, bfd_false, },						\
 	/* bfd_write_contents */					\
   { bfd_false, coff_write_object_contents, _bfd_write_archive_contents,	\
-    bfd_false },							\
+    bfd_false, bfd_false, },						\
 									\
   BFD_JUMP_TABLE_GENERIC (coff),					\
   BFD_JUMP_TABLE_COPY (coff),						\
@@ -5712,12 +5714,13 @@ const bfd_target VAR =							\
   bfd_getl16, bfd_getl_signed_16, bfd_putl16,				\
 	/* bfd_check_format */						\
   { _bfd_dummy_target, coff_object_p, bfd_generic_archive_p,		\
-    _bfd_dummy_target },						\
+    _bfd_dummy_target, _bfd_dummy_target, },				\
        /* bfd_set_format */						\
-  { bfd_false, coff_mkobject, _bfd_generic_mkarchive, bfd_false },	\
+  { bfd_false, coff_mkobject, _bfd_generic_mkarchive, bfd_false,	\
+    bfd_false, },							\
 	/* bfd_write_contents */					\
   { bfd_false, coff_write_object_contents, _bfd_write_archive_contents,	\
-    bfd_false },							\
+    bfd_false, bfd_false, },						\
 									\
   BFD_JUMP_TABLE_GENERIC (coff),					\
   BFD_JUMP_TABLE_COPY (coff),						\
Index: elfxx-target.h
===================================================================
RCS file: /cvs/src/src/bfd/elfxx-target.h,v
retrieving revision 1.66
diff -p -u -r1.66 elfxx-target.h
--- elfxx-target.h	21 Jun 2004 14:45:41 -0000	1.66
+++ elfxx-target.h	29 Jun 2004 23:19:20 -0000
@@ -628,24 +628,30 @@ const bfd_target TARGET_BIG_SYM =
     bfd_getb16, bfd_getb_signed_16, bfd_putb16,
 
   /* bfd_check_format: check the format of a file being read */
-  { _bfd_dummy_target,		/* unknown format */
+  {
+    _bfd_dummy_target,		/* unknown format */
     bfd_elfNN_object_p,		/* assembler/linker output (object file) */
     bfd_elfNN_archive_p,	/* an archive */
-    bfd_elfNN_core_file_p	/* a core file */
+    bfd_elfNN_core_file_p,	/* a core file */
+    _bfd_dummy_target,		/* runtime */
   },
 
   /* bfd_set_format: set the format of a file being written */
-  { bfd_false,
+  {
+    bfd_false,
     bfd_elfNN_mkobject,
     bfd_elfNN_mkarchive,
-    bfd_elfNN_mkcorefile
+    bfd_elfNN_mkcorefile,
+    bfd_false,
   },
 
   /* bfd_write_contents: write cached information into a file being written */
-  { bfd_false,
+  {
+    bfd_false,
     bfd_elfNN_write_object_contents,
     bfd_elfNN_write_archive_contents,
     bfd_elfNN_write_corefile_contents,
+    bfd_false,
   },
 
   BFD_JUMP_TABLE_GENERIC (bfd_elfNN),
@@ -724,24 +730,30 @@ const bfd_target TARGET_LITTLE_SYM =
     bfd_getl16, bfd_getl_signed_16, bfd_putl16,
 
   /* bfd_check_format: check the format of a file being read */
-  { _bfd_dummy_target,		/* unknown format */
+  {
+    _bfd_dummy_target,		/* unknown format */
     bfd_elfNN_object_p,		/* assembler/linker output (object file) */
     bfd_elfNN_archive_p,	/* an archive */
-    bfd_elfNN_core_file_p	/* a core file */
+    bfd_elfNN_core_file_p,	/* a core file */
+    _bfd_dummy_target,		/* runtime */
   },
 
   /* bfd_set_format: set the format of a file being written */
-  { bfd_false,
+  {
+    bfd_false,
     bfd_elfNN_mkobject,
     bfd_elfNN_mkarchive,
-    bfd_elfNN_mkcorefile
+    bfd_elfNN_mkcorefile,
+    bfd_false,
   },
 
   /* bfd_write_contents: write cached information into a file being written */
-  { bfd_false,
+  {
+    bfd_false,
     bfd_elfNN_write_object_contents,
     bfd_elfNN_write_archive_contents,
     bfd_elfNN_write_corefile_contents,
+    bfd_false,
   },
 
   BFD_JUMP_TABLE_GENERIC (bfd_elfNN),
Index: i386msdos.c
===================================================================
RCS file: /cvs/src/src/bfd/i386msdos.c,v
retrieving revision 1.16
diff -p -u -r1.16 i386msdos.c
--- i386msdos.c	24 Jun 2004 04:46:23 -0000	1.16
+++ i386msdos.c	29 Jun 2004 23:19:20 -0000
@@ -224,18 +224,21 @@ const bfd_target i386msdos_vec =
       _bfd_dummy_target,		/* bfd_check_format */
       _bfd_dummy_target,
       _bfd_dummy_target,
+      _bfd_dummy_target,
     },
     {
       bfd_false,
       msdos_mkobject,
       _bfd_generic_mkarchive,
       bfd_false,
+      bfd_false,
     },
     {				/* bfd_write_contents */
       bfd_false,
       msdos_write_object_contents,
       _bfd_write_archive_contents,
       bfd_false,
+      bfd_false,
     },
 
     BFD_JUMP_TABLE_GENERIC (msdos),
Index: i386os9k.c
===================================================================
RCS file: /cvs/src/src/bfd/i386os9k.c,v
retrieving revision 1.14
diff -p -u -r1.14 i386os9k.c
--- i386os9k.c	24 Jun 2004 04:46:23 -0000	1.14
+++ i386os9k.c	29 Jun 2004 23:19:20 -0000
@@ -360,12 +360,27 @@ const bfd_target i386os9k_vec =
     bfd_getl64, bfd_getl_signed_64, bfd_putl64,
     bfd_getl32, bfd_getl_signed_32, bfd_putl32,
     bfd_getl16, bfd_getl_signed_16, bfd_putl16,	/* hdrs */
-    {_bfd_dummy_target, os9k_object_p,	/* bfd_check_format */
-     bfd_generic_archive_p, _bfd_dummy_target},
-    {bfd_false, bfd_false,	/* bfd_set_format */
-     _bfd_generic_mkarchive, bfd_false},
-    {bfd_false, bfd_false,	/* bfd_write_contents */
-     _bfd_write_archive_contents, bfd_false},
+    {
+      _bfd_dummy_target,
+      os9k_object_p,	/* bfd_check_format */
+      bfd_generic_archive_p,
+      _bfd_dummy_target,
+      _bfd_dummy_target,
+    },
+    {
+      bfd_false,
+      bfd_false,	/* bfd_set_format */
+      _bfd_generic_mkarchive,
+      bfd_false,
+      bfd_false,
+    },
+    {
+      bfd_false,
+      bfd_false,	/* bfd_write_contents */
+      _bfd_write_archive_contents,
+      bfd_false,
+      bfd_false,
+    },
 
     BFD_JUMP_TABLE_GENERIC (aout_32),
     BFD_JUMP_TABLE_COPY (_bfd_generic),
Index: ieee.c
===================================================================
RCS file: /cvs/src/src/bfd/ieee.c,v
retrieving revision 1.38
diff -p -u -r1.38 ieee.c
--- ieee.c	24 Jun 2004 04:46:23 -0000	1.38
+++ ieee.c	29 Jun 2004 23:19:23 -0000
@@ -4067,22 +4067,26 @@ const bfd_target ieee_vec =
   bfd_getb32, bfd_getb_signed_32, bfd_putb32,
   bfd_getb16, bfd_getb_signed_16, bfd_putb16,	/* hdrs */
 
-  {_bfd_dummy_target,
-   ieee_object_p,		/* bfd_check_format */
-   ieee_archive_p,
-   _bfd_dummy_target,
+  {
+    _bfd_dummy_target,
+    ieee_object_p,		/* bfd_check_format */
+    ieee_archive_p,
+    _bfd_dummy_target,
+    _bfd_dummy_target,
   },
   {
     bfd_false,
     ieee_mkobject,
     _bfd_generic_mkarchive,
-    bfd_false
+    bfd_false,
+    bfd_false,
   },
   {
     bfd_false,
     ieee_write_object_contents,
     _bfd_write_archive_contents,
     bfd_false,
+    bfd_false,
   },
 
   /* ieee_close_and_cleanup, ieee_bfd_free_cached_info, ieee_new_section_hook,
Index: ihex.c
===================================================================
RCS file: /cvs/src/src/bfd/ihex.c,v
retrieving revision 1.23
diff -p -u -r1.23 ihex.c
--- ihex.c	24 Jun 2004 04:46:24 -0000	1.23
+++ ihex.c	29 Jun 2004 23:19:23 -0000
@@ -1022,18 +1022,21 @@ const bfd_target ihex_vec =
     ihex_object_p,		/* bfd_check_format */
     _bfd_dummy_target,
     _bfd_dummy_target,
+    _bfd_dummy_target,
   },
-  {
+  {				/* bfd_set_format */
     bfd_false,
     ihex_mkobject,
     _bfd_generic_mkarchive,
     bfd_false,
+    bfd_false,
   },
   {				/* bfd_write_contents */
     bfd_false,
     ihex_write_object_contents,
     _bfd_write_archive_contents,
     bfd_false,
+    bfd_false,
   },
 
   BFD_JUMP_TABLE_GENERIC (ihex),
Index: irix-core.c
===================================================================
RCS file: /cvs/src/src/bfd/irix-core.c,v
retrieving revision 1.12
diff -p -u -r1.12 irix-core.c
--- irix-core.c	24 Jun 2004 04:46:24 -0000	1.12
+++ irix-core.c	29 Jun 2004 23:19:23 -0000
@@ -331,15 +331,22 @@ const bfd_target irix_core_vec =
       _bfd_dummy_target,		/* unknown format */
       _bfd_dummy_target,		/* object file */
       _bfd_dummy_target,		/* archive */
-      irix_core_core_file_p		/* a core file */
+      irix_core_core_file_p,		/* a core file */
+      _bfd_dummy_target,		/* runtime */
     },
     {				/* bfd_set_format */
-      bfd_false, bfd_false,
-      bfd_false, bfd_false
+      bfd_false,
+      bfd_false,
+      bfd_false,
+      bfd_false,
+      bfd_false,
     },
     {				/* bfd_write_contents */
-      bfd_false, bfd_false,
-      bfd_false, bfd_false
+      bfd_false,
+      bfd_false,
+      bfd_false,
+      bfd_false,
+      bfd_false,
     },
 
     BFD_JUMP_TABLE_GENERIC (_bfd_generic),
Index: mach-o-target.c
===================================================================
RCS file: /cvs/src/src/bfd/mach-o-target.c,v
retrieving revision 1.1
diff -p -u -r1.1 mach-o-target.c
--- mach-o-target.c	6 Nov 2002 13:26:27 -0000	1.1
+++ mach-o-target.c	29 Jun 2004 23:19:24 -0000
@@ -80,11 +80,13 @@ const bfd_target TARGET_NAME =
     _bfd_dummy_target,
     bfd_mach_o_archive_p,
     _bfd_dummy_target,
+    _bfd_dummy_target,
 #else
     _bfd_dummy_target,
     bfd_mach_o_object_p,
     _bfd_dummy_target,
-    bfd_mach_o_core_p
+    bfd_mach_o_core_p,
+    _bfd_dummy_target,
 #endif
   },
   {				/* bfd_set_format.  */
@@ -92,12 +94,14 @@ const bfd_target TARGET_NAME =
     bfd_mach_o_mkobject,
     bfd_false,
     bfd_mach_o_mkobject,
+    bfd_false,
   },
   {				/* bfd_write_contents.  */
     bfd_false,
     bfd_mach_o_write_contents,
     bfd_false,
     bfd_mach_o_write_contents,
+    bfd_false,
   },
 
   BFD_JUMP_TABLE_GENERIC (bfd_mach_o),
Index: mipsbsd.c
===================================================================
RCS file: /cvs/src/src/bfd/mipsbsd.c,v
retrieving revision 1.13
diff -p -u -r1.13 mipsbsd.c
--- mipsbsd.c	30 Nov 2003 18:40:41 -0000	1.13
+++ mipsbsd.c	29 Jun 2004 23:19:24 -0000
@@ -422,12 +422,27 @@ const bfd_target aout_mips_little_vec =
     bfd_getl64, bfd_getl_signed_64, bfd_putl64,
     bfd_getl32, bfd_getl_signed_32, bfd_putl32,
     bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* hdrs */
-    {_bfd_dummy_target, MY_object_p, /* bfd_check_format */
-     bfd_generic_archive_p, MY_core_file_p},
-    {bfd_false, MY_mkobject,	/* bfd_set_format */
-     _bfd_generic_mkarchive, bfd_false},
-    {bfd_false, MY_write_object_contents, /* bfd_write_contents */
-     _bfd_write_archive_contents, bfd_false},
+    {				/* bfd_check_format */
+      _bfd_dummy_target,
+      MY_object_p, /* bfd_check_format */
+      bfd_generic_archive_p,
+      MY_core_file_p,
+      _bfd_dummy_target,
+    },
+    {				/* bfd_set_format */
+      bfd_false,
+      MY_mkobject,	/* bfd_set_format */
+      _bfd_generic_mkarchive,
+      bfd_false,
+      bfd_false,
+    },
+    {				/* bfd_write_contents */
+      bfd_false,
+      MY_write_object_contents, /* bfd_write_contents */
+      _bfd_write_archive_contents,
+      bfd_false,
+      bfd_false,
+    },
 
     BFD_JUMP_TABLE_GENERIC (MY),
     BFD_JUMP_TABLE_COPY (MY),
@@ -463,12 +478,27 @@ const bfd_target aout_mips_big_vec =
     bfd_getb64, bfd_getb_signed_64, bfd_putb64,
     bfd_getb32, bfd_getb_signed_32, bfd_putb32,
     bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* hdrs */
-    {_bfd_dummy_target, MY_object_p, /* bfd_check_format */
-     bfd_generic_archive_p, MY_core_file_p},
-    {bfd_false, MY_mkobject,	/* bfd_set_format */
-     _bfd_generic_mkarchive, bfd_false},
-    {bfd_false, MY_write_object_contents, /* bfd_write_contents */
-     _bfd_write_archive_contents, bfd_false},
+    {				/* bfd_check_format */
+      _bfd_dummy_target,
+      MY_object_p, /* bfd_check_format */
+      bfd_generic_archive_p,
+      MY_core_file_p,
+      _bfd_dummy_target,
+    },
+    {				/* bfd_set_format */
+      bfd_false,
+      MY_mkobject,	/* bfd_set_format */
+      _bfd_generic_mkarchive,
+      bfd_false,
+      bfd_false,
+    },
+    {				/* bfd_write_contents */
+      bfd_false,
+      MY_write_object_contents, /* bfd_write_contents */
+      _bfd_write_archive_contents,
+      bfd_false,
+      bfd_false,
+    },
 
     BFD_JUMP_TABLE_GENERIC (MY),
     BFD_JUMP_TABLE_COPY (MY),
Index: mmo.c
===================================================================
RCS file: /cvs/src/src/bfd/mmo.c,v
retrieving revision 1.19
diff -p -u -r1.19 mmo.c
--- mmo.c	24 Jun 2004 04:46:25 -0000	1.19
+++ mmo.c	29 Jun 2004 23:19:24 -0000
@@ -3339,18 +3339,21 @@ const bfd_target bfd_mmo_vec =
     mmo_object_p,		/* bfd_check_format */
     _bfd_dummy_target,
     _bfd_dummy_target,
+    _bfd_dummy_target,
   },
   {
     bfd_false,
     mmo_mkobject,
     bfd_false,
     bfd_false,
+    bfd_false,
   },
   {				/* bfd_write_contents */
     bfd_false,
     mmo_write_object_contents,
     bfd_false,
     bfd_false,
+    bfd_false,
   },
 
   BFD_JUMP_TABLE_GENERIC (mmo),
Index: netbsd-core.c
===================================================================
RCS file: /cvs/src/src/bfd/netbsd-core.c,v
retrieving revision 1.18
diff -p -u -r1.18 netbsd-core.c
--- netbsd-core.c	24 Jun 2004 04:46:25 -0000	1.18
+++ netbsd-core.c	29 Jun 2004 23:19:24 -0000
@@ -292,15 +292,22 @@ const bfd_target netbsd_core_vec =
       _bfd_dummy_target,		/* Unknown format.  */
       _bfd_dummy_target,		/* Object file.  */
       _bfd_dummy_target,		/* Archive.  */
-      netbsd_core_file_p		/* A core file.  */
+      netbsd_core_file_p,		/* A core file.  */
+      _bfd_dummy_target,		/* Runtime.  */
     },
     {					/* bfd_set_format.  */
-      bfd_false, bfd_false,
-      bfd_false, bfd_false
+      bfd_false,
+      bfd_false,
+      bfd_false,
+      bfd_false,
+      bfd_false,
     },
     {					/* bfd_write_contents.  */
-      bfd_false, bfd_false,
-      bfd_false, bfd_false
+      bfd_false,
+      bfd_false,
+      bfd_false,
+      bfd_false,
+      bfd_false,
     },
 
     BFD_JUMP_TABLE_GENERIC (_bfd_generic),
Index: nlm-target.h
===================================================================
RCS file: /cvs/src/src/bfd/nlm-target.h,v
retrieving revision 1.11
diff -p -u -r1.11 nlm-target.h
--- nlm-target.h	30 Apr 2004 14:23:40 -0000	1.11
+++ nlm-target.h	29 Jun 2004 23:19:24 -0000
@@ -115,24 +115,30 @@ const bfd_target TARGET_BIG_SYM =
     bfd_getb16, bfd_getb_signed_16, bfd_putb16,
 
   /* bfd_check_format: check the format of a file being read */
-  { _bfd_dummy_target,		/* unknown format */
+  {
+    _bfd_dummy_target,		/* unknown format */
     nlmNAME(object_p),		/* assembler/linker output (object file) */
     bfd_generic_archive_p,	/* an archive */
-    nlm_core_file_p		/* a core file */
+    nlm_core_file_p,		/* a core file */
+    _bfd_dummy_target,		/* runtime */
   },
 
   /* bfd_set_format: set the format of a file being written */
-  { bfd_false,
+  {
+    bfd_false,
     nlm_mkobject,
     _bfd_generic_mkarchive,
-    bfd_false
+    bfd_false,
+    bfd_false,
   },
 
   /* bfd_write_contents: write cached information into a file being written */
-  { bfd_false,
+  {
+    bfd_false,
     nlmNAME(write_object_contents),
     _bfd_write_archive_contents,
-    bfd_false
+    bfd_false,
+    bfd_false,
   },
 
   /* Initialize a jump table with the standard macro.  All names start with
@@ -208,24 +214,30 @@ const bfd_target TARGET_LITTLE_SYM =
     bfd_getl16, bfd_getl_signed_16, bfd_putl16,
 
   /* bfd_check_format: check the format of a file being read */
-  { _bfd_dummy_target,		/* unknown format */
+  {
+    _bfd_dummy_target,		/* unknown format */
     nlmNAME(object_p),		/* assembler/linker output (object file) */
     bfd_generic_archive_p,	/* an archive */
-    nlm_core_file_p		/* a core file */
+    nlm_core_file_p,		/* a core file */
+    _bfd_dummy_target,		/* runtime */
   },
 
   /* bfd_set_format: set the format of a file being written */
-  { bfd_false,
+  {
+    bfd_false,
     nlm_mkobject,
     _bfd_generic_mkarchive,
-    bfd_false
+    bfd_false,
+    bfd_false,
   },
 
   /* bfd_write_contents: write cached information into a file being written */
-  { bfd_false,
+  {
+    bfd_false,
     nlmNAME(write_object_contents),
     _bfd_write_archive_contents,
-    bfd_false
+    bfd_false,
+    bfd_false,
   },
 
   /* Initialize a jump table with the standard macro.  All names start with
Index: osf-core.c
===================================================================
RCS file: /cvs/src/src/bfd/osf-core.c,v
retrieving revision 1.12
diff -p -u -r1.12 osf-core.c
--- osf-core.c	24 Jun 2004 04:46:25 -0000	1.12
+++ osf-core.c	29 Jun 2004 23:19:24 -0000
@@ -217,15 +217,22 @@ const bfd_target osf_core_vec =
       _bfd_dummy_target,		/* unknown format */
       _bfd_dummy_target,		/* object file */
       _bfd_dummy_target,		/* archive */
-      osf_core_core_file_p		/* a core file */
+      osf_core_core_file_p,		/* a core file */
+      _bfd_dummy_target,		/* runtime */
     },
     {				/* bfd_set_format */
-      bfd_false, bfd_false,
-      bfd_false, bfd_false
+      bfd_false,
+      bfd_false,
+      bfd_false,
+      bfd_false,
+      bfd_false,
     },
     {				/* bfd_write_contents */
-      bfd_false, bfd_false,
-      bfd_false, bfd_false
+      bfd_false,
+      bfd_false,
+      bfd_false,
+      bfd_false,
+      bfd_false,
     },
 
     BFD_JUMP_TABLE_GENERIC (_bfd_generic),
Index: pdp11.c
===================================================================
RCS file: /cvs/src/src/bfd/pdp11.c,v
retrieving revision 1.23
diff -p -u -r1.23 pdp11.c
--- pdp11.c	24 Jun 2004 04:46:25 -0000	1.23
+++ pdp11.c	29 Jun 2004 23:19:24 -0000
@@ -161,12 +161,27 @@ const bfd_target MY(vec) =
   bfd_getl64, bfd_getl_signed_64, bfd_putl64,
      bfd_getp32, bfd_getp_signed_32, bfd_putp32,
      bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* hdrs */
-    {_bfd_dummy_target, MY_object_p, /* bfd_check_format */
-       bfd_generic_archive_p, MY_core_file_p},
-    {bfd_false, MY_mkobject,	/* bfd_set_format */
-       _bfd_generic_mkarchive, bfd_false},
-    {bfd_false, MY_write_object_contents, /* bfd_write_contents */
-       _bfd_write_archive_contents, bfd_false},
+  {
+    _bfd_dummy_target,
+    MY_object_p, /* bfd_check_format */
+    bfd_generic_archive_p,
+    MY_core_file_p,
+    _bfd_dummy_target,
+  },
+  {
+    bfd_false,
+    MY_mkobject,	/* bfd_set_format */
+    _bfd_generic_mkarchive,
+    bfd_false,
+    bfd_false,
+  },
+  {
+    bfd_false,
+    MY_write_object_contents, /* bfd_write_contents */
+    _bfd_write_archive_contents,
+    bfd_false,
+    bfd_false,
+  },
 
      BFD_JUMP_TABLE_GENERIC (MY),
      BFD_JUMP_TABLE_COPY (MY),
Index: pe-mips.c
===================================================================
RCS file: /cvs/src/src/bfd/pe-mips.c,v
retrieving revision 1.12
diff -p -u -r1.12 pe-mips.c
--- pe-mips.c	24 Apr 2004 06:12:24 -0000	1.12
+++ pe-mips.c	29 Jun 2004 23:19:24 -0000
@@ -953,12 +953,27 @@ const bfd_target
      bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* hdrs */
 
 /* Note that we allow an object file to be treated as a core file as well.  */
-    {_bfd_dummy_target, coff_object_p, /* bfd_check_format */
-       bfd_generic_archive_p, coff_object_p},
-    {bfd_false, coff_mkobject, _bfd_generic_mkarchive, /* bfd_set_format */
-       bfd_false},
-    {bfd_false, coff_write_object_contents, /* bfd_write_contents */
-       _bfd_write_archive_contents, bfd_false},
+  {
+    _bfd_dummy_target,
+    coff_object_p, /* bfd_check_format */
+    bfd_generic_archive_p,
+    coff_object_p,
+    _bfd_dummy_target,
+  },
+  {
+    bfd_false,
+    coff_mkobject,
+    _bfd_generic_mkarchive, /* bfd_set_format */
+    bfd_false,
+    bfd_false,
+  },
+  {
+    bfd_false,
+    coff_write_object_contents, /* bfd_write_contents */
+    _bfd_write_archive_contents,
+    bfd_false,
+    bfd_false,
+  },
 
      BFD_JUMP_TABLE_GENERIC (coff),
      BFD_JUMP_TABLE_COPY (coff),
Index: pef.c
===================================================================
RCS file: /cvs/src/src/bfd/pef.c,v
retrieving revision 1.8
diff -p -u -r1.8 pef.c
--- pef.c	24 Jun 2004 04:46:25 -0000	1.8
+++ pef.c	29 Jun 2004 23:19:24 -0000
@@ -1105,18 +1105,21 @@ const bfd_target pef_vec =
     bfd_pef_object_p,		/* bfd_check_format */
     _bfd_dummy_target,
     _bfd_dummy_target,
+    _bfd_dummy_target,
   },
   {				/* bfd_set_format */
     bfd_false,
     bfd_pef_mkobject,
     bfd_false,
     bfd_false,
+    bfd_false,
   },
   {				/* bfd_write_contents */
     bfd_false,
     bfd_true,
     bfd_false,
     bfd_false,
+    bfd_false,
   },
 
   BFD_JUMP_TABLE_GENERIC (bfd_pef),
@@ -1263,18 +1266,21 @@ const bfd_target pef_xlib_vec =
     bfd_pef_xlib_object_p,	/* bfd_check_format */
     _bfd_dummy_target,
     _bfd_dummy_target,
+    _bfd_dummy_target,
   },
   {				/* bfd_set_format */
     bfd_false,
     bfd_pef_mkobject,
     bfd_false,
     bfd_false,
+    bfd_false,
   },
   {				/* bfd_write_contents */
     bfd_false,
     bfd_true,
     bfd_false,
     bfd_false,
+    bfd_false,
   },
 
   BFD_JUMP_TABLE_GENERIC (bfd_pef_xlib),
Index: ppcboot.c
===================================================================
RCS file: /cvs/src/src/bfd/ppcboot.c,v
retrieving revision 1.19
diff -p -u -r1.19 ppcboot.c
--- ppcboot.c	24 Jun 2004 04:46:25 -0000	1.19
+++ ppcboot.c	29 Jun 2004 23:19:24 -0000
@@ -511,18 +511,21 @@ const bfd_target ppcboot_vec =
     ppcboot_object_p,		/* bfd_check_format */
     _bfd_dummy_target,
     _bfd_dummy_target,
+    _bfd_dummy_target,
   },
   {				/* bfd_set_format */
     bfd_false,
     ppcboot_mkobject,
     bfd_false,
     bfd_false,
+    bfd_false,
   },
   {				/* bfd_write_contents */
     bfd_false,
     bfd_true,
     bfd_false,
     bfd_false,
+    bfd_false,
   },
 
   BFD_JUMP_TABLE_GENERIC (ppcboot),
Index: ptrace-core.c
===================================================================
RCS file: /cvs/src/src/bfd/ptrace-core.c,v
retrieving revision 1.11
diff -p -u -r1.11 ptrace-core.c
--- ptrace-core.c	24 Jun 2004 04:46:25 -0000	1.11
+++ ptrace-core.c	29 Jun 2004 23:19:24 -0000
@@ -199,15 +199,22 @@ const bfd_target ptrace_core_vec =
       _bfd_dummy_target,		/* unknown format */
       _bfd_dummy_target,		/* object file */
       _bfd_dummy_target,		/* archive */
-      ptrace_unix_core_file_p		/* a core file */
+      ptrace_unix_core_file_p,		/* a core file */
+      _bfd_dummy_target,		/* runtime */
     },
     {				/* bfd_set_format */
-      bfd_false, bfd_false,
-      bfd_false, bfd_false
+      bfd_false,
+      bfd_false,
+      bfd_false,
+      bfd_false,
+      bfd_false,
     },
     {				/* bfd_write_contents */
-      bfd_false, bfd_false,
-      bfd_false, bfd_false
+      bfd_false,
+      bfd_false,
+      bfd_false,
+      bfd_false,
+      bfd_false,
     },
 
     BFD_JUMP_TABLE_GENERIC (_bfd_generic),
Index: som.c
===================================================================
RCS file: /cvs/src/src/bfd/som.c,v
retrieving revision 1.45
diff -p -u -r1.45 som.c
--- som.c	25 Jun 2004 18:30:54 -0000	1.45
+++ som.c	29 Jun 2004 23:19:25 -0000
@@ -6427,22 +6427,26 @@ const bfd_target som_vec = {
   bfd_getb64, bfd_getb_signed_64, bfd_putb64,
   bfd_getb32, bfd_getb_signed_32, bfd_putb32,
   bfd_getb16, bfd_getb_signed_16, bfd_putb16,	/* hdrs */
-  {_bfd_dummy_target,
-   som_object_p,		/* bfd_check_format */
-   bfd_generic_archive_p,
-   _bfd_dummy_target
+  {				/* bfd_check_format */
+    _bfd_dummy_target,
+    som_object_p,		/* bfd_check_format */
+    bfd_generic_archive_p,
+    _bfd_dummy_target,
+    _bfd_dummy_target,
   },
-  {
+  {				/* bfd_set_format */
     bfd_false,
     som_mkobject,
     _bfd_generic_mkarchive,
-    bfd_false
+    bfd_false,
+    bfd_false,
   },
-  {
+  {				/* bfd_write_contents */
     bfd_false,
     som_write_object_contents,
     _bfd_write_archive_contents,
     bfd_false,
+    bfd_false,
   },
 #undef som
 
Index: srec.c
===================================================================
RCS file: /cvs/src/src/bfd/srec.c,v
retrieving revision 1.29
diff -p -u -r1.29 srec.c
--- srec.c	24 Jun 2004 04:46:26 -0000	1.29
+++ srec.c	29 Jun 2004 23:19:25 -0000
@@ -1319,18 +1319,21 @@ const bfd_target srec_vec =
     srec_object_p,		/* bfd_check_format */
     _bfd_dummy_target,
     _bfd_dummy_target,
+    _bfd_dummy_target,
   },
   {
     bfd_false,
     srec_mkobject,
     _bfd_generic_mkarchive,
     bfd_false,
+    bfd_false,
   },
   {				/* bfd_write_contents */
     bfd_false,
     srec_write_object_contents,
     _bfd_write_archive_contents,
     bfd_false,
+    bfd_false,
   },
 
   BFD_JUMP_TABLE_GENERIC (srec),
@@ -1374,18 +1377,21 @@ const bfd_target symbolsrec_vec =
     symbolsrec_object_p,	/* bfd_check_format */
     _bfd_dummy_target,
     _bfd_dummy_target,
+    _bfd_dummy_target,
   },
   {
     bfd_false,
     srec_mkobject,
     _bfd_generic_mkarchive,
     bfd_false,
+    bfd_false,
   },
   {				/* bfd_write_contents */
     bfd_false,
     symbolsrec_write_object_contents,
     _bfd_write_archive_contents,
     bfd_false,
+    bfd_false,
   },
 
   BFD_JUMP_TABLE_GENERIC (srec),
Index: tekhex.c
===================================================================
RCS file: /cvs/src/src/bfd/tekhex.c,v
retrieving revision 1.20
diff -p -u -r1.20 tekhex.c
--- tekhex.c	24 Jun 2004 04:46:26 -0000	1.20
+++ tekhex.c	29 Jun 2004 23:19:25 -0000
@@ -1039,18 +1039,21 @@ const bfd_target tekhex_vec =
     tekhex_object_p,		/* bfd_check_format */
     _bfd_dummy_target,
     _bfd_dummy_target,
+    _bfd_dummy_target,
   },
-  {
+  {				/* bfd_set_format */
     bfd_false,
     tekhex_mkobject,
     _bfd_generic_mkarchive,
     bfd_false,
+    bfd_false,
   },
   {				/* bfd_write_contents */
     bfd_false,
     tekhex_write_object_contents,
     _bfd_write_archive_contents,
     bfd_false,
+    bfd_false,
   },
 
   BFD_JUMP_TABLE_GENERIC (tekhex),
Index: versados.c
===================================================================
RCS file: /cvs/src/src/bfd/versados.c,v
retrieving revision 1.22
diff -p -u -r1.22 versados.c
--- versados.c	24 Jun 2004 04:46:26 -0000	1.22
+++ versados.c	29 Jun 2004 23:19:25 -0000
@@ -907,18 +907,21 @@ const bfd_target versados_vec =
     versados_object_p,		/* bfd_check_format */
     _bfd_dummy_target,
     _bfd_dummy_target,
+    _bfd_dummy_target,
   },
-  {
+  {				/* bfd_set_format */
     bfd_false,
     versados_mkobject,
     _bfd_generic_mkarchive,
     bfd_false,
+    bfd_false,
   },
   {				/* bfd_write_contents */
     bfd_false,
     bfd_false,
     _bfd_write_archive_contents,
     bfd_false,
+    bfd_false,
   },
 
   BFD_JUMP_TABLE_GENERIC (versados),
Index: vms.c
===================================================================
RCS file: /cvs/src/src/bfd/vms.c,v
retrieving revision 1.30
diff -p -u -r1.30 vms.c
--- vms.c	24 Jun 2004 04:46:26 -0000	1.30
+++ vms.c	29 Jun 2004 23:19:25 -0000
@@ -195,12 +195,27 @@ const bfd_target vms_alpha_vec =
   bfd_getl32, bfd_getl_signed_32, bfd_putl32,
   bfd_getl16, bfd_getl_signed_16, bfd_putl16,
 
-  {_bfd_dummy_target, vms_object_p,		/* bfd_check_format */
-   vms_archive_p, _bfd_dummy_target},
-  {bfd_false, vms_mkobject,			/* bfd_set_format */
-   _bfd_generic_mkarchive, bfd_false},
-  {bfd_false, vms_write_object_contents,	/* bfd_write_contents */
-   _bfd_write_archive_contents, bfd_false},
+  {
+    _bfd_dummy_target,
+    vms_object_p,		/* bfd_check_format */
+    vms_archive_p,
+    _bfd_dummy_target,
+    _bfd_dummy_target,
+  },
+  {
+    bfd_false,
+    vms_mkobject,			/* bfd_set_format */
+    _bfd_generic_mkarchive,
+    bfd_false,
+    bfd_false,
+  },
+  {
+    bfd_false,
+    vms_write_object_contents,	/* bfd_write_contents */
+    _bfd_write_archive_contents,
+    bfd_false,
+    bfd_false,
+  },
 
   BFD_JUMP_TABLE_GENERIC (vms),
   BFD_JUMP_TABLE_COPY (vms),
@@ -241,12 +256,27 @@ const bfd_target vms_vax_vec =
   bfd_getl32, bfd_getl_signed_32, bfd_putl32,
   bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* hdrs */
 
-  {_bfd_dummy_target, vms_object_p,		/* bfd_check_format */
-   vms_archive_p, _bfd_dummy_target},
-  {bfd_false, vms_mkobject,			/* bfd_set_format */
-   _bfd_generic_mkarchive, bfd_false},
-  {bfd_false, vms_write_object_contents,	/* bfd_write_contents */
-   _bfd_write_archive_contents, bfd_false},
+  {
+    _bfd_dummy_target,
+    vms_object_p,		/* bfd_check_format */
+    vms_archive_p,
+    _bfd_dummy_target,
+    _bfd_dummy_target,
+  },
+  {
+    bfd_false,
+    vms_mkobject,			/* bfd_set_format */
+    _bfd_generic_mkarchive,
+    bfd_false,
+    bfd_false,
+  },
+  {
+    bfd_false,
+    vms_write_object_contents,	/* bfd_write_contents */
+    _bfd_write_archive_contents,
+    bfd_false,
+    bfd_false,
+  },
 
   BFD_JUMP_TABLE_GENERIC (vms),
   BFD_JUMP_TABLE_COPY (vms),
Index: xcoff-target.h
===================================================================
RCS file: /cvs/src/src/bfd/xcoff-target.h,v
retrieving revision 1.9
diff -p -u -r1.9 xcoff-target.h
--- xcoff-target.h	30 Nov 2002 08:39:40 -0000	1.9
+++ xcoff-target.h	29 Jun 2004 23:19:25 -0000
@@ -173,12 +173,27 @@ const bfd_target TARGET_SYM =
      bfd_getb32, bfd_getb_signed_32, bfd_putb32,
      bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* hdrs */
 
-  {_bfd_dummy_target, coff_object_p, 	/* bfd_check_format */
-     _bfd_xcoff_archive_p, CORE_FILE_P},
-  {bfd_false, coff_mkobject,		/* bfd_set_format */
-     _bfd_generic_mkarchive, bfd_false},
-  {bfd_false, coff_write_object_contents,	/* bfd_write_contents */
-     _bfd_xcoff_write_archive_contents, bfd_false},
+  {
+    _bfd_dummy_target,
+    coff_object_p, 	/* bfd_check_format */
+    _bfd_xcoff_archive_p,
+    CORE_FILE_P,
+    _bfd_dummy_target,
+  },
+  {
+    bfd_false,
+    coff_mkobject,		/* bfd_set_format */
+    _bfd_generic_mkarchive,
+    bfd_false,
+    bfd_false,
+  },
+  {
+    bfd_false,
+    coff_write_object_contents,	/* bfd_write_contents */
+    _bfd_xcoff_write_archive_contents,
+    bfd_false,
+    bfd_false,
+  },
 
      BFD_JUMP_TABLE_GENERIC (coff),
      BFD_JUMP_TABLE_COPY (coff),
Index: xsym.c
===================================================================
RCS file: /cvs/src/src/bfd/xsym.c,v
retrieving revision 1.7
diff -p -u -r1.7 xsym.c
--- xsym.c	24 Jun 2004 04:46:27 -0000	1.7
+++ xsym.c	29 Jun 2004 23:19:26 -0000
@@ -2451,7 +2451,8 @@ const bfd_target sym_vec =
   bfd_getb16, bfd_getb_signed_16, bfd_putb16,	/* hdrs */
   {				/* bfd_check_format */
     _bfd_dummy_target,
-    bfd_sym_object_p,		/* bfd_check_format */
+    bfd_sym_object_p,
+    _bfd_dummy_target,
     _bfd_dummy_target,
     _bfd_dummy_target,
   },
@@ -2460,12 +2461,14 @@ const bfd_target sym_vec =
     bfd_sym_mkobject,
     bfd_false,
     bfd_false,
+    bfd_false,
   },
   {				/* bfd_write_contents */
     bfd_false,
     bfd_true,
     bfd_false,
     bfd_false,
+    bfd_false,
   },
 
   BFD_JUMP_TABLE_GENERIC (bfd_sym),

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

* Re: [rfa] Add bfd_runtime
  2004-06-29 23:47 [rfa] Add bfd_runtime Andrew Cagney
@ 2004-06-30  2:08 ` Ian Lance Taylor
  2004-06-30 14:18   ` Andrew Cagney
  0 siblings, 1 reply; 18+ messages in thread
From: Ian Lance Taylor @ 2004-06-30  2:08 UTC (permalink / raw)
  To: Andrew Cagney; +Cc: binutils

Andrew Cagney <ac131313@redhat.com> writes:

> This follows up an earlier thread by adding the bfd_format type
> bfd_runtime.  It just pads out all the architecture vectors, not doing
> anything useful.

I'm sorry, I completely misunderstood what you were talking about
earlier.  I don't see why this is the right approach.  The fact that
file contents are stored in memory does not make that file any
different from a file stored on disk.  It is presumably still an
object file, and the contents of the file are presumably still
organized like an object file.  It seems to me that the format should
be bfd_object.

Thinking in terms of adding support for a new object file format to
BFD, what would the entries for bfd_runtime be?  How can you recognize
a file as bfd_runtime rather than bfd_object?  The concept of
bfd_runtime seems to me to be orthogonal to the concept of bfd_format.

I didn't read your earlier e-mail messages closely, and I thought that
what you were going to do was add a new iovec type.  That makes sense
to me.  I don't see why you need anything else.

If your only concern is to avoid requiring an ELF specific routine in
BFD, then the usual BFD approach is shown by bfd_get_gp_size() and
similar functions.  Those functions check the flavour, and then call
the appropriate backend routine.

Ian

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

* Re: [rfa] Add bfd_runtime
  2004-06-30  2:08 ` Ian Lance Taylor
@ 2004-06-30 14:18   ` Andrew Cagney
  2004-06-30 14:36     ` Ian Lance Taylor
  0 siblings, 1 reply; 18+ messages in thread
From: Andrew Cagney @ 2004-06-30 14:18 UTC (permalink / raw)
  To: Ian Lance Taylor; +Cc: binutils

Here's the thread: New bfd file format bfd_image ....
http://sources.redhat.com/ml/binutils/2004-05/msg00049.html
http://sources.redhat.com/ml/binutils/2004-06/msg00002.html

> Andrew Cagney <ac131313@redhat.com> writes:
> 
> 
>>> This follows up an earlier thread by adding the bfd_format type
>>> bfd_runtime.  It just pads out all the architecture vectors, not doing
>>> anything useful.
> 
> 
> I'm sorry, I completely misunderstood what you were talking about
> earlier.  I don't see why this is the right approach.  The fact that
> file contents are stored in memory does not make that file any
> different from a file stored on disk.  It is presumably still an
> object file, and the contents of the file are presumably still
> organized like an object file.  It seems to me that the format should
> be bfd_object.

The contents are organized differently.  It's the in-memory runtime 
image so things are organized acccording to their load address and not 
their on-disk file offset.

> Thinking in terms of adding support for a new object file format to
> BFD, what would the entries for bfd_runtime be?  How can you recognize
> a file as bfd_runtime rather than bfd_object?  The concept of
> bfd_runtime seems to me to be orthogonal to the concept of bfd_format.

Do you need to differentiate between the two?

> I didn't read your earlier e-mail messages closely, and I thought that
> what you were going to do was add a new iovec type.  That makes sense
> to me.  I don't see why you need anything else.

Can you expand on what you mean here?  Are you suggesting the two step 
process:

- create an iovec that maps ``on-disk'' offsets onto ``in-memory'' 
offsets.  That way the client thinks its reading the on-disk image when 
it isn't.

- create a bfd_object using this iovec

That first operation is format dependant (as in the ELF, XCOFF, and 
a.out NMAGIC versions would all involve different code but the same 
basic operation).

> If your only concern is to avoid requiring an ELF specific routine in
> BFD, then the usual BFD approach is shown by bfd_get_gp_size() and
> similar functions.  Those functions check the flavour, and then call
> the appropriate backend routine.

The objective is to get a clean and efficient mechanism for examining 
shared library information from a running program.  vsyscall is one 
reason, gcj is expected to be a second.

The current code re-creates the bfd_object reading the entire contents 
into local memory and then uses that to create abfd-in-memory.  Not very 
efficient.

(BTW, bfd_get_gp_size doesn't _call_ a backend routine, it just refers 
to a back-end macro.  Is there another example?)

Andrew

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

* Re: [rfa] Add bfd_runtime
  2004-06-30 14:18   ` Andrew Cagney
@ 2004-06-30 14:36     ` Ian Lance Taylor
  2004-07-06 13:55       ` Andrew Cagney
  0 siblings, 1 reply; 18+ messages in thread
From: Ian Lance Taylor @ 2004-06-30 14:36 UTC (permalink / raw)
  To: Andrew Cagney; +Cc: binutils

Andrew Cagney <ac131313@redhat.com> writes:

> > I'm sorry, I completely misunderstood what you were talking about
> > earlier.  I don't see why this is the right approach.  The fact that
> > file contents are stored in memory does not make that file any
> > different from a file stored on disk.  It is presumably still an
> > object file, and the contents of the file are presumably still
> > organized like an object file.  It seems to me that the format should
> > be bfd_object.
> 
> The contents are organized differently.  It's the in-memory runtime
> image so things are organized acccording to their load address and not
> their on-disk file offset.

Sure.  But it is still essentially an object-file/executable.  At
least, I thought that was the idea of the in-memory image: that it
would look like an object-file/executable, it would have symbols and
sections and segments, etc.

> > Thinking in terms of adding support for a new object file format to
> > BFD, what would the entries for bfd_runtime be?  How can you recognize
> > a file as bfd_runtime rather than bfd_object?  The concept of
> > bfd_runtime seems to me to be orthogonal to the concept of bfd_format.
> 
> Do you need to differentiate between the two?

I don't understand this question.

> > I didn't read your earlier e-mail messages closely, and I thought that
> > what you were going to do was add a new iovec type.  That makes sense
> > to me.  I don't see why you need anything else.
> 
> Can you expand on what you mean here?  Are you suggesting the two step
> process:
> 
> - create an iovec that maps ``on-disk'' offsets onto ``in-memory''
> offsets.  That way the client thinks its reading the on-disk image
> when it isn't.
> 
> - create a bfd_object using this iovec

Yes.

> That first operation is format dependant (as in the ELF, XCOFF, and
> a.out NMAGIC versions would all involve different code but the same
> basic operation).

Let's not start thinking that we will ever have to do this for
anything other than ELF.  Even if we some day do, we can still handle
via the bfd_get_gp_size() approach.

> > If your only concern is to avoid requiring an ELF specific routine in
> > BFD, then the usual BFD approach is shown by bfd_get_gp_size() and
> > similar functions.  Those functions check the flavour, and then call
> > the appropriate backend routine.
> 
> The objective is to get a clean and efficient mechanism for examining
> shared library information from a running program.  vsyscall is one
> reason, gcj is expected to be a second.
> 
> The current code re-creates the bfd_object reading the entire contents
> into local memory and then uses that to create abfd-in-memory.  Not
> very efficient.

It seems to me that the proper iovec routines could handle this
without copying the contents.

> (BTW, bfd_get_gp_size doesn't _call_ a backend routine, it just refers
> to a back-end macro.  Is there another example?)

It's effectively the same thing, though, by looking at
bfd_elf_bfd_from_remote_memory():

  if (bfd_get_flavour (abfd) == bfd_target_elf_flavour)
    return ((*get_elf_backend_data (abfd)->elf_backend_bfd_from_remote_memory)
            (templ, ehdr_vma, loadbasep, target_read_memory));

Ian

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

* Re: [rfa] Add bfd_runtime
  2004-06-30 14:36     ` Ian Lance Taylor
@ 2004-07-06 13:55       ` Andrew Cagney
  2004-07-13  2:38         ` Ian Lance Taylor
  0 siblings, 1 reply; 18+ messages in thread
From: Andrew Cagney @ 2004-07-06 13:55 UTC (permalink / raw)
  To: Ian Lance Taylor; +Cc: Andrew Cagney, binutils

> Andrew Cagney <ac131313@redhat.com> writes:
> 
> 
>>>> > I'm sorry, I completely misunderstood what you were talking about
>>>> > earlier.  I don't see why this is the right approach.  The fact that
>>>> > file contents are stored in memory does not make that file any
>>>> > different from a file stored on disk.  It is presumably still an
>>>> > object file, and the contents of the file are presumably still
>>>> > organized like an object file.  It seems to me that the format should
>>>> > be bfd_object.
>>
>>> 
>>> The contents are organized differently.  It's the in-memory runtime
>>> image so things are organized acccording to their load address and not
>>> their on-disk file offset.
> 
> 
> Sure.  But it is still essentially an object-file/executable.  At
> least, I thought that was the idea of the in-memory image: that it
> would look like an object-file/executable, it would have symbols and
> sections and segments, etc.

It has symbols and sections and segments but is laid out very 
differently.  Things are accessed according to their in-memory rather 
than on-disk offset. (however the current code doesn't do this, it 
reverse engineers things back into what is kind of sort of an on disk 
image).

>>>> > Thinking in terms of adding support for a new object file format to
>>>> > BFD, what would the entries for bfd_runtime be?  How can you recognize
>>>> > a file as bfd_runtime rather than bfd_object?  The concept of
>>>> > bfd_runtime seems to me to be orthogonal to the concept of bfd_format.
>>
>>> 
>>> Do you need to differentiate between the two?
> 
> 
> I don't understand this question.

Creating a new bfd is a two step process:
- open the raw file
- check the format creating a bfd from the raw file
The second step, using bfd_check_format, typically includes an explicit 
format specifier.

For this "runtime", the code needs to know that it is manipulating a 
loaded, rather than on-disk image.  Without that it won't know that the 
load rather than file offsets need to be used.

So given that the code needs to be explicitly told that it is a runtime, 
why do you see the need to recognize a bfd_runtime rather than bfd_object?

>>>> > I didn't read your earlier e-mail messages closely, and I thought that
>>>> > what you were going to do was add a new iovec type.  That makes sense
>>>> > to me.  I don't see why you need anything else.
>>
>>> 
>>> Can you expand on what you mean here?  Are you suggesting the two step
>>> process:
>>> 
>>> - create an iovec that maps ``on-disk'' offsets onto ``in-memory''
>>> offsets.  That way the client thinks its reading the on-disk image
>>> when it isn't.
>>> 
>>> - create a bfd_object using this iovec
> 
> 
> Yes.
> 
> 
>>> That first operation is format dependant (as in the ELF, XCOFF, and
>>> a.out NMAGIC versions would all involve different code but the same
>>> basic operation).
> 
> 
> Let's not start thinking that we will ever have to do this for
> anything other than ELF.  Even if we some day do, we can still handle
> via the bfd_get_gp_size() approach.
> 
> 
>>>> > If your only concern is to avoid requiring an ELF specific routine in
>>>> > BFD, then the usual BFD approach is shown by bfd_get_gp_size() and
>>>> > similar functions.  Those functions check the flavour, and then call
>>>> > the appropriate backend routine.

This assumes that there is already a bfd against which the flavour can 
be checked - and and more are a problem.  What we're ment to be doing is 
creating a new bfd starting from scratch using information extracted 
from the images header.  _bfd_elf,bfd_from_remote_memory doesn't do 
this, instead assuming the caller already knows what the image will be 
supplying it in TEMPL.

>>> The objective is to get a clean and efficient mechanism for examining
>>> shared library information from a running program.  vsyscall is one
>>> reason, gcj is expected to be a second.
>>> 
>>> The current code re-creates the bfd_object reading the entire contents
>>> into local memory and then uses that to create abfd-in-memory.  Not
>>> very efficient.
> 
> 
> It seems to me that the proper iovec routines could handle this
> without copying the contents.

Right.

Andrew


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

* Re: [rfa] Add bfd_runtime
  2004-07-06 13:55       ` Andrew Cagney
@ 2004-07-13  2:38         ` Ian Lance Taylor
  2004-09-20 23:14           ` Andrew Cagney
  0 siblings, 1 reply; 18+ messages in thread
From: Ian Lance Taylor @ 2004-07-13  2:38 UTC (permalink / raw)
  To: Andrew Cagney; +Cc: binutils

Andrew Cagney <ac131313@redhat.com> writes:

> >>> The contents are organized differently.  It's the in-memory runtime
> >>> image so things are organized acccording to their load address and not
> >>> their on-disk file offset.
> > Sure.  But it is still essentially an object-file/executable.  At
> > least, I thought that was the idea of the in-memory image: that it
> > would look like an object-file/executable, it would have symbols and
> > sections and segments, etc.
> 
> It has symbols and sections and segments but is laid out very
> differently.  Things are accessed according to their in-memory rather
> than on-disk offset. (however the current code doesn't do this, it
> reverse engineers things back into what is kind of sort of an on disk
> image).

I understand that it is laid out differently.  Since I don't think
that is at all relevant, we are clearly failing to communicate.

There are many different kinds of object files, ELF and otherwise.
They are all laid out differently.  They all have the same sorts of
information.  From BFD's perspective, anything with that sort of
information is properly categorized as bfd_object.

The information which you are describing has the sort of information
which an object file has.  From BFD's perspective, it seems to me that
it should be bfd_object.

If the layout is sufficiently different, then perhaps the problem is
that is should use a different target vector--it should be
"elfmem32-i386" rather than "elf32-i386".  But I can not understand
why a different layout would suggest not using bfd_object.

Let me put it another way: can you explain what the difference is
between bfd_object and bfd_runtime, in terms of the difference between
bfd_object and bfd_archive and bfd_core.

> >>>> > Thinking in terms of adding support for a new object file format to
> >>>> > BFD, what would the entries for bfd_runtime be?  How can you recognize
> >>>> > a file as bfd_runtime rather than bfd_object?  The concept of
> >>>> > bfd_runtime seems to me to be orthogonal to the concept of bfd_format.
> >>
> >>> Do you need to differentiate between the two?
> > I don't understand this question.
> 
> Creating a new bfd is a two step process:
> - open the raw file
> - check the format creating a bfd from the raw file
> The second step, using bfd_check_format, typically includes an
> explicit format specifier.
> 
> For this "runtime", the code needs to know that it is manipulating a
> loaded, rather than on-disk image.  Without that it won't know that
> the load rather than file offsets need to be used.
> 
> So given that the code needs to be explicitly told that it is a
> runtime, why do you see the need to recognize a bfd_runtime rather
> than bfd_object?

I don't.  My point was that even talking about the question doesn't
make any sense.  My implied conclusion was that bfd_runtime is not a
proper format type.

Ian

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

* Re: [rfa] Add bfd_runtime
  2004-07-13  2:38         ` Ian Lance Taylor
@ 2004-09-20 23:14           ` Andrew Cagney
  2004-09-21  0:57             ` Ian Lance Taylor
  0 siblings, 1 reply; 18+ messages in thread
From: Andrew Cagney @ 2004-09-20 23:14 UTC (permalink / raw)
  To: Ian Lance Taylor; +Cc: binutils

[back to this thread, sorry]

> Andrew Cagney <ac131313@redhat.com> writes:
> 
> 
>>>>>> >>> The contents are organized differently.  It's the in-memory runtime
>>>>>> >>> image so things are organized acccording to their load address and not
>>>>>> >>> their on-disk file offset.
>>>
>>>> > Sure.  But it is still essentially an object-file/executable.  At
>>>> > least, I thought that was the idea of the in-memory image: that it
>>>> > would look like an object-file/executable, it would have symbols and
>>>> > sections and segments, etc.
>>
>>> 
>>> It has symbols and sections and segments but is laid out very
>>> differently.  Things are accessed according to their in-memory rather
>>> than on-disk offset. (however the current code doesn't do this, it
>>> reverse engineers things back into what is kind of sort of an on disk
>>> image).
> 
> 
> I understand that it is laid out differently.  Since I don't think
> that is at all relevant, we are clearly failing to communicate.
> 
> There are many different kinds of object files, ELF and otherwise.
> They are all laid out differently.  They all have the same sorts of
> information.  From BFD's perspective, anything with that sort of
> information is properly categorized as bfd_object.
> 
> The information which you are describing has the sort of information
> which an object file has.  From BFD's perspective, it seems to me that
> it should be bfd_object.
> 
> If the layout is sufficiently different, then perhaps the problem is
> that is should use a different target vector--it should be
> "elfmem32-i386" rather than "elf32-i386".  But I can not understand
> why a different layout would suggest not using bfd_object.
> 
> Let me put it another way: can you explain what the difference is
> between bfd_object and bfd_runtime, in terms of the difference between
> bfd_object and bfd_archive and bfd_core.

In terms of the relationships between various so called "format"s, I 
view things along the lines of:
	objfile is-a object is-a bfd
	runtime is-a object is-a bfd
	corefile is-a object is-a bfd
yet:
	bfd_archive is-a bfd
	bfd_archive has-a 1:N <object-file>
so BFD's currrent structure doesn't show real consistency :-/
(Relationships such as bfd_core is-a bfd_runtime don't hold.)

When it comes to how it should fit in, I think it can be viewed as:
	elf-target has-a runtime-object
	elf-target has-a corefile-object
	elf-target has-a objfile-object
and:
	elf32-i386 is-a elf-target
Hence, I think runtime fits better into the "format" vector as that 
makes that relationship possible.  Yes, it is also possible to 
brute-force this using "elfmem32-i386" et.al. targets.

Andrew

> 
>>>>>>>> >>>> > Thinking in terms of adding support for a new object file format to
>>>>>>>> >>>> > BFD, what would the entries for bfd_runtime be?  How can you recognize
>>>>>>>> >>>> > a file as bfd_runtime rather than bfd_object?  The concept of
>>>>>>>> >>>> > bfd_runtime seems to me to be orthogonal to the concept of bfd_format.
>>>>
>>>>> >>
>>>>
>>>>>> >>> Do you need to differentiate between the two?
>>>
>>>> > I don't understand this question.
>>
>>> 
>>> Creating a new bfd is a two step process:
>>> - open the raw file
>>> - check the format creating a bfd from the raw file
>>> The second step, using bfd_check_format, typically includes an
>>> explicit format specifier.
>>> 
>>> For this "runtime", the code needs to know that it is manipulating a
>>> loaded, rather than on-disk image.  Without that it won't know that
>>> the load rather than file offsets need to be used.
>>> 
>>> So given that the code needs to be explicitly told that it is a
>>> runtime, why do you see the need to recognize a bfd_runtime rather
>>> than bfd_object?
> 
> 
> I don't.  My point was that even talking about the question doesn't
> make any sense.  My implied conclusion was that bfd_runtime is not a
> proper format type.
> 
> Ian

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

* Re: [rfa] Add bfd_runtime
  2004-09-20 23:14           ` Andrew Cagney
@ 2004-09-21  0:57             ` Ian Lance Taylor
  2004-09-21  1:38               ` DJ Delorie
                                 ` (2 more replies)
  0 siblings, 3 replies; 18+ messages in thread
From: Ian Lance Taylor @ 2004-09-21  0:57 UTC (permalink / raw)
  To: Andrew Cagney; +Cc: binutils

Andrew Cagney <ac131313@redhat.com> writes:

> In terms of the relationships between various so called "format"s, I
> view things along the lines of:
> 	objfile is-a object is-a bfd
> 	runtime is-a object is-a bfd
> 	corefile is-a object is-a bfd
> yet:
> 	bfd_archive is-a bfd
> 	bfd_archive has-a 1:N <object-file>
> so BFD's currrent structure doesn't show real consistency :-/
> (Relationships such as bfd_core is-a bfd_runtime don't hold.)

I think you are looking for the wrong sort of consistency.  For better
or worse, everything that BFD manipulates is a bfd.  There are
(currently) three types of BFD: object, archive, core.  The three
different types support fundamentally different operations.
  * object supports bfd_map_over_sections(), bfd_canonicalize_reloc(),
    etc., etc.
  * archive supports bfd_set_archive_head(),
    bfd_openr_next_archived_file(), etc.
  * core supports bfd_core_file_failing_command(),
    core_file_matches_executable_p(), etc.

(core also supports bfd_map_over_sections(), although it is a
different operation for core files than for object files.  In ELF, for
core, bfd_map_over_sections() maps over ELF segments, not ELF
sections.  In the traditional core file format,
bfd_map_over_sections() maps over information stored in struct user.
In both cases, there are special register sections which are nothing
like any section in an object file.)

In other words, the fact that everything is a BFD is misleading.  BFD
manipulates three fundamentally different types of files.  There are
obvious similarities between the file types--that is why they are all
BFDs--but there are significant differences which can not be
overlooked.

My understanding is that the runtime images which you are talking
about are just like object files.  They will support the same types of
operations, at least on the read side.  That is why I think the
correct bfd_format setting for runtime images is bfd_object.

> When it comes to how it should fit in, I think it can be viewed as:
> 	elf-target has-a runtime-object
> 	elf-target has-a corefile-object
> 	elf-target has-a objfile-object
> and:
> 	elf32-i386 is-a elf-target
> Hence, I think runtime fits better into the "format" vector as that
> makes that relationship possible.  Yes, it is also possible to
> brute-force this using "elfmem32-i386" et.al. targets.

I could just as easily, and, at least to my mind, just as justifiably,
say
    elf-target has-a object-file
    elf-target has-a executable-file
    elf-target has-a shared-library-file
and conclude that we should expand bfd_format to distinguish object
files, executables, and shared libraries.  After all, there are
obvious differences between object files, executable files, and shared
libraries, and I think those differences are just as profound as the
difference between a regular .o file and the runtime image of a .o
file.  So I don't buy this particular argument that you are making.

Ian

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

* Re: [rfa] Add bfd_runtime
  2004-09-21  0:57             ` Ian Lance Taylor
@ 2004-09-21  1:38               ` DJ Delorie
  2004-10-06 22:56                 ` Andrew Cagney
  2004-09-21  8:38               ` Andreas Schwab
  2004-10-06 23:22               ` Andrew Cagney
  2 siblings, 1 reply; 18+ messages in thread
From: DJ Delorie @ 2004-09-21  1:38 UTC (permalink / raw)
  To: ian; +Cc: ac131313, binutils


> My understanding is that the runtime images which you are talking
> about are just like object files.

Why wouldn't an in-memory execution image be a corefile type?  It
can't be *that* different than an on-disk execution image.  GDB treats
the two similarly, bfd should too.

And, as a bonus, it's actually in core!  ;-)

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

* Re: [rfa] Add bfd_runtime
  2004-09-21  0:57             ` Ian Lance Taylor
  2004-09-21  1:38               ` DJ Delorie
@ 2004-09-21  8:38               ` Andreas Schwab
  2004-10-06 23:22               ` Andrew Cagney
  2 siblings, 0 replies; 18+ messages in thread
From: Andreas Schwab @ 2004-09-21  8:38 UTC (permalink / raw)
  To: binutils; +Cc: ac131313

Ian Lance Taylor <ian@wasabisystems.com> writes:

> I could just as easily, and, at least to my mind, just as justifiably,
> say
>     elf-target has-a object-file
>     elf-target has-a executable-file
>     elf-target has-a shared-library-file
> and conclude that we should expand bfd_format to distinguish object
> files, executables, and shared libraries.

But then, executables and shared libraries are not very different from
each other either.  Both can be executed, both are runtime relocated, and
neither are linktime relocatable.

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux AG, Maxfeldstraße 5, 90409 Nürnberg, Germany
Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

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

* Re: [rfa] Add bfd_runtime
  2004-09-21  1:38               ` DJ Delorie
@ 2004-10-06 22:56                 ` Andrew Cagney
  0 siblings, 0 replies; 18+ messages in thread
From: Andrew Cagney @ 2004-10-06 22:56 UTC (permalink / raw)
  To: DJ Delorie; +Cc: ian, ac131313, binutils

[back to this]

>>> My understanding is that the runtime images which you are talking
>>> about are just like object files.
> 
> 
> Why wouldn't an in-memory execution image be a corefile type?  It
> can't be *that* different than an on-disk execution image.  GDB treats
> the two similarly, bfd should too.

A corefile may contain, in one of its segments, an in-memory image.
A corefile doesn't contain recoverable debug sections, an in-memory 
image is expected to.

> And, as a bonus, it's actually in core!  ;-)

Andrew


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

* Re: [rfa] Add bfd_runtime
  2004-09-21  0:57             ` Ian Lance Taylor
  2004-09-21  1:38               ` DJ Delorie
  2004-09-21  8:38               ` Andreas Schwab
@ 2004-10-06 23:22               ` Andrew Cagney
  2004-10-07  5:16                 ` Ian Lance Taylor
  2 siblings, 1 reply; 18+ messages in thread
From: Andrew Cagney @ 2004-10-06 23:22 UTC (permalink / raw)
  To: Ian Lance Taylor; +Cc: Andrew Cagney, binutils

> Andrew Cagney <ac131313@redhat.com> writes:
> 
> 
>>> In terms of the relationships between various so called "format"s, I
>>> view things along the lines of:
>>> 	objfile is-a object is-a bfd
>>> 	runtime is-a object is-a bfd
>>> 	corefile is-a object is-a bfd
>>> yet:
>>> 	bfd_archive is-a bfd
>>> 	bfd_archive has-a 1:N <object-file>
>>> so BFD's currrent structure doesn't show real consistency :-/
>>> (Relationships such as bfd_core is-a bfd_runtime don't hold.)
> 
> 
> I think you are looking for the wrong sort of consistency.  For better
> or worse, everything that BFD manipulates is a bfd.  There are
> (currently) three types of BFD: object, archive, core.  The three
> different types support fundamentally different operations.
>   * object supports bfd_map_over_sections(), bfd_canonicalize_reloc(),
>     etc., etc.
>   * archive supports bfd_set_archive_head(),
>     bfd_openr_next_archived_file(), etc.
>   * core supports bfd_core_file_failing_command(),
>     core_file_matches_executable_p(), etc.
> 
> (core also supports bfd_map_over_sections(), although it is a
> different operation for core files than for object files.  In ELF, for
> core, bfd_map_over_sections() maps over ELF segments, not ELF
> sections.  In the traditional core file format,
> bfd_map_over_sections() maps over information stored in struct user.
> In both cases, there are special register sections which are nothing
> like any section in an object file.)

> In other words, the fact that everything is a BFD is misleading.  BFD
> manipulates three fundamentally different types of files.  There are
> obvious similarities between the file types--that is why they are all
> BFDs--but there are significant differences which can not be
> overlooked.
> 
> My understanding is that the runtime images which you are talking
> about are just like object files.  They will support the same types of
> operations, at least on the read side.  That is why I think the
> correct bfd_format setting for runtime images is bfd_object.

Let me see if I've got this:

objfile - iterate over sections
corefile - iterate over segments
archive - ???

For runtime, bfd_map_over_sections needs to do something different again 
create a list of sections using offset information obtained from the 
segment table.

That can either be done in two stages; reverse map in-memory segments to 
on-disk image, open pseudo on-disk image as an object file; or a single 
direct stage where the "sections" describe the in memory offsets.

The latter, which I think is an operation unlike any of the above, is 
what I'm trying to implement.

>>> When it comes to how it should fit in, I think it can be viewed as:
>>> 	elf-target has-a runtime-object
>>> 	elf-target has-a corefile-object
>>> 	elf-target has-a objfile-object
>>> and:
>>> 	elf32-i386 is-a elf-target
>>> Hence, I think runtime fits better into the "format" vector as that
>>> makes that relationship possible.  Yes, it is also possible to
>>> brute-force this using "elfmem32-i386" et.al. targets.
> 
> 
> I could just as easily, and, at least to my mind, just as justifiably,
> say
>     elf-target has-a object-file
>     elf-target has-a executable-file
>     elf-target has-a shared-library-file
> and conclude that we should expand bfd_format to distinguish object
> files, executables, and shared libraries.  After all, there are
> obvious differences between object files, executable files, and shared
> libraries, and I think those differences are just as profound as the
> difference between a regular .o file and the runtime image of a .o
> file.  So I don't buy this particular argument that you are making.

So how would you solve this problem?  Given a memory access method and a 
starting offset, construct a bfd containing a list of sections 
constructed using both the segment and section information in the inferior?

Andrew


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

* Re: [rfa] Add bfd_runtime
  2004-10-06 23:22               ` Andrew Cagney
@ 2004-10-07  5:16                 ` Ian Lance Taylor
  2004-10-07 15:15                   ` Daniel Jacobowitz
  2004-10-07 19:12                   ` Andrew Cagney
  0 siblings, 2 replies; 18+ messages in thread
From: Ian Lance Taylor @ 2004-10-07  5:16 UTC (permalink / raw)
  To: Andrew Cagney; +Cc: binutils

Andrew Cagney <cagney@gnu.org> writes:

> Let me see if I've got this:
> 
> objfile - iterate over sections
> corefile - iterate over segments
> archive - ???

archive - iterate over objfiles

> So how would you solve this problem?  Given a memory access method and
> a starting offset, construct a bfd containing a list of sections
> constructed using both the segment and section information in the
> inferior?

I would write a new BFD target vector; e.g., elf32-i386-runtime.

Ian

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

* Re: [rfa] Add bfd_runtime
  2004-10-07  5:16                 ` Ian Lance Taylor
@ 2004-10-07 15:15                   ` Daniel Jacobowitz
  2004-10-07 15:54                     ` Ian Lance Taylor
  2004-10-07 19:12                   ` Andrew Cagney
  1 sibling, 1 reply; 18+ messages in thread
From: Daniel Jacobowitz @ 2004-10-07 15:15 UTC (permalink / raw)
  To: binutils; +Cc: cagney

On Thu, Oct 07, 2004 at 01:16:03AM -0400, Ian Lance Taylor wrote:
> Andrew Cagney <cagney@gnu.org> writes:
> 
> > Let me see if I've got this:
> > 
> > objfile - iterate over sections
> > corefile - iterate over segments
> > archive - ???
> 
> archive - iterate over objfiles
> 
> > So how would you solve this problem?  Given a memory access method and
> > a starting offset, construct a bfd containing a list of sections
> > constructed using both the segment and section information in the
> > inferior?
> 
> I would write a new BFD target vector; e.g., elf32-i386-runtime.

Ugh, is that really necessary?  It would mean architecture-specific
code to support this generic ELF concept, and I don't see any useful
hooks in the elf backend vector anyway...

-- 
Daniel Jacobowitz

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

* Re: [rfa] Add bfd_runtime
  2004-10-07 15:15                   ` Daniel Jacobowitz
@ 2004-10-07 15:54                     ` Ian Lance Taylor
  0 siblings, 0 replies; 18+ messages in thread
From: Ian Lance Taylor @ 2004-10-07 15:54 UTC (permalink / raw)
  To: Daniel Jacobowitz; +Cc: binutils, cagney

Daniel Jacobowitz <drow@false.org> writes:

> > > So how would you solve this problem?  Given a memory access method and
> > > a starting offset, construct a bfd containing a list of sections
> > > constructed using both the segment and section information in the
> > > inferior?
> > 
> > I would write a new BFD target vector; e.g., elf32-i386-runtime.
> 
> Ugh, is that really necessary?  It would mean architecture-specific
> code to support this generic ELF concept, and I don't see any useful
> hooks in the elf backend vector anyway...

I'm not arguing for architecture-specific code.  The code should be
written in a generic way to support any architecture, and
elf32-i386-runtime would just be a modification of elf32-i386 which
called this new generic code to dig up the runtime information.

My argument is just that we should have a different target vector for
this type of thing.  I'm basing this on Andrew's description of what
is needed, and on his arguments for introducing bfd_runtime as a
parallel to bfd_object, et. al.

Ian

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

* Re: [rfa] Add bfd_runtime
  2004-10-07  5:16                 ` Ian Lance Taylor
  2004-10-07 15:15                   ` Daniel Jacobowitz
@ 2004-10-07 19:12                   ` Andrew Cagney
  2004-10-08  2:04                     ` Ian Lance Taylor
  1 sibling, 1 reply; 18+ messages in thread
From: Andrew Cagney @ 2004-10-07 19:12 UTC (permalink / raw)
  To: Ian Lance Taylor; +Cc: binutils

> Andrew Cagney <cagney@gnu.org> writes:
> 
> 
>>> Let me see if I've got this:
>>> 
>>> objfile - iterate over sections
>>> corefile - iterate over segments
>>> archive - ???
> 
> 
> archive - iterate over objfiles

(I wondered)

But what of this:

> For runtime, bfd_map_over_sections needs to do something different again create a list of sections using offset information obtained from the segment table.
> 
> That can either be done in two stages; reverse map in-memory segments to on-disk image, open pseudo on-disk image as an object file; or a single direct stage where the "sections" describe the in memory offsets.
> 
> The latter, which I think is an operation unlike any of the above, is what I'm trying to implement.

Do you concure that the operation is unlike any of the above?

> Daniel Jacobowitz <drow@false.org> writes:
> 
> 
>>>>> > > So how would you solve this problem?  Given a memory access method and
>>>>> > > a starting offset, construct a bfd containing a list of sections
>>>>> > > constructed using both the segment and section information in the
>>>>> > > inferior?
>>>
>>>> > 
>>>> > I would write a new BFD target vector; e.g., elf32-i386-runtime.
>>
>>> 
>>> Ugh, is that really necessary?  It would mean architecture-specific
>>> code to support this generic ELF concept, and I don't see any useful
>>> hooks in the elf backend vector anyway...

Yep, ulgh.

> I'm not arguing for architecture-specific code.  The code should be
> written in a generic way to support any architecture, and
> elf32-i386-runtime would just be a modification of elf32-i386 which
> called this new generic code to dig up the runtime information.

How?  Without adding to BFD's existing macro #include hell?  This is 
needed for all elf object formats.

> My argument is just that we should have a different target vector for
> this type of thing.  I'm basing this on Andrew's description of what
> is needed, and on his arguments for introducing bfd_runtime as a
> parallel to bfd_object, et. al.

Andrew


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

* Re: [rfa] Add bfd_runtime
  2004-10-07 19:12                   ` Andrew Cagney
@ 2004-10-08  2:04                     ` Ian Lance Taylor
  0 siblings, 0 replies; 18+ messages in thread
From: Ian Lance Taylor @ 2004-10-08  2:04 UTC (permalink / raw)
  To: Andrew Cagney; +Cc: binutils

Andrew Cagney <cagney@gnu.org> writes:

> But what of this:
> 
> > For runtime, bfd_map_over_sections needs to do something different again create a list of sections using offset information obtained from the segment table.
> > That can either be done in two stages; reverse map in-memory
> > segments to on-disk image, open pseudo on-disk image as an object
> > file; or a single direct stage where the "sections" describe the in
> > memory offsets.
> > The latter, which I think is an operation unlike any of the above,
> > is what I'm trying to implement.
> 
> Do you concure that the operation is unlike any of the above?

In terms of how the information is obtained, sure.  In terms of how
the information is used, no.

> > I'm not arguing for architecture-specific code.  The code should be
> > written in a generic way to support any architecture, and
> > elf32-i386-runtime would just be a modification of elf32-i386 which
> > called this new generic code to dig up the runtime information.
> 
> How?  Without adding to BFD's existing macro #include hell?  This is
> needed for all elf object formats.

You can use the pre-existing #include hell; you just need to add a
bfd_target at the end of elfxx-target.h.

Ian

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

* Re: [rfa] Add bfd_runtime
@ 2004-10-07 16:48 James Cownie
  0 siblings, 0 replies; 18+ messages in thread
From: James Cownie @ 2004-10-07 16:48 UTC (permalink / raw)
  To: binutils


This whole thing seems the wrong way to solve the fundamental problem to
me.

As I understand it the root problem is that the kernel and the dynamic
linker are pretending to have linked a file into the image, but the
pretence is incomplete.

If the kernel (or maybe even the installation) were to make the contents
of the vDSO available as a file (either by providing it in /sys, or
/proc, or simply by having some code which ran at boot time which copied
the vDSO out and saved it somewhere well known), then

 1) The dynamic linker could fill in a perfectly normal rmap entry for
    the vDSO.

 2) Any clients (such as gdb) which depend on the rmap entries could
    simply read the file like any other shared object.

 3) There'd be no need for magic BFDs

 4) The code to implement this would be less than has already been
    written to handle the fact that it's missing, and, probably less
    than the new code which is being proposed.

The main problems I see with this approach are

 1) It cuts across separate projects (so it needs either kernel or
    distribution work and some in libc).

 2) For kernels which use multiple vDSOs in a single running kernel
    instance there will need to be a way of obtaining the appropriate
    vDSO.

It's relatively simple to write a piece of code to extract the vDSO from
its own address space and write it to a file, so if such a userspace
program could be run at some point in the boot process no kernel changes
would be needed, and the issues are reduced to choices of file names and
so on (which, of course, are harder than writing code ;-(

-- 
-- Jim
--
James Cownie	<jcownie@etnus.com>
Etnus, LLC.     +44 117 9071438
http://www.etnus.com


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

end of thread, other threads:[~2004-10-08  2:04 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-06-29 23:47 [rfa] Add bfd_runtime Andrew Cagney
2004-06-30  2:08 ` Ian Lance Taylor
2004-06-30 14:18   ` Andrew Cagney
2004-06-30 14:36     ` Ian Lance Taylor
2004-07-06 13:55       ` Andrew Cagney
2004-07-13  2:38         ` Ian Lance Taylor
2004-09-20 23:14           ` Andrew Cagney
2004-09-21  0:57             ` Ian Lance Taylor
2004-09-21  1:38               ` DJ Delorie
2004-10-06 22:56                 ` Andrew Cagney
2004-09-21  8:38               ` Andreas Schwab
2004-10-06 23:22               ` Andrew Cagney
2004-10-07  5:16                 ` Ian Lance Taylor
2004-10-07 15:15                   ` Daniel Jacobowitz
2004-10-07 15:54                     ` Ian Lance Taylor
2004-10-07 19:12                   ` Andrew Cagney
2004-10-08  2:04                     ` Ian Lance Taylor
2004-10-07 16:48 James Cownie

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