arm: Suppress tags about used cpu arch and extensions
authorMartin Storsjö <martin@martin.st>
Tue, 17 Feb 2015 22:40:06 +0000 (00:40 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Sat, 21 Mar 2015 00:52:52 +0000 (01:52 +0100)
When all the codepaths using manually set .arch/.fpu code is
behind runtime detection, the elf attributes should be suppressed.

This allows tools to know that the final built binary doesn't
strictly require these extensions.

Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit dcae2e32f7d8a1ca5fb8c1e4aa81313be854dd73)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
configure
libavutil/arm/asm.S

index 8e01193..37172aa 100755 (executable)
--- a/configure
+++ b/configure
@@ -1760,6 +1760,7 @@ SYSTEM_FUNCS="
 TOOLCHAIN_FEATURES="
     as_dn_directive
     as_func
+    as_object_arch
     asm_mod_q
     attribute_may_alias
     attribute_packed
@@ -4463,6 +4464,11 @@ if enabled_any arm aarch64 || enabled_all ppc altivec && enabled asm; then
 .func test
 .endfunc
 EOF
+
+    # llvm's integrated assembler supports .object_arch from llvm 3.5
+    enabled arm && test "$objformat" = elf && check_as <<EOF && enable as_object_arch
+.object_arch armv4
+EOF
 fi
 
 check_inline_asm inline_asm_labels '"1:\n"'
index 35559ce..30b3dc2 100644 (file)
 #elif HAVE_ARMV5TE
         .arch           armv5te
 #endif
+#if   HAVE_AS_OBJECT_ARCH
+ELF     .object_arch    armv4
+#endif
 
 #if   HAVE_NEON
         .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
+ELF     .eabi_attribute 10, 0           @ suppress Tag_FP_arch
 #endif
 
         .syntax unified