[x264-devel] [PATCH 12/14] arm: Use .section .rodata for non-elf, non-mach platforms as well

Martin Storsjö martin at martin.st
Fri Mar 24 10:33:44 CET 2017


If targeting windows with armasm, gas-preprocessor can rewrite the
.section .rodata into the right construct for that platform.
---
Alternatively we an add a third prefix, e.g. COFF. In that case,
gas-preprocessor needs to be updated to define e.g. __COFF__ when
invoking the build platform's cpp when preprocessing for use with
armasm. Since compilers normally don't seem to define __COFF__,
perhaps it should use e.g. _WIN32 instead in that case?
---
 common/arm/asm.S | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/common/arm/asm.S b/common/arm/asm.S
index 5eb2881..c46b61b 100644
--- a/common/arm/asm.S
+++ b/common/arm/asm.S
@@ -54,8 +54,10 @@
 
 #ifdef __MACH__
 #   define MACH
+#   define NONMACH @
 #else
 #   define MACH @
+#   define NONMACH
 #endif
 
 #if HAVE_AS_FUNC
@@ -108,7 +110,7 @@ ELF     .size   \name, . - \name
 .if HAVE_SECTION_DATA_REL_RO && \relocate
         .section        .data.rel.ro
 .else
-ELF     .section        .rodata
+NONMACH .section        .rodata
 MACH    .const_data
 .endif
         .align          \align
-- 
2.7.4



More information about the x264-devel mailing list