[x264-devel] x86inc: Use .rdata instead of .rodata on Windows

Henrik Gramner git at videolan.org
Mon Dec 25 20:39:34 CET 2017


x264 | branch: master | Henrik Gramner <henrik at gramner.com> | Tue Aug 15 16:11:32 2017 +0200| [67b5c961046621a4554a9577e68cd9e31a212091] | committer: Anton Mitrofanov

x86inc: Use .rdata instead of .rodata on Windows

The standard section for read-only data on Windows is .rdata. Nasm will
flag non-standard sections as executable by default which isn't ideal.

> http://git.videolan.org/gitweb.cgi/x264.git/?a=commit;h=67b5c961046621a4554a9577e68cd9e31a212091
---

 common/x86/x86inc.asm | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/common/x86/x86inc.asm b/common/x86/x86inc.asm
index 4e1fdb34..3ee32f73 100644
--- a/common/x86/x86inc.asm
+++ b/common/x86/x86inc.asm
@@ -80,7 +80,13 @@
 %endif
 
 %macro SECTION_RODATA 0-1 16
-    SECTION .rodata align=%1
+    %ifidn __OUTPUT_FORMAT__,win32
+        SECTION .rdata align=%1
+    %elif WIN64
+        SECTION .rdata align=%1
+    %else
+        SECTION .rodata align=%1
+    %endif
 %endmacro
 
 %if WIN64



More information about the x264-devel mailing list