Discussion:
x86inc: Use .rdata instead of .rodata on Windows
(too old to reply)
Henrik Gramner
2017-12-25 19:39:34 UTC
Permalink
Raw Message
x264 | branch: master | Henrik Gramner <***@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

Loading...