summaryrefslogtreecommitdiff
path: root/contrib/binutils/ld/pe-dll.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/binutils/ld/pe-dll.c')
-rw-r--r--contrib/binutils/ld/pe-dll.c29
1 files changed, 19 insertions, 10 deletions
diff --git a/contrib/binutils/ld/pe-dll.c b/contrib/binutils/ld/pe-dll.c
index fd70c781b55e..e59c32d09517 100644
--- a/contrib/binutils/ld/pe-dll.c
+++ b/contrib/binutils/ld/pe-dll.c
@@ -32,7 +32,7 @@
#include "ldlang.h"
#include "ldwrite.h"
#include "ldmisc.h"
-#include "ldgram.h"
+#include <ldgram.h>
#include "ldmain.h"
#include "ldfile.h"
#include "ldemul.h"
@@ -257,6 +257,8 @@ static autofilter_entry_type autofilter_symbolprefixlist[] =
/* { "__imp_", 6 }, */
/* Do __imp_ explicitly to save time. */
{ "__rtti_", 7 },
+ /* Don't re-export auto-imported symbols. */
+ { "_nm_", 4 },
{ "__builtin_", 10 },
/* Don't export symbols specifying internal DLL layout. */
{ "_head_", 6 },
@@ -1814,8 +1816,10 @@ make_one (exp, parent)
quick_symbol (abfd, U ("_head_"), dll_symname, "", UNDSEC, BSF_GLOBAL, 0);
quick_symbol (abfd, U ("_imp__"), exp->internal_name, "", id5, BSF_GLOBAL, 0);
/* Symbol to reference ord/name of imported
- symbol, used to implement auto-import. */
- quick_symbol (abfd, U("_nm__"), exp->internal_name, "", id6, BSF_GLOBAL, 0);
+ data symbol, used to implement auto-import. */
+ if (exp->flag_data)
+ quick_symbol (abfd, U("_nm__"), exp->internal_name, "", id6,
+ BSF_GLOBAL,0);
if (pe_dll_compat_implib)
quick_symbol (abfd, U ("__imp_"), exp->internal_name, "",
id5, BSF_GLOBAL, 0);
@@ -1974,7 +1978,7 @@ make_import_fixup_mark (rel)
struct symbol_cache_entry *sym = *rel->sym_ptr_ptr;
bfd *abfd = bfd_asymbol_bfd (sym);
- struct coff_link_hash_entry *myh = NULL;
+ struct bfd_link_hash_entry *bh;
if (!fixup_name)
{
@@ -1996,15 +2000,20 @@ make_import_fixup_mark (rel)
sprintf (fixup_name, "__fu%d_%s", counter++, sym->name);
+ bh = NULL;
bfd_coff_link_add_one_symbol (&link_info, abfd, fixup_name, BSF_GLOBAL,
current_sec, /* sym->section, */
- rel->address, NULL, true, false,
- (struct bfd_link_hash_entry **) &myh);
+ rel->address, NULL, true, false, &bh);
+
+ if (0)
+ {
+ struct coff_link_hash_entry *myh;
+
+ myh = (struct coff_link_hash_entry *) bh;
+ printf ("type:%d\n", myh->type);
+ printf ("%s\n", myh->root.u.def.section->name);
+ }
-#if 0
- printf ("type:%d\n", myh->type);
- printf ("%s\n", myh->root.u.def.section->name);
-#endif
return fixup_name;
}