]>
git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/config/rs6000/ppc-asm.h
1 /* PowerPC asm definitions for GNU C. */
2 /* Under winnt, 1) gas supports the following as names and 2) in particular
3 defining "toc" breaks the FUNC_START macro as ".toc" becomes ".2" */
5 #if !defined(__WINNT__)
83 * Macros to glue together two tokens.
87 #define XGLUE(a,b) a##b
89 #define XGLUE(a,b) a/**/b
92 #define GLUE(a,b) XGLUE(a,b)
95 * Macros to begin and end a function written in assembler. If -mcall-aixdesc
96 * or -mcall-nt, create a function descriptor with the given name, and create
97 * the real function with one or two leading periods respectively.
101 #define DESC_SECTION ".got2"
103 #define DESC_SECTION ".got1"
106 #if defined(_CALL_AIXDESC)
107 #define FUNC_NAME(name) GLUE(.,name)
108 #define JUMP_TARGET(name) FUNC_NAME(name)
109 #define FUNC_START(name) \
110 .section DESC_SECTION,"aw"; \
112 .long GLUE(.,name); \
113 .long _GLOBAL_OFFSET_TABLE_; \
116 .type GLUE(.,name),@function; \
118 .globl GLUE(.,name); \
121 #define FUNC_END(name) \
123 .size GLUE(.,name),GLUE(.L,name)-GLUE(.,name)
125 #elif defined(__WINNT__)
126 #define FUNC_NAME(name) GLUE(..,name)
127 #define JUMP_TARGET(name) FUNC_NAME(name)
128 #define FUNC_START(name) \
131 .ualong GLUE(..,name),GLUE(name,.e),0,0,GLUE(..,name); \
134 .ualong GLUE(..,name),.toc; \
137 .globl GLUE(..,name); \
140 #define FUNC_END(name) \
142 GLUE(FE_MOT_RESVD..,name):
144 #elif defined(_CALL_NT)
145 #define FUNC_NAME(name) GLUE(..,name)
146 #define JUMP_TARGET(name) FUNC_NAME(name)
147 #define FUNC_START(name) \
148 .section DESC_SECTION,"aw"; \
150 .long GLUE(..,name); \
151 .long _GLOBAL_OFFSET_TABLE_; \
153 .type GLUE(..,name),@function; \
155 .globl GLUE(..,name); \
158 #define FUNC_END(name) \
160 .size GLUE(..,name),GLUE(.L,name)-GLUE(..,name)
162 #elif defined (__powerpc64__)
163 #define FUNC_NAME(name) GLUE(.,name)
164 #define FUNC_START(name) \
165 .section ".opd","aw"; \
167 .quad GLUE(.,name); \
168 .quad .TOC.@tocbase; \
171 .type GLUE(.,name),@function; \
173 .globl GLUE(.,name); \
176 #define FUNC_END(name) \
178 .size GLUE(.,name),GLUE(.L,name)-GLUE(.,name)
181 #define FUNC_NAME(name) GLUE(__USER_LABEL_PREFIX__,name)
182 #if defined __PIC__ || defined __pic__
183 #define JUMP_TARGET(name) FUNC_NAME(name@plt)
185 #define JUMP_TARGET(name) FUNC_NAME(name)
187 #define FUNC_START(name) \
188 .type FUNC_NAME(name),@function; \
189 .globl FUNC_NAME(name); \
192 #define FUNC_END(name) \
194 .size FUNC_NAME(name),GLUE(.L,name)-FUNC_NAME(name)