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.
99 #define DESC_SECTION ".got2"
101 #define DESC_SECTION ".got1"
104 #if defined(_CALL_AIXDESC)
105 #define FUNC_NAME(name) GLUE(.,name)
106 #define JUMP_TARGET(name) FUNC_NAME(name)
107 #define FUNC_START(name) \
108 .section DESC_SECTION,"aw"; \
110 .long GLUE(.,name); \
111 .long _GLOBAL_OFFSET_TABLE_; \
114 .type GLUE(.,name),@function; \
116 .globl GLUE(.,name); \
119 #define FUNC_END(name) \
121 .size GLUE(.,name),GLUE(.L,name)-GLUE(.,name)
123 #elif defined (__powerpc64__)
124 #define FUNC_NAME(name) GLUE(.,name)
125 #define JUMP_TARGET(name) FUNC_NAME(name)
126 #define FUNC_START(name) \
127 .section ".opd","aw"; \
129 .quad GLUE(.,name); \
130 .quad .TOC.@tocbase; \
133 .type GLUE(.,name),@function; \
135 .globl GLUE(.,name); \
138 #define FUNC_END(name) \
140 .size GLUE(.,name),GLUE(.L,name)-GLUE(.,name)
143 #define FUNC_NAME(name) GLUE(__USER_LABEL_PREFIX__,name)
144 #if defined __PIC__ || defined __pic__
145 #define JUMP_TARGET(name) FUNC_NAME(name@plt)
147 #define JUMP_TARGET(name) FUNC_NAME(name)
149 #define FUNC_START(name) \
150 .type FUNC_NAME(name),@function; \
151 .globl FUNC_NAME(name); \
154 #define FUNC_END(name) \
156 .size FUNC_NAME(name),GLUE(.L,name)-FUNC_NAME(name)