summaryrefslogtreecommitdiff
path: root/bfd/opncls.c
diff options
context:
space:
mode:
authorAlexandre Oliva <aoliva@redhat.com>2003-01-27 23:40:39 +0000
committerAlexandre Oliva <aoliva@redhat.com>2003-01-27 23:40:39 +0000
commit0bff8dcc0b4d1797acb9320839c14c79717c29e1 (patch)
tree8fac6bdef47ae816de2f6617ee8036b28cc9f83c /bfd/opncls.c
parentefc0ba892b670813ab1dde1098100b341f7c43be (diff)
downloadgdb-0bff8dcc0b4d1797acb9320839c14c79717c29e1.tar.gz
* bfd.c (struct _bfd): Added id field.
* opncls.c (_bfd_id_counter): New static variable. (_bfd_new_bfd): Use it. * bfd-in2.h: Rebuilt.
Diffstat (limited to 'bfd/opncls.c')
-rw-r--r--bfd/opncls.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/bfd/opncls.c b/bfd/opncls.c
index 32d223ebb74..c24438820bd 100644
--- a/bfd/opncls.c
+++ b/bfd/opncls.c
@@ -36,6 +36,10 @@
#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)
{