1 /* PowerPC asm definitions for GNU C.
3 Copyright (C) 2002, 2003, 2008, 2009 Free Software Foundation, Inc.
5 This file is part of GCC.
7 GCC is free software; you can redistribute it and/or modify it under
8 the terms of the GNU General Public License as published by the Free
9 Software Foundation; either version 3, or (at your option) any later
12 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
13 WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
17 Under Section 7 of GPL version 3, you are granted additional
18 permissions described in the GCC Runtime Library Exception, version
19 3.1, as published by the Free Software Foundation.
21 You should have received a copy of the GNU General Public License and
22 a copy of the GCC Runtime Library Exception along with this program;
23 see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
24 <http://www.gnu.org/licenses/>. */
26 /* Under winnt, 1) gas supports the following as names and 2) in particular
27 defining "toc" breaks the FUNC_START macro as ".toc" becomes ".2" */
242 * Macros to glue together two tokens.
246 #define XGLUE(a,b) a##b
248 #define XGLUE(a,b) a/**/b
251 #define GLUE(a,b) XGLUE(a,b)
254 * Macros to begin and end a function written in assembler. If -mcall-aixdesc
255 * or -mcall-nt, create a function descriptor with the given name, and create
256 * the real function with one or two leading periods respectively.
259 #if defined (__powerpc64__)
260 #define FUNC_NAME(name) GLUE(.,name)
261 #define JUMP_TARGET(name) FUNC_NAME(name)
262 #define FUNC_START(name) \
263 .section ".opd","aw"; \
265 .quad GLUE(.,name); \
266 .quad .TOC.@tocbase; \
269 .type GLUE(.,name),@function; \
271 .globl GLUE(.,name); \
274 #define HIDDEN_FUNC(name) \
277 .hidden GLUE(.,name);
279 #define FUNC_END(name) \
281 .size GLUE(.,name),GLUE(.L,name)-GLUE(.,name)
283 #elif defined(_CALL_AIXDESC)
286 #define DESC_SECTION ".got2"
288 #define DESC_SECTION ".got1"
291 #define FUNC_NAME(name) GLUE(.,name)
292 #define JUMP_TARGET(name) FUNC_NAME(name)
293 #define FUNC_START(name) \
294 .section DESC_SECTION,"aw"; \
296 .long GLUE(.,name); \
297 .long _GLOBAL_OFFSET_TABLE_; \
300 .type GLUE(.,name),@function; \
302 .globl GLUE(.,name); \
305 #define HIDDEN_FUNC(name) \
308 .hidden GLUE(.,name);
310 #define FUNC_END(name) \
312 .size GLUE(.,name),GLUE(.L,name)-GLUE(.,name)
316 #define FUNC_NAME(name) GLUE(__USER_LABEL_PREFIX__,name)
317 #if defined __PIC__ || defined __pic__
318 #define JUMP_TARGET(name) FUNC_NAME(name@plt)
320 #define JUMP_TARGET(name) FUNC_NAME(name)
322 #define FUNC_START(name) \
323 .type FUNC_NAME(name),@function; \
324 .globl FUNC_NAME(name); \
327 #define HIDDEN_FUNC(name) \
329 .hidden FUNC_NAME(name);
331 #define FUNC_END(name) \
333 .size FUNC_NAME(name),GLUE(.L,name)-FUNC_NAME(name)
337 /* For HAVE_GAS_CFI_DIRECTIVE. */
338 #include "auto-host.h"
340 #ifdef HAVE_GAS_CFI_DIRECTIVE
341 # define CFI_STARTPROC .cfi_startproc
342 # define CFI_ENDPROC .cfi_endproc
343 # define CFI_OFFSET(reg, off) .cfi_offset reg, off
344 # define CFI_DEF_CFA_REGISTER(reg) .cfi_def_cfa_register reg
345 # define CFI_RESTORE(reg) .cfi_restore reg
347 # define CFI_STARTPROC
349 # define CFI_OFFSET(reg, off)
350 # define CFI_DEF_CFA_REGISTER(reg)
351 # define CFI_RESTORE(reg)
355 #if defined __linux__ && !defined __powerpc64__
356 .section
.note
.GNU
-stack