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" */
81 * Macros to glue together two tokens.
85 #define XGLUE(a,b) a##b
87 #define XGLUE(a,b) a/**/b
90 #define GLUE(a,b) XGLUE(a,b)
93 * Macros to begin and end a function written in assembler. If -mcall-aixdesc
94 * or -mcall-nt, create a function descriptor with the given name, and create
95 * the real function with one or two leading periods respectively.
98 #if defined (__powerpc64__)
99 #define FUNC_NAME(name) GLUE(.,name)
100 #define JUMP_TARGET(name) FUNC_NAME(name)
101 #define FUNC_START(name) \
102 .section ".opd","aw"; \
104 .quad GLUE(.,name); \
105 .quad .TOC.@tocbase; \
108 .type GLUE(.,name),@function; \
110 .globl GLUE(.,name); \
113 #define HIDDEN_FUNC(name) \
116 .hidden GLUE(.,name);
118 #define FUNC_END(name) \
120 .size GLUE(.,name),GLUE(.L,name)-GLUE(.,name)
122 #elif defined(_CALL_AIXDESC)
125 #define DESC_SECTION ".got2"
127 #define DESC_SECTION ".got1"
130 #define FUNC_NAME(name) GLUE(.,name)
131 #define JUMP_TARGET(name) FUNC_NAME(name)
132 #define FUNC_START(name) \
133 .section DESC_SECTION,"aw"; \
135 .long GLUE(.,name); \
136 .long _GLOBAL_OFFSET_TABLE_; \
139 .type GLUE(.,name),@function; \
141 .globl GLUE(.,name); \
144 #define HIDDEN_FUNC(name) \
147 .hidden GLUE(.,name);
149 #define FUNC_END(name) \
151 .size GLUE(.,name),GLUE(.L,name)-GLUE(.,name)
155 #define FUNC_NAME(name) GLUE(__USER_LABEL_PREFIX__,name)
156 #if defined __PIC__ || defined __pic__
157 #define JUMP_TARGET(name) FUNC_NAME(name@plt)
159 #define JUMP_TARGET(name) FUNC_NAME(name)
161 #define FUNC_START(name) \
162 .type FUNC_NAME(name),@function; \
163 .globl FUNC_NAME(name); \
166 #define HIDDEN_FUNC(name) \
168 .hidden FUNC_NAME(name);
170 #define FUNC_END(name) \
172 .size FUNC_NAME(name),GLUE(.L,name)-FUNC_NAME(name)
175 #if defined __linux__ && !defined __powerpc64__
176 .section .note.GNU-stack