From: Nick Clifton Date: Tue, 4 Jan 2000 23:44:03 +0000 (+0000) Subject: Applied Mumit Kha's patch to tweak dll production code. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=870df5dcbc9c012aaf8b59fb97ba5ba045d66f98;p=binutils-gdb.git Applied Mumit Kha's patch to tweak dll production code. --- diff --git a/ld/ChangeLog b/ld/ChangeLog index 2ab6c95fe7b..c6091ee42ca 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,7 +1,21 @@ 2000-01-04 Mumit Khan + * 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 diff --git a/ld/emultempl/pe.em b/ld/emultempl/pe.em index cea09fe84b9..a91caa848fd 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 < 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 b33a3781fda..cf9e84a2379 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 *));