/*1* Copyright (c) 2008 Mans Rullgard <[email protected]>2*3* This file is part of FFmpeg.4*5* FFmpeg is free software; you can redistribute it and/or6* modify it under the terms of the GNU Lesser General Public7* License as published by the Free Software Foundation; either8* version 2.1 of the License, or (at your option) any later version.9*10* FFmpeg is distributed in the hope that it will be useful,11* but WITHOUT ANY WARRANTY; without even the implied warranty of12* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU13* Lesser General Public License for more details.14*15* You should have received a copy of the GNU Lesser General Public16* License along with FFmpeg; if not, write to the Free Software17* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA18*/1920#include "config.h"2122#ifdef __ELF__23# define ELF24#else25# define ELF #26#endif2728#if HAVE_AS_FUNC29# define FUNC30#else31# define FUNC #32#endif3334.macro function name, export=0, align=235.macro endfunc36ELF .size \name, . - \name37FUNC .endfunc38.purgem endfunc39.endm40.text41.align \align42.if \export43.global EXTERN_ASM\name44ELF .type EXTERN_ASM\name, %function45FUNC .func EXTERN_ASM\name46EXTERN_ASM\name:47.else48ELF .type \name, %function49FUNC .func \name50\name:51.endif52.endm5354.macro const name, align=2, relocate=055.macro endconst56ELF .size \name, . - \name57.purgem endconst58.endm59#if HAVE_SECTION_DATA_REL_RO60.if \relocate61.section .data.rel.ro62.else63.section .rodata64.endif65#elif !defined(__MACH__)66.section .rodata67#else68.const_data69#endif70.align \align71\name:72.endm7374.macro movrel rd, val75#if CONFIG_PIC && defined(__APPLE__)76adrp \rd, \val@PAGE77add \rd, \rd, \val@PAGEOFF78#elif CONFIG_PIC79adrp \rd, \val80add \rd, \rd, :lo12:\val81#else82ldr \rd, =\val83#endif84.endm8586#define GLUE(a, b) a ## b87#define JOIN(a, b) GLUE(a, b)88#define X(s) JOIN(EXTERN_ASM, s)899091