gold/
[deliverable/binutils-gdb.git] / ld / pe-dll.c
index 85bf2a7b35c6c5af75c6581d8e25c8b8b2a8a7ae..bd3195f41d772e487e96c7306c529532bbcbc35a 100644 (file)
@@ -720,9 +720,10 @@ process_def_file_and_drectve (bfd *abfd ATTRIBUTE_UNUSED, struct bfd_link_info *
              /* We should export symbols which are either global or not
                 anything at all.  (.bss data is the latter)
                 We should not export undefined symbols.  */
-             bfd_boolean would_export = symbols[j]->section != &bfd_und_section
-                     && ((symbols[j]->flags & BSF_GLOBAL)
-                         || (symbols[j]->flags == 0));
+             bfd_boolean would_export
+               = (symbols[j]->section != bfd_und_section_ptr
+                  && ((symbols[j]->flags & BSF_GLOBAL)
+                      || (symbols[j]->flags == 0)));
              if (link_info.version_info && would_export)
                  would_export
                    = !bfd_hide_sym_by_version (link_info.version_info,
@@ -781,14 +782,17 @@ process_def_file_and_drectve (bfd *abfd ATTRIBUTE_UNUSED, struct bfd_link_info *
     {
       for (i = 0; i < NE; i++)
        {
-         if (strchr (pe_def_file->exports[i].name, '@'))
+         /* Check for fastcall/stdcall-decoration, but ignore
+            C++ mangled names.  */
+         if (pe_def_file->exports[i].name[0] != '?'
+             && strchr (pe_def_file->exports[i].name, '@'))
            {
              /* This will preserve internal_name, which may have been
                 pointing to the same memory as name, or might not
                 have.  */
              int lead_at = (*pe_def_file->exports[i].name == '@');
              char *tmp = xstrdup (pe_def_file->exports[i].name + lead_at);
-             char *tmp_at = strchr (tmp, '@');
+             char *tmp_at = strrchr (tmp, '@');
 
              if (tmp_at)
                *tmp_at = 0;
@@ -1351,7 +1355,7 @@ generate_reloc (bfd *abfd, struct bfd_link_info *info)
 
          /* I don't know why there would be a reloc for these, but I've
             seen it happen - DJ  */
-         if (s->output_section == &bfd_abs_section)
+         if (s->output_section == bfd_abs_section_ptr)
            continue;
 
          if (s->output_section->vma == 0)
@@ -1408,7 +1412,7 @@ generate_reloc (bfd *abfd, struct bfd_link_info *info)
                             no reason we'd want a reference to any absolute
                             address to get relocated during rebasing).  */
                          if (!h2 || h2->root.type == bfd_link_hash_undefined
-                               || h2->root.u.def.section == &bfd_abs_section)
+                               || h2->root.u.def.section == bfd_abs_section_ptr)
                            continue;
                        }
                      else if (!blhe || blhe->type != bfd_link_hash_defined)
@@ -1767,7 +1771,7 @@ static int tmp_seq2;
 static const char *dll_filename;
 static char *dll_symname;
 
-#define UNDSEC (asection *) &bfd_und_section
+#define UNDSEC bfd_und_section_ptr
 
 static asection *
 quick_section (bfd *abfd, const char *name, int flags, int align)
@@ -2712,8 +2716,9 @@ pe_dll_generate_implib (def_file *def, const char *impfilename, struct bfd_link_
       return;
     }
 
-  /* xgettext:c-format */
-  info_msg (_("Creating library file: %s\n"), impfilename);
+  if (verbose)
+    /* xgettext:c-format */
+    info_msg (_("Creating library file: %s\n"), impfilename);
 
   bfd_set_format (outarch, bfd_archive);
   outarch->has_armap = 1;
@@ -2825,7 +2830,7 @@ struct key_value
   const char *oname;
 };
 
-struct key_value *udef_table;
+static struct key_value *udef_table;
 
 static int undef_sort_cmp (const void *l1, const void *r1)
 {
@@ -2842,7 +2847,7 @@ pe_find_cdecl_alias_match (struct bfd_link_info *linfo, char *name)
   struct key_value *kv;
   struct key_value key;
   char *at, *lname = (char *) alloca (strlen (name) + 3);
-  
+
   strcpy (lname, name);
 
   at = strchr (lname + (lname[0] == '@'), '@');
@@ -2923,7 +2928,7 @@ pe_find_cdecl_alias_match (struct bfd_link_info *linfo, char *name)
       if (h->type == bfd_link_hash_undefined)
         return h;
     }
-  
+
   return NULL;
 }
 
This page took 0.023798 seconds and 4 git commands to generate.