aboutsummaryrefslogtreecommitdiff
path: root/ld/pe-dll.c
diff options
context:
space:
mode:
authorDave Korn <dave.korn@artimi.com>2009-05-04 12:09:30 +0000
committerDave Korn <dave.korn@artimi.com>2009-05-04 12:09:30 +0000
commit09e2aba4327cd450908bed05c6e1d4d2dcb09b32 (patch)
tree7de8a83faab244723b3ead159c4eb39065ae9e72 /ld/pe-dll.c
parent67ce33d768510c7f826be66a2b4ea22c7caea801 (diff)
downloadgdb-09e2aba4327cd450908bed05c6e1d4d2dcb09b32.zip
gdb-09e2aba4327cd450908bed05c6e1d4d2dcb09b32.tar.gz
gdb-09e2aba4327cd450908bed05c6e1d4d2dcb09b32.tar.bz2
bfd/ChangeLog
* elflink.c (find_version_for_sym): Remove from here, ... * linker.c (bfd_find_version_for_sym): ... rename, replace here, make public and update all callers. * bfd-in2.h: Regenerate. ld/ChangeLog * NEWS: Mention new feature. * ld.texinfo (--version-script): Document extent of PE support. (WIN32): Mention --version-script. Extend auto-export description. * pe-dll.c (process_def_file): Use version script info to filter symbols from auto-export. * testsuite/ld-pe/vers-script-1.d: New file. * testsuite/ld-pe/vers-script-2.d: New file. * testsuite/ld-pe/vers-script-3.d: New file. * testsuite/ld-pe/vers-script-4.d: New file. * testsuite/ld-pe/vers-script-1.ver: New file. * testsuite/ld-pe/vers-script-2.ver: New file. * testsuite/ld-pe/vers-script-3.ver: New file. * testsuite/ld-pe/vers-script-4.ver: New file. * testsuite/ld-pe/vers-script-dll.c: New file. * testsuite/ld-pe/vers-script.exp: New test script.
Diffstat (limited to 'ld/pe-dll.c')
-rw-r--r--ld/pe-dll.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/ld/pe-dll.c b/ld/pe-dll.c
index 397b66e..b5470c5 100644
--- a/ld/pe-dll.c
+++ b/ld/pe-dll.c
@@ -670,9 +670,18 @@ process_def_file (bfd *abfd ATTRIBUTE_UNUSED, struct bfd_link_info *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. */
- if (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
+ && ((symbols[j]->flags & BSF_GLOBAL)
+ || (symbols[j]->flags == 0));
+ if (lang_elf_version_info && would_export)
+ {
+ bfd_boolean hide = 0;
+ char ofs = pe_details->underscored && symbols[j]->name[0] == '_';
+ (void) bfd_find_version_for_sym (lang_elf_version_info,
+ symbols[j]->name + ofs, &hide);
+ would_export = !hide;
+ }
+ if (would_export)
{
const char *sn = symbols[j]->name;