Re: Mach-O and SECTON .rotext

David DeHaven <[email protected]>
Newsgroups gmane.comp.video.xvid.devel
Message-ID <[email protected]>
> 1) It still requires section name as ".text", not ".rotext"
>
> Requires rename section for Mach-O binary; ifdef macro would be better
> though
> vi ../../src/nasm.inc
>
> %macro TEXT 0
> -      SECTION .rotext align=SECTION_ALIGN
> +      SECTION .text align=SECTION_ALIGN
> %endmacro


I had my own patch that basically did:
-%ifdef FORMAT_COFF
-SECTION .rodata
-%else
-SECTION .rodata align=16
-%endif
+SECTION SECT_RODATA


Then declared:

%ifidn __OUTPUT_FORMAT__,macho
     %define SECT_RODATA .text align=16
%else
     %ifdef FORMAT_COFF
         %define SECT_RODATA .rodata
     %else
         %define SECT_RODATA .rodata align=16
     %endif
%endif

in a global macro file.

Works on:
NASM version 0.98.40 (Apple Computer, Inc. build 11) compiled on Feb  
19 2008
yasm 0.7.1.2093 (darwin)
yasm 0.7.2.2153 (mingw32 and linux)

-DrD-
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.