2 * Copyright (c) 2008 Mans Rullgard <mans@mansr.com>
4 * This file is part of FFmpeg.
6 * FFmpeg is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * FFmpeg is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with FFmpeg; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
35 .macro function name, export=0, align=2
37 ELF .size \name, . - \name
44 .global EXTERN_ASM\name
45 ELF .type EXTERN_ASM\name, %function
46 FUNC .func EXTERN_ASM\name
49 ELF .type \name, %function
55 .macro const name, align=2, relocate=0
57 ELF .size \name, . - \name
60 #if HAVE_SECTION_DATA_REL_RO
66 #elif !defined(__MACH__)
75 .macro movrel rd, val, offset=0
76 #if CONFIG_PIC && defined(__APPLE__)
79 add \rd, \rd, \val@PAGEOFF
80 sub \rd, \rd, -(\offset)
82 adrp \rd, \val+(\offset)@PAGE
83 add \rd, \rd, \val+(\offset)@PAGEOFF
86 adrp \rd, \val+(\offset)
87 add \rd, \rd, :lo12:\val+(\offset)
89 ldr \rd, =\val+\offset
93 #define GLUE(a, b) a ## b
94 #define JOIN(a, b) GLUE(a, b)
95 #define X(s) JOIN(EXTERN_ASM, s)