The x86 assembly FFT implementation uses dispatch tables in .text. This is

incompatible with x-only so move them into .data.rel.ro where we can have
relocations.  But since they are in the RELRO segment they will be made
read-only by ld.so after relocations have been processed.

ok robert@ (who tested i386)
This commit is contained in:
kettenis 2023-01-24 14:13:12 +00:00
parent 91363bdf61
commit a3a24ba5a1
2 changed files with 38 additions and 1 deletions

View File

@ -2,7 +2,7 @@ COMMENT= audio/video converter and streamer
V= 4.4.3
DISTNAME= ffmpeg-${V}
REVISION= 2
REVISION= 3
EPOCH= 1
CATEGORIES= graphics multimedia
MASTER_SITES= https://ffmpeg.org/releases/

View File

@ -0,0 +1,37 @@
Index: libavcodec/x86/fft.asm
--- libavcodec/x86/fft.asm.orig
+++ libavcodec/x86/fft.asm
@@ -548,10 +548,6 @@ DEFINE_ARGS zc, w, n, o1, o3
%macro FFT_DISPATCH 2; clobbers 5 GPRs, 8 XMMs
lea r2, [dispatch_tab%1]
mov r2, [r2 + (%2q-2)*gprsize]
-%ifdef PIC
- lea r3, [$$]
- add r2, r3
-%endif
call r2
%endmacro ; FFT_DISPATCH
@@ -731,11 +727,7 @@ DECL_PASS pass_interleave_3dnow, PASS_BIG 0
%define pass_interleave_3dnowext pass_interleave_3dnow
%endif
-%ifdef PIC
-%define SECTION_REL - $$
-%else
%define SECTION_REL
-%endif
%macro DECL_FFT 1-2 ; nbits, suffix
%ifidn %0, 1
@@ -773,8 +765,10 @@ fft %+ n %+ fullsuffix:
%endrep
%undef n
+[SECTION .data.rel.ro write]
align 8
dispatch_tab %+ fullsuffix: pointer list_of_fft
+__?SECT?__
%endmacro ; DECL_FFT
%if HAVE_AVX_EXTERNAL