[libav-devel] [PATCH] arm: Mark .rodata section as read only in COFF object file

Martin Storsjö martin at martin.st
Thu Jan 10 21:59:27 CET 2019


From: Tom Tan <Tom.Tan at microsoft.com>

.rodata directive from GAS assembly produces .rodata as read/write for COFF
object file by default (object file format for Windows), but read only for
ELF. This change marks it as read only explicitly for COFF.

Signed-off-by: Martin Storsjö <martin at martin.st>
---
 libavutil/aarch64/asm.S | 2 ++
 libavutil/arm/asm.S     | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/libavutil/aarch64/asm.S b/libavutil/aarch64/asm.S
index 15b55d57d2..65341d58cd 100644
--- a/libavutil/aarch64/asm.S
+++ b/libavutil/aarch64/asm.S
@@ -63,6 +63,8 @@ ELF     .size   \name, . - \name
 .else
         .section        .rodata
 .endif
+#elif defined(_WIN32)
+        .section        .rodata, "r"
 #elif !defined(__MACH__)
         .section        .rodata
 #else
diff --git a/libavutil/arm/asm.S b/libavutil/arm/asm.S
index 62ce493180..06c3413489 100644
--- a/libavutil/arm/asm.S
+++ b/libavutil/arm/asm.S
@@ -125,6 +125,8 @@ ELF     .size   \name, . - \name
 .else
         .section        .rodata
 .endif
+#elif defined(_WIN32)
+        .section        .rodata, "r"
 #elif !defined(__MACH__)
         .section        .rodata
 #else
-- 
2.17.2 (Apple Git-113)



More information about the libav-devel mailing list