diff options
author | Alan Modra <amodra@gmail.com> | 2024-12-11 10:26:27 +1030 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2024-12-12 16:04:51 +1030 |
commit | e3fa5cf492e09dc0e4041263751720c73799a3cd (patch) | |
tree | 89b138c332a3df3839a1e4ad97e6198da17253a3 | |
parent | 338c58cac6ea08a8ec90a06496054fcf9e45d094 (diff) | |
download | binutils-e3fa5cf492e09dc0e4041263751720c73799a3cd.zip binutils-e3fa5cf492e09dc0e4041263751720c73799a3cd.tar.gz binutils-e3fa5cf492e09dc0e4041263751720c73799a3cd.tar.bz2 |
Revert bfd_use_reserved_id patch
Commit fc1cfaa5f1 and bc110b6e40 were made to avoid testsuite
regressions on a number of targets that used bfd id in symbol hashing.
Since it no longer seems necessary to start plugin bfd id's from -1
and count down, revert the functional changes in those patches.
-rw-r--r-- | bfd/bfd-in2.h | 3 | ||||
-rw-r--r-- | bfd/opncls.c | 19 | ||||
-rw-r--r-- | ld/plugin.c | 1 |
3 files changed, 2 insertions, 21 deletions
diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h index 092a658..8cc255b 100644 --- a/bfd/bfd-in2.h +++ b/bfd/bfd-in2.h @@ -3007,9 +3007,6 @@ bool bfd_merge_private_bfd_data (ibfd, info)) /* Extracted from opncls.c. */ -/* Set to N to open the next N BFDs using an alternate id space. */ -extern unsigned int bfd_use_reserved_id; - bfd *bfd_fopen (const char *filename, const char *target, const char *mode, int fd); diff --git a/bfd/opncls.c b/bfd/opncls.c index bc76696..dd0afaa 100644 --- a/bfd/opncls.c +++ b/bfd/opncls.c @@ -45,18 +45,9 @@ SUBSECTION Functions for opening and closing */ -/* Counters used to initialize the bfd identifier. */ +/* Counter used to initialize the unique bfd identifier. */ static unsigned int bfd_id_counter = 0; -static unsigned int bfd_reserved_id_counter = 0; - -/* -EXTERNAL -.{* Set to N to open the next N BFDs using an alternate id space. *} -.extern unsigned int bfd_use_reserved_id; -. -*/ -unsigned int bfd_use_reserved_id = 0; /* fdopen is a loser -- we should use stdio exclusively. Unfortunately if we do that we can't use fcntl. */ @@ -83,13 +74,7 @@ _bfd_new_bfd (void) if (!bfd_lock ()) return NULL; - if (bfd_use_reserved_id) - { - nbfd->id = --bfd_reserved_id_counter; - --bfd_use_reserved_id; - } - else - nbfd->id = bfd_id_counter++; + nbfd->id = bfd_id_counter++; if (!bfd_unlock ()) { free (nbfd); diff --git a/ld/plugin.c b/ld/plugin.c index 2cd0279..2c3fcb7 100644 --- a/ld/plugin.c +++ b/ld/plugin.c @@ -318,7 +318,6 @@ plugin_get_ir_dummy_bfd (const char *name, bfd *srctemplate) bfd *abfd; bool bfd_plugin_target; - bfd_use_reserved_id = 1; bfd_plugin_target = bfd_plugin_target_p (srctemplate->xvec); abfd = bfd_create (concat (name, IRONLY_SUFFIX, (const char *) NULL), bfd_plugin_target ? link_info.output_bfd : srctemplate); |