diff options
author | Nick Clifton <nickc@redhat.com> | 2009-10-16 15:15:39 +0000 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2009-10-16 15:15:39 +0000 |
commit | 2927aacaee356e861452258500e0b7ace0449977 (patch) | |
tree | 75d3b031ef6f40d1771f59145a1a69e852588a83 /ld/pe-dll.c | |
parent | 3873ba12303f6ceec282b213c59e18d2bc061a58 (diff) | |
download | gdb-2927aacaee356e861452258500e0b7ace0449977.zip gdb-2927aacaee356e861452258500e0b7ace0449977.tar.gz gdb-2927aacaee356e861452258500e0b7ace0449977.tar.bz2 |
* emultempl/pe.em (OPTION_EXCLUDE_ALL_SYMBOLS): New macro.
(gld${EMULATION_NAME}_add_options): Add new --exclude-all-symbols option
to exclude all symbols from automatic export.
(gld_${EMULATION_NAME}_list_options): Describe it.
(gld${EMULATION_NAME}_handle_option): Handle it.
* emultempl/pep.em: Likewise to all the above.
* pe-dll.c (pe_dll_exclude_all_symbols): New variable.
(process_def_file_and_drectve): Use it.
* pe-dll.h (pe_dll_exclude_all_symbols): Declare.
* pep-dll.c (pep_dll_exclude_all_symbols): Define pep_ alias.
* pep-dll.h (pe_dll_exclude_all_symbols): Declare.
* NEWS: Mention the new feature.
* ld.texinfo: Document the new command line switch.
Diffstat (limited to 'ld/pe-dll.c')
-rw-r--r-- | ld/pe-dll.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/ld/pe-dll.c b/ld/pe-dll.c index f615b2d..ce5d6a3 100644 --- a/ld/pe-dll.c +++ b/ld/pe-dll.c @@ -149,6 +149,7 @@ static void add_bfd_to_link (bfd *, const char *, struct bfd_link_info *); def_file * pe_def_file = 0; int pe_dll_export_everything = 0; +int pe_dll_exclude_all_symbols = 0; int pe_dll_do_default_excludes = 1; int pe_dll_kill_ats = 0; int pe_dll_stdcall_aliases = 0; @@ -664,14 +665,15 @@ process_def_file_and_drectve (bfd *abfd ATTRIBUTE_UNUSED, struct bfd_link_info * } } - /* If we are not building a DLL, when there are no exports - we do not build an export table at all. */ - if (!pe_dll_export_everything && pe_def_file->num_exports == 0 - && info->executable) + /* If we are building an executable and there is nothing + to export, we do not build an export table at all. */ + if (info->executable && pe_def_file->num_exports == 0 + && (!pe_dll_export_everything || pe_dll_exclude_all_symbols)) return; /* Now, maybe export everything else the default way. */ - if (pe_dll_export_everything || pe_def_file->num_exports == 0) + if ((pe_dll_export_everything || pe_def_file->num_exports == 0) + && !pe_dll_exclude_all_symbols) { for (b = info->input_bfds; b; b = b->link_next) { |