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
36 # define __has_feature(x) 0
39 .macro function name, export=0, align=2
41 ELF .size \name, . - \name
48 .global EXTERN_ASM\name
49 ELF .type EXTERN_ASM\name, %function
50 FUNC .func EXTERN_ASM\name
53 ELF .type \name, %function
59 .macro const name, align=2, relocate=0
61 ELF .size \name, . - \name
64 #if HAVE_SECTION_DATA_REL_RO
72 #elif !defined(__MACH__)
81 .macro movrel rd, val, offset=0
82 #if CONFIG_PIC && defined(__APPLE__)
85 add \rd, \rd, \val@PAGEOFF
86 sub \rd, \rd, -(\offset)
88 adrp \rd, \val+(\offset)@PAGE
89 add \rd, \rd, \val+(\offset)@PAGEOFF
91 #elif CONFIG_PIC && defined(_WIN32)
94 add \rd, \rd, :lo12:\val
95 sub \rd, \rd, -(\offset)
97 adrp \rd, \val+(\offset)
98 add \rd, \rd, :lo12:\val+(\offset)
101 # if __has_feature(hwaddress_sanitizer)
102 adrp \rd, :pg_hi21_nc:\val+(\offset)
104 adrp \rd, \val+(\offset)
106 add \rd, \rd, :lo12:\val+(\offset)
108 ldr \rd, =\val+\offset
112 #define GLUE(a, b) a ## b
113 #define JOIN(a, b) GLUE(a, b)
114 #define X(s) JOIN(EXTERN_ASM, s)
116 #define x18 do_not_use_x18
117 #define w18 do_not_use_w18