aboutsummaryrefslogtreecommitdiff
path: root/binutils
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2024-06-26 13:17:25 +0100
committerNick Clifton <nickc@redhat.com>2024-06-26 13:17:25 +0100
commit057a2b4c4b57ef495dd32c9087e4af28bda41737 (patch)
tree786c186658cf26b13839680cc6d36b1b6d6ffc07 /binutils
parentcbccccfdf19a388abb10579aea42c8b35c25c933 (diff)
downloadgdb-057a2b4c4b57ef495dd32c9087e4af28bda41737.zip
gdb-057a2b4c4b57ef495dd32c9087e4af28bda41737.tar.gz
gdb-057a2b4c4b57ef495dd32c9087e4af28bda41737.tar.bz2
Revert: 35fd2ddeb1d90f1750401cfb6d01fe055656b88d
PR 20814
Diffstat (limited to 'binutils')
-rw-r--r--binutils/dlltool.c21
-rw-r--r--binutils/doc/binutils.texi2
2 files changed, 17 insertions, 6 deletions
diff --git a/binutils/dlltool.c b/binutils/dlltool.c
index 7a3d20f..2c37ad3 100644
--- a/binutils/dlltool.c
+++ b/binutils/dlltool.c
@@ -784,9 +784,10 @@ typedef struct export
int ordinal;
int constant;
int noname; /* Don't put name in image file. */
- int private; /* Don't put reference in import lib. */
+ int private; /* Don't put reference in import lib. */
int data;
- int forward; /* Number of forward label, 0 means no forward. */
+ int hint;
+ int forward; /* Number of forward label, 0 means no forward. */
struct export *next;
}
export_type;
@@ -2697,8 +2698,10 @@ make_one_lib_file (export_type *exp, int i, int delay)
case IDATA6:
if (!exp->noname)
{
- int idx = exp->ordinal;
-
+ /* This used to add 1 to exp->hint. I don't know
+ why it did that, and it does not match what I see
+ in programs compiled with the MS tools. */
+ int idx = exp->hint;
if (exp->its_name)
si->size = strlen (exp->its_name) + 3;
else
@@ -3058,6 +3061,7 @@ gen_lib_file (int delay)
alias_exp.noname = exp->noname;
alias_exp.private = exp->private;
alias_exp.data = exp->data;
+ alias_exp.hint = exp->hint;
alias_exp.forward = exp->forward;
alias_exp.next = exp->next;
n = make_one_lib_file (&alias_exp, i + PREFIX_ALIAS_BASE, delay);
@@ -3711,8 +3715,10 @@ mangle_defs (void)
{
/* First work out the minimum ordinal chosen. */
export_type *exp;
- export_type **d_export_vec = xmalloc (sizeof (export_type *) * d_nfuncs);
+
int i;
+ int hint = 0;
+ export_type **d_export_vec = xmalloc (sizeof (export_type *) * d_nfuncs);
inform (_("Processing definitions"));
@@ -3741,6 +3747,11 @@ mangle_defs (void)
qsort (d_exports_lexically, i, sizeof (export_type *), nfunc);
+ /* Fill exp entries with their hint values. */
+ for (i = 0; i < d_nfuncs; i++)
+ if (!d_exports_lexically[i]->noname || show_allnames)
+ d_exports_lexically[i]->hint = hint++;
+
inform (_("Processed definitions"));
}
diff --git a/binutils/doc/binutils.texi b/binutils/doc/binutils.texi
index c78c9e3..2b13a4b 100644
--- a/binutils/doc/binutils.texi
+++ b/binutils/doc/binutils.texi
@@ -457,7 +457,7 @@ Specify dependencies of this library. The dependencies must immediately
follow this option character, must use the same syntax as the linker
command line, and must be specified within a single argument. I.e., if
multiple items are needed, they must be quoted to form a single command
-line argument. For example @samp{L "-L/usr/local/lib -lmydep1 -lmydep2"}
+line argument. For example @samp{l "-L/usr/local/lib -lmydep1 -lmydep2"}
@item N
Uses the @var{count} parameter. This is used if there are multiple