diff options
author | Mumit Khan <khan@xraylith.wisc.edu> | 1999-06-21 04:52:50 +0000 |
---|---|---|
committer | Jeff Law <law@gcc.gnu.org> | 1999-06-20 22:52:50 -0600 |
commit | e43f9c109233942564450ca5d736995a584b3160 (patch) | |
tree | 5db0fed3f3e55665a956f15a9b1959900a0d001e /gcc/config/i386/winnt.c | |
parent | 6000b42b218b075fe08b1cb9c6c7e43d595e6ac9 (diff) | |
download | gcc-e43f9c109233942564450ca5d736995a584b3160.tar.gz |
winnt.c (exports_head): New static variable.
* i386/winnt.c (exports_head): New static variable.
(i386_pe_record_exported_symbol): New function.
(i386_pe_asm_file_end): Use.
* i386/cygwin.h (ASM_OUTPUT_COMMON): Record the exported
symbols to be emitted at end of assembly.
(ASM_DECLARE_OBJECT_NAME): Likewise.
(ASM_DECLARE_FUNCTION_NAME): Likewise.
From-SVN: r27639
Diffstat (limited to 'gcc/config/i386/winnt.c')
-rw-r--r-- | gcc/config/i386/winnt.c | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/gcc/config/i386/winnt.c b/gcc/config/i386/winnt.c index f1a2d4b83be..24d8617f8df 100644 --- a/gcc/config/i386/winnt.c +++ b/gcc/config/i386/winnt.c @@ -545,8 +545,29 @@ i386_pe_record_external_function (name) extern_head = p; } +static struct extern_list *exports_head; + +/* Assemble an export symbol entry. We need to keep a list of + these, so that we can output the export list at the end of the + assembly. We used to output these export symbols in each function, + but that causes problems with GNU ld when the sections are + linkonce. */ + +void +i386_pe_record_exported_symbol (name) + char *name; +{ + struct extern_list *p; + + p = (struct extern_list *) permalloc (sizeof *p); + p->next = exports_head; + p->name = name; + exports_head = p; +} + /* This is called at the end of assembly. For each external function - which has not been defined, we output a declaration now. */ + which has not been defined, we output a declaration now. We also + output the .drectve section. */ void i386_pe_asm_file_end (file) @@ -567,4 +588,13 @@ i386_pe_asm_file_end (file) i386_pe_declare_function_type (file, p->name, TREE_PUBLIC (decl)); } } + + if (exports_head) + drectve_section (); + for (p = exports_head; p != NULL; p = p->next) + { + fprintf (file, "\t.ascii \" -export:%s\"\n", + I386_PE_STRIP_ENCODING (p->name)); + } } + |