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

Tom Tan Tom.Tan at microsoft.com
Fri Jan 11 21:38:11 EET 2019

Thanks Carl. Martin made a better fix when porting this to libav which uses .rdata as section name instead of .rodata with explicit read-only property. .rdata is read-only in COFF by default. I updated my patch accordingly, thanks Martin.

Yes, this applies to 32-bit arm for Windows, the new patch includes this update. This also affects Windows x86/x64, but this has already been handled as below macro from FFmpeg\libavutil\x86\x86inc.asm.

%macro SECTION_RODATA 0-1 16
    %ifidn __OUTPUT_FORMAT__,aout
        SECTION .text
    %elifidn __OUTPUT_FORMAT__,coff
        SECTION .text
    %elifidn __OUTPUT_FORMAT__,win32
        SECTION .rdata align=%1
    %elif WIN64
        SECTION .rdata align=%1
        SECTION .rodata align=%1

-----Original Message-----
From: ffmpeg-devel <ffmpeg-devel-bounces at ffmpeg.org> On Behalf Of Carl Eugen Hoyos
Sent: Friday, January 11, 2019 5:07 AM
To: FFmpeg development discussions and patches <ffmpeg-devel at ffmpeg.org>
Subject: Re: [FFmpeg-devel] [PATCH] Mark .rodata section as read only in COFF object file

2019-01-10 21:14 GMT+01:00, 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.
> The issue happens when building Chromium for Windows ARM64, with FFmpeg.

Does this issue only apply to arm64 or also 32bit arm?

Carl Eugen
ffmpeg-devel mailing list
ffmpeg-devel at ffmpeg.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Switch-.rodata-section-name-to-.rdata-for-COFF-objec.patch
Type: application/octet-stream
Size: 1388 bytes
Desc: 0001-Switch-.rodata-section-name-to-.rdata-for-COFF-objec.patch
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20190111/cc2a12e6/attachment.obj>

More information about the ffmpeg-devel mailing list