PR ld/11603
authorDave Korn <dave.korn@artimi.com>
Wed, 9 Jun 2010 18:17:10 +0000 (18:17 +0000)
committerDave Korn <dave.korn@artimi.com>
Wed, 9 Jun 2010 18:17:10 +0000 (18:17 +0000)
* pe-dll.c (process_def_file_and_drectve): Reorder check for
forwarded export name after check for ordinary export.

ld/ChangeLog
ld/pe-dll.c

index 25452fbbf1fbad24afc4625ea3441a15c96917fc..c7f5202936e6c859ca5d0382b0ca290e710011c3 100644 (file)
@@ -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.
index 5048c2077fa28a85aea1928d76fb44a5237c6306..47722b6df3d5fdfb2064e30b90b33200cb1c5221 100644 (file)
@@ -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 != '@'))
@@ -923,6 +901,28 @@ process_def_file_and_drectve (bfd *abfd ATTRIBUTE_UNUSED, struct bfd_link_info *
          else
            exported_symbol_sections[i] = blhe->u.c.p->section;
 
+         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++;
+           }
+       }
+      /* 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)