aboutsummaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2000-01-04 23:44:03 +0000
committerNick Clifton <nickc@redhat.com>2000-01-04 23:44:03 +0000
commit870df5dcbc9c012aaf8b59fb97ba5ba045d66f98 (patch)
tree9e3afa8c5d6a1f715fcd7d22ab2bce627371d34b /ld
parenta6483292c26c4ad8e8f19a3207b70585087a5a4a (diff)
downloadgdb-870df5dcbc9c012aaf8b59fb97ba5ba045d66f98.zip
gdb-870df5dcbc9c012aaf8b59fb97ba5ba045d66f98.tar.gz
gdb-870df5dcbc9c012aaf8b59fb97ba5ba045d66f98.tar.bz2
Applied Mumit Kha's patch to tweak dll production code.
Diffstat (limited to 'ld')
-rw-r--r--ld/ChangeLog14
-rw-r--r--ld/emultempl/pe.em12
-rw-r--r--ld/pe-dll.c22
-rw-r--r--ld/pe-dll.h4
4 files changed, 42 insertions, 10 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog
index 2ab6c95..c6091ee 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,7 +1,21 @@
2000-01-04 Mumit Khan <khan@xraylith.wisc.edu>
+ * pe-dll.c (pe_dll_warn_dup_exports): New variable.
+ (process_def_file): Use.
+ (pe_dll_compat_implib): New variable.
+ (make_one): Use.
+
+ * pe-dll.h: Add exports of pe_dll_warn_dup_exports and
+ pe_dll_compat_implib.
+
+ * emultempl/pe.em (longopts): Add warn-duplicate-exports and
+ compat-implib options.
+ (gld_${EMULATION_NAME}_list_options): List new options.
+ (gld_${EMULATION_NAME}_parse_args): Handle.
+
* pe-dll.c (pe_dll_generate_implib): Use the correct name for output
dll.
+
* deffilep.y (opt_name): Allow "." in name.
1999-12-02 Nick Clifton <nickc@cygnus.com>
diff --git a/ld/emultempl/pe.em b/ld/emultempl/pe.em
index cea09fe..a91caa8 100644
--- a/ld/emultempl/pe.em
+++ b/ld/emultempl/pe.em
@@ -4,7 +4,7 @@ rm -f e${EMULATION_NAME}.c
(echo;echo;echo;echo;echo)>e${EMULATION_NAME}.c # there, now line numbers match ;-)
cat >>e${EMULATION_NAME}.c <<EOF
/* This file is part of GLD, the Gnu Linker.
- Copyright 1995, 96, 97, 98, 1999 Free Software Foundation, Inc.
+ Copyright 1995, 96, 97, 98, 99, 2000 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -139,6 +139,8 @@ gld_${EMULATION_NAME}_before_parse()
#define OPTION_DISABLE_STDCALL_FIXUP (OPTION_ENABLE_STDCALL_FIXUP + 1)
#define OPTION_IMPLIB_FILENAME (OPTION_DISABLE_STDCALL_FIXUP + 1)
#define OPTION_THUMB_ENTRY (OPTION_IMPLIB_FILENAME + 1)
+#define OPTION_WARN_DUPLICATE_EXPORTS (OPTION_THUMB_ENTRY + 1)
+#define OPTION_IMP_COMPAT (OPTION_WARN_DUPLICATE_EXPORTS + 1)
static struct option longopts[] =
{
@@ -171,6 +173,8 @@ static struct option longopts[] =
{"enable-stdcall-fixup", no_argument, NULL, OPTION_ENABLE_STDCALL_FIXUP},
{"disable-stdcall-fixup", no_argument, NULL, OPTION_DISABLE_STDCALL_FIXUP},
{"out-implib", required_argument, NULL, OPTION_IMPLIB_FILENAME},
+ {"warn-duplicate-exports", no_argument, NULL, OPTION_WARN_DUPLICATE_EXPORTS},
+ {"compat-implib", no_argument, NULL, OPTION_IMP_COMPAT},
#endif
{NULL, no_argument, NULL, 0}
};
@@ -490,6 +494,12 @@ gld_${EMULATION_NAME}_parse_args(argc, argv)
case OPTION_IMPLIB_FILENAME:
pe_implib_filename = xstrdup (optarg);
break;
+ case OPTION_WARN_DUPLICATE_EXPORTS:
+ pe_dll_warn_dup_exports = 1;
+ break;
+ case OPTION_IMP_COMPAT:
+ pe_dll_compat_implib = 1;
+ break;
#endif
}
return 1;
diff --git a/ld/pe-dll.c b/ld/pe-dll.c
index 8e543b2..9fff276 100644
--- a/ld/pe-dll.c
+++ b/ld/pe-dll.c
@@ -60,6 +60,8 @@ int pe_dll_export_everything = 0;
int pe_dll_do_default_excludes = 1;
int pe_dll_kill_ats = 0;
int pe_dll_stdcall_aliases = 0;
+int pe_dll_warn_dup_exports = 0;
+int pe_dll_compat_implib = 0;
/************************************************************************
@@ -338,20 +340,22 @@ process_def_file (abfd, info)
{
if (i > 0 && strcmp (e[i].name, e[i - 1].name) == 0)
{
- /* This is a duplicate */
+ /* This is a duplicate. */
if (e[j - 1].ordinal != -1
&& e[i].ordinal != -1
&& e[j - 1].ordinal != e[i].ordinal)
{
- /* xgettext:c-format */
- einfo (_("%XError, duplicate EXPORT with oridinals: %s (%d vs %d)\n"),
- e[j - 1].name, e[j - 1].ordinal, e[i].ordinal);
+ if (pe_dll_warn_dup_exports)
+ /* xgettext:c-format */
+ einfo (_("%XError, duplicate EXPORT with oridinals: %s (%d vs %d)\n"),
+ e[j - 1].name, e[j - 1].ordinal, e[i].ordinal);
}
else
{
- /* xgettext:c-format */
- einfo (_("Warning, duplicate EXPORT: %s\n"),
- e[j - 1].name);
+ if (pe_dll_warn_dup_exports)
+ /* xgettext:c-format */
+ einfo (_("Warning, duplicate EXPORT: %s\n"),
+ e[j - 1].name);
}
if (e[i].ordinal)
e[j - 1].ordinal = e[i].ordinal;
@@ -1359,7 +1363,9 @@ make_one (exp, parent)
quick_symbol (abfd, U(""), exp->internal_name, "", tx, BSF_GLOBAL, 0);
quick_symbol (abfd, U("_head_"), dll_symname, "", UNDSEC, BSF_GLOBAL, 0);
quick_symbol (abfd, U("__imp_"), exp->internal_name, "", id5, BSF_GLOBAL, 0);
- quick_symbol (abfd, U("_imp__"), exp->internal_name, "", id5, BSF_GLOBAL, 0);
+ if (pe_dll_compat_implib)
+ quick_symbol (abfd, U("__imp_"), exp->internal_name, "",
+ id5, BSF_GLOBAL, 0);
bfd_set_section_size (abfd, tx, jmp_byte_count);
td = (unsigned char *) xmalloc (jmp_byte_count);
diff --git a/ld/pe-dll.h b/ld/pe-dll.h
index b33a378..cf9e84a 100644
--- a/ld/pe-dll.h
+++ b/ld/pe-dll.h
@@ -1,5 +1,5 @@
/* pe-dll.h: Header file for routines used to build Windows DLLs.
- Copyright (C) 1999 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2000 Free Software Foundation, Inc.
This file is part of GLD, the Gnu Linker.
@@ -31,6 +31,8 @@ extern int pe_dll_export_everything;
extern int pe_dll_do_default_excludes;
extern int pe_dll_kill_ats;
extern int pe_dll_stdcall_aliases;
+extern int pe_dll_warn_dup_exports;
+extern int pe_dll_compat_implib;
extern void pe_dll_id_target PARAMS ((const char *));
extern void pe_dll_add_excludes PARAMS ((const char *));