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 FUNC_START(name) \
109 .section DESC_SECTION,"aw"; \
111 .long GLUE(.,name); \
112 .long _GLOBAL_OFFSET_TABLE_; \
115 .type GLUE(.,name),@function; \
117 .globl GLUE(.,name); \
120 #define FUNC_END(name) \
122 .size GLUE(.,name),GLUE(.L,name)-GLUE(.,name)
124 #elif defined(__WINNT__)
125 #define FUNC_NAME(name) GLUE(..,name)
126 #define FUNC_START(name) \
129 .ualong GLUE(..,name),GLUE(name,.e),0,0,GLUE(..,name); \
132 .ualong GLUE(..,name),.toc; \
135 .globl GLUE(..,name); \
138 #define FUNC_END(name) \
140 GLUE(FE_MOT_RESVD..,name):
142 #elif defined(_CALL_NT)
143 #define FUNC_NAME(name) GLUE(..,name)
144 #define FUNC_START(name) \
145 .section DESC_SECTION,"aw"; \
147 .long GLUE(..,name); \
148 .long _GLOBAL_OFFSET_TABLE_; \
150 .type GLUE(..,name),@function; \
152 .globl GLUE(..,name); \
155 #define FUNC_END(name) \
157 .size GLUE(..,name),GLUE(.L,name)-GLUE(..,name)
159 #elif defined (__powerpc64__)
160 #define FUNC_NAME(name) GLUE(.,name)
161 #define FUNC_START(name) \
162 .section ".opd","aw"; \
164 .quad GLUE(.,name); \
165 .quad .TOC.@tocbase; \
168 .type GLUE(.,name),@function; \
170 .globl GLUE(.,name); \
173 #define FUNC_END(name) \
175 .size GLUE(.,name),GLUE(.L,name)-GLUE(.,name)
178 #define FUNC_NAME(name) GLUE(__USER_LABEL_PREFIX__,name)
179 #define FUNC_START(name) \
180 .type FUNC_NAME(name),@function; \
181 .globl FUNC_NAME(name); \
184 #define FUNC_END(name) \
186 .size FUNC_NAME(name),GLUE(.L,name)-FUNC_NAME(name)