# define FUNC @
#endif
+#if HAVE_AS_FPU_DIRECTIVE
+# define FPU
+#else
+# define FPU @
+#endif
+
+#if CONFIG_THUMB && defined(__APPLE__)
+# define TFUNC
+#else
+# define TFUNC @
+#endif
+
+#if HAVE_AS_ARCH_DIRECTIVE
#if HAVE_NEON
.arch armv7-a
#elif HAVE_ARMV6T2
#elif HAVE_ARMV5TE
.arch armv5te
#endif
+#endif
+#if HAVE_AS_OBJECT_ARCH
+ELF .object_arch armv4
+#endif
#if HAVE_NEON
- .fpu neon
+FPU .fpu neon
+ELF .eabi_attribute 10, 0 @ suppress Tag_FP_arch
+ELF .eabi_attribute 12, 0 @ suppress Tag_Advanced_SIMD_arch
#elif HAVE_VFP
- .fpu vfp
+FPU .fpu vfp
+ELF .eabi_attribute 10, 0 @ suppress Tag_FP_arch
#endif
.syntax unified
put_pic %(.Lpic_idx - 1)
.noaltmacro
.endif
+ .if .Lpic_gp
+ .unreq gp
+ .endif
ELF .size \name, . - \name
FUNC .endfunc
.purgem endfunc
.global EXTERN_ASM\name
ELF .type EXTERN_ASM\name, %function
FUNC .func EXTERN_ASM\name
+TFUNC .thumb_func EXTERN_ASM\name
EXTERN_ASM\name:
.else
ELF .type \name, %function
FUNC .func \name
+TFUNC .thumb_func \name
\name:
.endif
.endm
-.macro const name, align=2
+.macro const name, align=2, relocate=0
.macro endconst
ELF .size \name, . - \name
.purgem endconst
.endm
+#if HAVE_SECTION_DATA_REL_RO
+.if \relocate
+ .section .data.rel.ro
+.else
.section .rodata
+.endif
+#elif defined(_WIN32)
+ .section .rdata
+#elif !defined(__MACH__)
+ .section .rodata
+#else
+ .const_data
+#endif
.align \align
\name:
.endm
.endm
.macro movrelx rd, val, gp
+ .ifc \rd,\gp
+ .error "movrelx needs two distinct registers"
+ .endif
+ .ifc \rd\()_\gp,r12_
+ .warning "movrelx rd=\rd without explicit set gp"
+ .endif
+ .ifc \rd\()_\gp,ip_
+ .warning "movrelx rd=\rd without explicit set gp"
+ .endif
#if CONFIG_PIC && defined(__ELF__)
.ifnb \gp
.if .Lpic_gp