summaryrefslogtreecommitdiffstats
path: root/gcc/config/mcore/mcore-pe.h
blob: a580fc5bfbcecba851ad4bfa84c0a8e454201dc6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
/* Definitions of target machine for GNU compiler, for MCore using COFF/PE.
   Copyright (C) 1994, 1999, 2000, 2002 Free Software Foundation, Inc.
   Contributed by Michael Tiemann (tiemann@cygnus.com).

This file is part of GNU CC.

GNU CC is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.

GNU CC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with GNU CC; see the file COPYING.  If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.  */

/* Run-time Target Specification.  */
#define TARGET_VERSION fputs (" (MCORE/pe)", stderr)

#define SUBTARGET_CPP_PREDEFINES " -D__pe__"

/* The MCore ABI says that bitfields are unsigned by default.  */
/* The EPOC C++ environment does not support exceptions.  */
#define CC1_SPEC "-funsigned-bitfields %{!DIN_GCC:-fno-rtti} %{!DIN_GCC:-fno-exceptions}"

#include "svr3.h"
#include "mcore/mcore.h"
#include "dbxcoff.h"

#undef  SDB_DEBUGGING_INFO
#define DBX_DEBUGGING_INFO 1

/* Computed in toplev.c.  */
#undef  PREFERRED_DEBUGGING_TYPE

/* Lay out additional 'sections' where we place things like code
   and readonly data. This gets them out of default places.  */

#define SUBTARGET_SWITCH_SECTIONS 		\
  case in_drectve: drectve_section (); break;

#define DRECTVE_SECTION_ASM_OP	"\t.section .drectve"
#define READONLY_DATA_SECTION_ASM_OP	"\t.section .rdata"

#define SUBTARGET_EXTRA_SECTIONS in_drectve

#define SUBTARGET_EXTRA_SECTION_FUNCTIONS \
  DRECTVE_SECTION_FUNCTION

#define DRECTVE_SECTION_FUNCTION 				\
void								\
drectve_section ()						\
{								\
  if (in_section != in_drectve)					\
    {								\
      fprintf (asm_out_file, "%s\n", DRECTVE_SECTION_ASM_OP);	\
      in_section = in_drectve;					\
    }								\
}

#define MCORE_EXPORT_NAME(STREAM, NAME)			\
  do							\
    {							\
      drectve_section ();				\
      fprintf (STREAM, "\t.ascii \" -export:%s\"\n",	\
	       (* targetm.strip_name_encoding) (NAME));	\
    }							\
  while (0);

/* Output the label for an initialized variable.  */
#undef  ASM_DECLARE_OBJECT_NAME
#define ASM_DECLARE_OBJECT_NAME(STREAM, NAME, DECL)		\
  do								\
    {								\
      if (mcore_dllexport_name_p (NAME))			\
        {							\
          enum in_section save_section = in_section;		\
	  MCORE_EXPORT_NAME (STREAM, NAME);			\
          switch_to_section (save_section, (DECL));		\
        }							\
      ASM_OUTPUT_LABEL ((STREAM), (NAME));			\
    }								\
  while (0)

/* Output a function label definition.  */
#define ASM_DECLARE_FUNCTION_NAME(STREAM, NAME, DECL)		\
  do								\
    {								\
      if (mcore_dllexport_name_p (NAME))			\
	{							\
          MCORE_EXPORT_NAME (STREAM, NAME);			\
	  function_section (DECL);				\
	}							\
      ASM_OUTPUT_LABEL ((STREAM), (NAME));			\
    }								\
  while (0);

#undef  ASM_FILE_START
#define ASM_FILE_START(STREAM)					\
  do								\
    {								\
      fprintf (STREAM, "%s Generated by gcc %s for MCore/pe\n",	\
	   ASM_COMMENT_START, version_string);			\
      output_file_directive ((STREAM), main_input_filename);	\
    }								\
  while (0)

#undef  ASM_OUTPUT_SOURCE_LINE
#define ASM_OUTPUT_SOURCE_LINE(FILE, LINE)				  \
  {									  \
    if (write_symbols == DBX_DEBUG)					  \
      {									  \
        static int sym_lineno = 1;					  \
        char buffer[256];						  \
									  \
        ASM_GENERATE_INTERNAL_LABEL (buffer, "LM", sym_lineno);		  \
        fprintf (FILE, ".stabn 68,0,%d,", LINE);			  \
        assemble_name (FILE, buffer);					  \
        putc ('-', FILE);						  \
        assemble_name (FILE,						  \
		   XSTR (XEXP (DECL_RTL (current_function_decl), 0), 0)); \
        putc ('\n', FILE);						  \
        ASM_OUTPUT_INTERNAL_LABEL (FILE, "LM", sym_lineno);		  \
        sym_lineno ++;							  \
      }									  \
  }

#define STARTFILE_SPEC "crt0.o%s"
#define ENDFILE_SPEC  "%{!mno-lsim:-lsim}"

/* __CTOR_LIST__ and __DTOR_LIST__ must be defined by the linker script.  */
#define CTOR_LISTS_DEFINED_EXTERNALLY

#undef DO_GLOBAL_CTORS_BODY
#undef DO_GLOBAL_DTORS_BODY
#undef INIT_SECTION_ASM_OP
#undef DTORS_SECTION_ASM_OP

#define SUPPORTS_ONE_ONLY 1

/* Switch into a generic section.  */
#undef TARGET_ASM_NAMED_SECTION
#define TARGET_ASM_NAMED_SECTION  default_pe_asm_named_section
OpenPOWER on IntegriCloud