From 35fd2ddeb1d90f1750401cfb6d01fe055656b88d Mon Sep 17 00:00:00 2001 From: Rudy Date: Mon, 14 Nov 2016 16:30:45 +0000 Subject: [PATCH] Generate correct hint value for IDATA6. PR binutils/20814 * dlltool.c (struct export): Remove hint field. (make_one_lib_file): Store the ordinal value for IDATA6 not the hint. (gen_lib_file): Delete reference to hint field. (mangle_defs): Delete computation of hint field. --- binutils/ChangeLog | 9 +++++++++ binutils/dlltool.c | 21 +++++---------------- 2 files changed, 14 insertions(+), 16 deletions(-) diff --git a/binutils/ChangeLog b/binutils/ChangeLog index 4c4bb6b..3347bdb 100644 --- a/binutils/ChangeLog +++ b/binutils/ChangeLog @@ -1,3 +1,12 @@ +2016-11-14 Rudy + + PR binutils/20814 + * dlltool.c (struct export): Remove hint field. + (make_one_lib_file): Store the ordinal value for IDATA6 not the + hint. + (gen_lib_file): Delete reference to hint field. + (mangle_defs): Delete computation of hint field. + 2016-11-11 Nick Clifton PR binutils/20751 diff --git a/binutils/dlltool.c b/binutils/dlltool.c index e7b40ee..4cde91a 100644 --- a/binutils/dlltool.c +++ b/binutils/dlltool.c @@ -780,10 +780,9 @@ 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 hint; - int forward; /* Number of forward label, 0 means no forward. */ + int forward; /* Number of forward label, 0 means no forward. */ struct export *next; } export_type; @@ -2776,10 +2775,8 @@ make_one_lib_file (export_type *exp, int i, int delay) case IDATA6: if (!exp->noname) { - /* 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; + int idx = exp->ordinal; + if (exp->its_name) si->size = strlen (exp->its_name) + 3; else @@ -3263,7 +3260,6 @@ 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); @@ -3927,10 +3923,8 @@ mangle_defs (void) { /* First work out the minimum ordinal chosen. */ export_type *exp; - - int i; - int hint = 0; export_type **d_export_vec = xmalloc (sizeof (export_type *) * d_nfuncs); + int i; inform (_("Processing definitions")); @@ -3959,11 +3953,6 @@ 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")); } -- 2.7.4