* bfd.c (struct _bfd): Added id field.
authorAlexandre Oliva <aoliva@redhat.com>
Mon, 27 Jan 2003 23:40:39 +0000 (23:40 +0000)
committerAlexandre Oliva <aoliva@redhat.com>
Mon, 27 Jan 2003 23:40:39 +0000 (23:40 +0000)
* opncls.c (_bfd_id_counter): New static variable.
(_bfd_new_bfd): Use it.
* bfd-in2.h: Rebuilt.

bfd/ChangeLog
bfd/bfd-in2.h
bfd/bfd.c
bfd/opncls.c

index c4102ee35380fba1f724126fc210e976fd8d0332..79941e5b33c6db453591fd66e837dfd2fdfb3756 100644 (file)
@@ -1,3 +1,10 @@
+2003-01-27  Alexandre Oliva  <aoliva@redhat.com>
+
+       * bfd.c (struct _bfd): Added id field.
+       * opncls.c (_bfd_id_counter): New static variable.
+       (_bfd_new_bfd): Use it.
+       * bfd-in2.h: Rebuilt.
+
 2003-01-25  Alan Modra  <amodra@bigpond.net.au>
 
        * elf32-sparc.c (bfd_elf32_new_section_hook): Define.
index 84ef8017ead988320a1bf2f68ec673eba5953498..25f2f96c7187d71e88790d4d1797cd59a55d32e5 100644 (file)
@@ -3536,6 +3536,9 @@ bfd_copy_private_symbol_data PARAMS ((bfd *ibfd, asymbol *isym, bfd *obfd, asymb
 /* Extracted from bfd.c.  */
 struct _bfd
 {
+  /* A unique identifier of the BFD  */
+  unsigned int id;
+
   /* The filename the application opened the BFD with.  */
   const char *filename;
 
index f9051c0d585d9999a6d2334a18b872f1f2acfa54..1a332a866b20888e6ce8745353b9cae3f44d62a9 100644 (file)
--- a/bfd/bfd.c
+++ b/bfd/bfd.c
@@ -36,6 +36,9 @@ CODE_FRAGMENT
 .
 .struct _bfd
 .{
+.  {* A unique identifier of the BFD  *}
+.  unsigned int id;
+.
 .  {* The filename the application opened the BFD with.  *}
 .  const char *filename;
 .
index 32d223ebb74aeb2cc4a9cfeb09c8caf7a2e550e4..c24438820bd4f537bd2f7389e7fc4c60eed7ac21 100644 (file)
 #define S_IXOTH 0001   /* Execute by others.  */
 #endif
 
+/* Counter used to initialize the bfd identifier.  */
+
+static unsigned int _bfd_id_counter = 0;
+
 /* fdopen is a loser -- we should use stdio exclusively.  Unfortunately
    if we do that we can't use fcntl.  */
 
@@ -50,6 +54,8 @@ _bfd_new_bfd ()
   if (nbfd == NULL)
     return NULL;
 
+  nbfd->id = _bfd_id_counter++;
+
   nbfd->memory = (PTR) objalloc_create ();
   if (nbfd->memory == NULL)
     {
This page took 0.03137 seconds and 4 git commands to generate.