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

Tom Tan Tom.Tan at microsoft.com
Thu Jan 10 22:14:24 EET 2019


.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.

The issue happens when building Chromium for Windows ARM64, with FFmpeg.

---
 libavutil/aarch64/asm.S | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavutil/aarch64/asm.S b/libavutil/aarch64/asm.S
index fd32bf784e..abc2f69f43 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
-- 
2.15.1.gvfs.2.39.g03d366a
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Mark-.rodata-section-as-read-only-in-COFF-object-fil.patch
Type: application/octet-stream
Size: 991 bytes
Desc: 0001-Mark-.rodata-section-as-read-only-in-COFF-object-fil.patch
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20190110/d05b2d56/attachment.obj>


More information about the ffmpeg-devel mailing list