ppc-asm.h (117395) | ppc-asm.h (132718) |
---|---|
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" */ 4 5#define r0 0 6#define sp 1 7#define toc 2 8#define r3 3 --- 81 unchanged lines hidden (view full) --- 90#define GLUE(a,b) XGLUE(a,b) 91 92/* 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. 96 */ 97 | 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" */ 4 5#define r0 0 6#define sp 1 7#define toc 2 8#define r3 3 --- 81 unchanged lines hidden (view full) --- 90#define GLUE(a,b) XGLUE(a,b) 91 92/* 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. 96 */ 97 |
98#ifdef _RELOCATABLE 99#define DESC_SECTION ".got2" 100#else 101#define DESC_SECTION ".got1" 102#endif 103 104#if defined(_CALL_AIXDESC) | 98#if defined (__powerpc64__) |
105#define FUNC_NAME(name) GLUE(.,name) 106#define JUMP_TARGET(name) FUNC_NAME(name) 107#define FUNC_START(name) \ | 99#define FUNC_NAME(name) GLUE(.,name) 100#define JUMP_TARGET(name) FUNC_NAME(name) 101#define FUNC_START(name) \ |
108 .section DESC_SECTION,"aw"; \ | 102 .section ".opd","aw"; \ |
109name: \ | 103name: \ |
110 .long GLUE(.,name); \ 111 .long _GLOBAL_OFFSET_TABLE_; \ 112 .long 0; \ | 104 .quad GLUE(.,name); \ 105 .quad .TOC.@tocbase; \ 106 .quad 0; \ |
113 .previous; \ 114 .type GLUE(.,name),@function; \ 115 .globl name; \ 116 .globl GLUE(.,name); \ 117GLUE(.,name): 118 119#define FUNC_END(name) \ 120GLUE(.L,name): \ 121 .size GLUE(.,name),GLUE(.L,name)-GLUE(.,name) 122 | 107 .previous; \ 108 .type GLUE(.,name),@function; \ 109 .globl name; \ 110 .globl GLUE(.,name); \ 111GLUE(.,name): 112 113#define FUNC_END(name) \ 114GLUE(.L,name): \ 115 .size GLUE(.,name),GLUE(.L,name)-GLUE(.,name) 116 |
123#elif defined (__powerpc64__) | 117#elif defined(_CALL_AIXDESC) 118 119#ifdef _RELOCATABLE 120#define DESC_SECTION ".got2" 121#else 122#define DESC_SECTION ".got1" 123#endif 124 |
124#define FUNC_NAME(name) GLUE(.,name) 125#define JUMP_TARGET(name) FUNC_NAME(name) 126#define FUNC_START(name) \ | 125#define FUNC_NAME(name) GLUE(.,name) 126#define JUMP_TARGET(name) FUNC_NAME(name) 127#define FUNC_START(name) \ |
127 .section ".opd","aw"; \ | 128 .section DESC_SECTION,"aw"; \ |
128name: \ | 129name: \ |
129 .quad GLUE(.,name); \ 130 .quad .TOC.@tocbase; \ 131 .quad 0; \ | 130 .long GLUE(.,name); \ 131 .long _GLOBAL_OFFSET_TABLE_; \ 132 .long 0; \ |
132 .previous; \ 133 .type GLUE(.,name),@function; \ 134 .globl name; \ 135 .globl GLUE(.,name); \ 136GLUE(.,name): 137 138#define FUNC_END(name) \ 139GLUE(.L,name): \ 140 .size GLUE(.,name),GLUE(.L,name)-GLUE(.,name) 141 142#else | 133 .previous; \ 134 .type GLUE(.,name),@function; \ 135 .globl name; \ 136 .globl GLUE(.,name); \ 137GLUE(.,name): 138 139#define FUNC_END(name) \ 140GLUE(.L,name): \ 141 .size GLUE(.,name),GLUE(.L,name)-GLUE(.,name) 142 143#else |
144 |
|
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) 146#else 147#define JUMP_TARGET(name) FUNC_NAME(name) 148#endif 149#define FUNC_START(name) \ 150 .type FUNC_NAME(name),@function; \ 151 .globl FUNC_NAME(name); \ 152FUNC_NAME(name): 153 154#define FUNC_END(name) \ 155GLUE(.L,name): \ 156 .size FUNC_NAME(name),GLUE(.L,name)-FUNC_NAME(name) 157#endif 158 | 145#define FUNC_NAME(name) GLUE(__USER_LABEL_PREFIX__,name) 146#if defined __PIC__ || defined __pic__ 147#define JUMP_TARGET(name) FUNC_NAME(name@plt) 148#else 149#define JUMP_TARGET(name) FUNC_NAME(name) 150#endif 151#define FUNC_START(name) \ 152 .type FUNC_NAME(name),@function; \ 153 .globl FUNC_NAME(name); \ 154FUNC_NAME(name): 155 156#define FUNC_END(name) \ 157GLUE(.L,name): \ 158 .size FUNC_NAME(name),GLUE(.L,name)-FUNC_NAME(name) 159#endif 160 |
161#if defined __linux__ && !defined __powerpc64__ 162 .section .note.GNU-stack 163 .previous 164#endif |
|