diff options
author | Dave Korn <dave.korn@artimi.com> | 2010-06-09 18:17:10 +0000 |
---|---|---|
committer | Dave Korn <dave.korn@artimi.com> | 2010-06-09 18:17:10 +0000 |
commit | 75898d578fc3f6d808600583c9251abaa6a962f5 (patch) | |
tree | 3f12aee501312477d4b18cca142fbfd59596d234 | |
parent | 55881a11e8e03416fbb6541bbbe3ba30a12faba0 (diff) | |
download | gdb-75898d578fc3f6d808600583c9251abaa6a962f5.zip gdb-75898d578fc3f6d808600583c9251abaa6a962f5.tar.gz gdb-75898d578fc3f6d808600583c9251abaa6a962f5.tar.bz2 |
PR ld/11603
* pe-dll.c (process_def_file_and_drectve): Reorder check for
forwarded export name after check for ordinary export.
-rw-r--r-- | ld/ChangeLog | 6 | ||||
-rw-r--r-- | ld/pe-dll.c | 44 |
2 files changed, 28 insertions, 22 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog index 25452fb..c7f5202 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,9 @@ +2010-06-09 Dave Korn <dave.korn.cygwin@gmail.com> + + PR ld/11603 + * pe-dll.c (process_def_file_and_drectve): Reorder check for + forwarded export name after check for ordinary export. + 2010-06-08 Bernd Schmidt <bernds@codesourcery.com> * emulparams/elf32_tic6x_le.sh (OTHER_BSS_SECTIONS): New. diff --git a/ld/pe-dll.c b/ld/pe-dll.c index 5048c20..47722b6 100644 --- a/ld/pe-dll.c +++ b/ld/pe-dll.c @@ -871,28 +871,6 @@ process_def_file_and_drectve (bfd *abfd ATTRIBUTE_UNUSED, struct bfd_link_info * for (i = 0; i < NE; i++) { char *name; - - /* Check for forward exports */ - if (strchr (pe_def_file->exports[i].internal_name, '.')) - { - count_exported++; - if (!pe_def_file->exports[i].flag_noname) - count_exported_byname++; - - pe_def_file->exports[i].flag_forward = 1; - - if (pe_def_file->exports[i].ordinal != -1) - { - if (max_ordinal < pe_def_file->exports[i].ordinal) - max_ordinal = pe_def_file->exports[i].ordinal; - if (min_ordinal > pe_def_file->exports[i].ordinal) - min_ordinal = pe_def_file->exports[i].ordinal; - count_with_ordinals++; - } - - continue; - } - name = xmalloc (strlen (pe_def_file->exports[i].internal_name) + 2); if (pe_details->underscored && (*pe_def_file->exports[i].internal_name != '@')) @@ -932,6 +910,28 @@ process_def_file_and_drectve (bfd *abfd ATTRIBUTE_UNUSED, struct bfd_link_info * count_with_ordinals++; } } + /* Check for forward exports. These are indicated in DEF files by an + export directive of the form NAME1 = MODULE-NAME.EXTERNAL-NAME + but we must take care not to be fooled when the user wants to export + a symbol that actually really has a dot in it, so we only check + for them here, after real defined symbols have already been matched. */ + else if (strchr (pe_def_file->exports[i].internal_name, '.')) + { + count_exported++; + if (!pe_def_file->exports[i].flag_noname) + count_exported_byname++; + + pe_def_file->exports[i].flag_forward = 1; + + if (pe_def_file->exports[i].ordinal != -1) + { + if (max_ordinal < pe_def_file->exports[i].ordinal) + max_ordinal = pe_def_file->exports[i].ordinal; + if (min_ordinal > pe_def_file->exports[i].ordinal) + min_ordinal = pe_def_file->exports[i].ordinal; + count_with_ordinals++; + } + } else if (blhe && blhe->type == bfd_link_hash_undefined) { /* xgettext:c-format */ |