diff options
author | Alexandre Oliva <aoliva@redhat.com> | 2003-01-27 23:40:39 +0000 |
---|---|---|
committer | Alexandre Oliva <aoliva@redhat.com> | 2003-01-27 23:40:39 +0000 |
commit | 52b69c9e01afa3fffa5f9e83d7e560f47610d651 (patch) | |
tree | 1e37986d00a6ab87bb94c6cbde27545cfbc98c6b /bfd | |
parent | a4cb6c4d873314478195509d38117def417889d8 (diff) | |
download | gdb-52b69c9e01afa3fffa5f9e83d7e560f47610d651.zip gdb-52b69c9e01afa3fffa5f9e83d7e560f47610d651.tar.gz gdb-52b69c9e01afa3fffa5f9e83d7e560f47610d651.tar.bz2 |
* 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')
-rw-r--r-- | bfd/ChangeLog | 7 | ||||
-rw-r--r-- | bfd/bfd-in2.h | 3 | ||||
-rw-r--r-- | bfd/bfd.c | 3 | ||||
-rw-r--r-- | bfd/opncls.c | 6 |
4 files changed, 19 insertions, 0 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index c4102ee..79941e5 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -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. diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h index 84ef801..25f2f96 100644 --- a/bfd/bfd-in2.h +++ b/bfd/bfd-in2.h @@ -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; @@ -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; . diff --git a/bfd/opncls.c b/bfd/opncls.c index 32d223e..c244388 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) { |