diff options
| author | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 1999-08-28 22:58:42 +0000 |
|---|---|---|
| committer | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 1999-08-28 22:58:42 +0000 |
| commit | 5da719200ad030441eb3ffc2492e7d93afd2c27c (patch) | |
| tree | b47137ea5466259aece8f5960501a6a93f954699 | |
| parent | 2d46e540b46a6f9f877df310cb36d1149626184a (diff) | |
| download | ppe42-gcc-5da719200ad030441eb3ffc2492e7d93afd2c27c.tar.gz ppe42-gcc-5da719200ad030441eb3ffc2492e7d93afd2c27c.zip | |
Mumit Khan <khan@xraylith.wisc.edu>
* i386/winnt.c (export_list): New type.
(exports_head): Rename to
(export_head): this.
(i386_pe_record_exported_symbol): Add is_data flag.
(i386_pe_asm_file_end): Emit directive for exported variables.
* i386/cygwin.h (i386_pe_record_exported_symbol): Update
prototype.
* i386/cygwin.h (ASM_OUTPUT_COMMON): Specify symbol type.
(ASM_DECLARE_OBJECT_NAME): Likewise.
(ASM_DECLARE_FUNCTION_NAME): Likewise.
* i386/uwin.h (ASM_DECLARE_FUNCTION_NAME): Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@28944 138bc75d-0d04-0410-961f-82ee72b054a4
| -rw-r--r-- | gcc/ChangeLog | 14 | ||||
| -rw-r--r-- | gcc/config/i386/cygwin.h | 8 | ||||
| -rw-r--r-- | gcc/config/i386/uwin.h | 2 | ||||
| -rw-r--r-- | gcc/config/i386/winnt.c | 37 |
4 files changed, 45 insertions, 16 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 283fce6796e..29cd896aa3b 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,17 @@ +Sat Aug 28 15:58:16 1999 Mumit Khan <khan@xraylith.wisc.edu> + + * i386/winnt.c (export_list): New type. + (exports_head): Rename to + (export_head): this. + (i386_pe_record_exported_symbol): Add is_data flag. + (i386_pe_asm_file_end): Emit directive for exported variables. + * i386/cygwin.h (i386_pe_record_exported_symbol): Update + prototype. + * i386/cygwin.h (ASM_OUTPUT_COMMON): Specify symbol type. + (ASM_DECLARE_OBJECT_NAME): Likewise. + (ASM_DECLARE_FUNCTION_NAME): Likewise. + * i386/uwin.h (ASM_DECLARE_FUNCTION_NAME): Likewise. + Fri Aug 27 15:35:24 1999 Jeffrey A Law (law@cygnus.com) * cse.c (fold_rtx): Work around bug in Sun V5.0 compilers. diff --git a/gcc/config/i386/cygwin.h b/gcc/config/i386/cygwin.h index d34a963eacc..f19ea50d3f9 100644 --- a/gcc/config/i386/cygwin.h +++ b/gcc/config/i386/cygwin.h @@ -327,7 +327,7 @@ do { \ #define ASM_OUTPUT_COMMON(STREAM, NAME, SIZE, ROUNDED) \ do { \ if (i386_pe_dllexport_name_p (NAME)) \ - i386_pe_record_exported_symbol (NAME); \ + i386_pe_record_exported_symbol (NAME, 1); \ if (! i386_pe_dllimport_name_p (NAME)) \ { \ fprintf ((STREAM), "\t.comm\t"); \ @@ -342,7 +342,7 @@ do { \ #define ASM_DECLARE_OBJECT_NAME(STREAM, NAME, DECL) \ do { \ if (i386_pe_dllexport_name_p (NAME)) \ - i386_pe_record_exported_symbol (NAME); \ + i386_pe_record_exported_symbol (NAME, 1); \ ASM_OUTPUT_LABEL ((STREAM), (NAME)); \ } while (0) @@ -438,7 +438,7 @@ do { \ do \ { \ if (i386_pe_dllexport_name_p (NAME)) \ - i386_pe_record_exported_symbol (NAME); \ + i386_pe_record_exported_symbol (NAME, 0); \ if (write_symbols != SDB_DEBUG) \ i386_pe_declare_function_type (FILE, NAME, TREE_PUBLIC (DECL)); \ ASM_OUTPUT_LABEL (FILE, NAME); \ @@ -509,7 +509,7 @@ do { \ extern void i386_pe_record_external_function PROTO((char *)); extern void i386_pe_declare_function_type STDIO_PROTO((FILE *, char *, int)); -extern void i386_pe_record_exported_symbol PROTO((char *)); +extern void i386_pe_record_exported_symbol PROTO((char *, int)); extern void i386_pe_asm_file_end STDIO_PROTO((FILE *)); /* For Win32 ABI compatibility */ diff --git a/gcc/config/i386/uwin.h b/gcc/config/i386/uwin.h index 29a3f982dd4..84604fb9b00 100644 --- a/gcc/config/i386/uwin.h +++ b/gcc/config/i386/uwin.h @@ -79,7 +79,7 @@ Boston, MA 02111-1307, USA. */ do \ { \ if (i386_pe_dllexport_name_p (NAME)) \ - i386_pe_record_exported_symbol (NAME); \ + i386_pe_record_exported_symbol (NAME, 0); \ /* UWIN binutils bug workaround. */ \ if (0 && write_symbols != SDB_DEBUG) \ i386_pe_declare_function_type (FILE, NAME, TREE_PUBLIC (DECL)); \ diff --git a/gcc/config/i386/winnt.c b/gcc/config/i386/winnt.c index de66f4ed055..90cae270a88 100644 --- a/gcc/config/i386/winnt.c +++ b/gcc/config/i386/winnt.c @@ -546,7 +546,16 @@ i386_pe_record_external_function (name) extern_head = p; } -static struct extern_list *exports_head; +/* Keep a list of exported symbols. */ + +struct export_list +{ + struct export_list *next; + char *name; + int is_data; /* used to type tag exported symbols. */ +}; + +static struct export_list *export_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 @@ -555,15 +564,17 @@ static struct extern_list *exports_head; linkonce. */ void -i386_pe_record_exported_symbol (name) +i386_pe_record_exported_symbol (name, is_data) char *name; + int is_data; { - struct extern_list *p; + struct export_list *p; - p = (struct extern_list *) permalloc (sizeof *p); - p->next = exports_head; + p = (struct export_list *) permalloc (sizeof *p); + p->next = export_head; p->name = name; - exports_head = p; + p->is_data = is_data; + export_head = p; } /* This is called at the end of assembly. For each external function @@ -590,12 +601,16 @@ i386_pe_asm_file_end (file) } } - if (exports_head) - drectve_section (); - for (p = exports_head; p != NULL; p = p->next) + if (export_head) { - fprintf (file, "\t.ascii \" -export:%s\"\n", - I386_PE_STRIP_ENCODING (p->name)); + struct export_list *q; + drectve_section (); + for (q = export_head; q != NULL; q = q->next) + { + fprintf (file, "\t.ascii \" -export:%s%s\"\n", + I386_PE_STRIP_ENCODING (q->name), + (q->is_data) ? ",data" : ""); + } } } |

