; Local Data (Read Only)
;=============================================================================
-%ifdef FORMAT_COFF
-SECTION .rodata data
-%else
-SECTION .rodata data align=16
-%endif
+SECTION_RODATA
;-----------------------------------------------------------------------------
; Various memory constants (trigonometric values or rounding values)
; Macros and other preprocessor constants
;=============================================================================
+; Symbol prefix for C linkage
%macro cglobal 1
%ifdef PREFIX
global _%1
%endif
%endmacro
+; Name of the .rodata section. On OS X we cannot use .rodata because NASM
+; is unable to compute address offsets outside of .text so we use the .text
+; section instead until NASM is fixed.
+%macro SECTION_RODATA 0
+ %ifidn __OUTPUT_FORMAT__,macho
+ SECTION .text
+ %else
+ SECTION .rodata data align=16
+ %endif
+%endmacro
+
; PIC support macros. All these macros are totally harmless when __PIC__ is
; not defined but can ruin everything if misused in PIC mode. On x86, shared
; objects cannot directly access global variables by address, they need to