Upstream version 5.34.104.0
[platform/framework/web/crosswalk.git] / src / native_client / src / include / nacl_asm.h
index 2af8d3b..cc3a2e3 100644 (file)
 # error "Unrecognized OS"
 #endif
 
-#define DEFINE_GLOBAL_HIDDEN_IDENTIFIER(n) \
+/*
+ * ARM requires .type XXX, %function to ensure proper switching between
+ * Thumb and ARM instruction sets.  We do not use '.type' globally because
+ * OSX builds use llvm which does not support '.type', and neither does
+ * the assembler under Windows.
+ */
+#if !defined(__llvm__) && !defined(NACL_WINDOWS)
+
+#define DEFINE_GLOBAL_HIDDEN_DATA(n) \
+  .globl IDENTIFIER(n); HIDDEN(n); .type IDENTIFIER(n), %object; IDENTIFIER(n)
+
+#define DEFINE_GLOBAL_HIDDEN_FUNCTION(n) \
+  .globl IDENTIFIER(n); HIDDEN(n); .type IDENTIFIER(n), %function; IDENTIFIER(n)
+
+#else
+
+#define DEFINE_GLOBAL_HIDDEN_DATA(n) \
+  .globl IDENTIFIER(n); HIDDEN(n); IDENTIFIER(n)
+
+#define DEFINE_GLOBAL_HIDDEN_FUNCTION(n) \
+  .globl IDENTIFIER(n); HIDDEN(n); IDENTIFIER(n)
+
+#endif
+
+#define DEFINE_GLOBAL_HIDDEN_LOCATION(n) \
   .globl IDENTIFIER(n); HIDDEN(n); IDENTIFIER(n)
 
 #endif  /* NATIVE_CLIENT_SRC_INCLUDE_NACL_ASM_H_ */