From ecba11e86e78259c95885c69bc965bdb2ab68cac Mon Sep 17 00:00:00 2001 From: Clement Rey Date: Tue, 15 Oct 2024 10:30:11 +0200 Subject: [PATCH 1/2] Linux/x64: prevent illegal relocations --- src/ext/x86/x86inc.asm | 13 +++++++++++++ src/x86/filmgrain_common.asm | 2 +- src/x86/ipred16_avx2.asm | 4 ++-- src/x86/ipred16_avx512.asm | 8 ++++---- src/x86/ipred16_sse.asm | 8 ++++---- src/x86/ipred_avx2.asm | 4 ++-- src/x86/ipred_avx512.asm | 4 ++-- src/x86/ipred_sse.asm | 4 ++-- src/x86/looprestoration16_avx2.asm | 4 ++-- src/x86/looprestoration16_avx512.asm | 2 +- src/x86/looprestoration16_sse.asm | 2 +- src/x86/looprestoration_avx512.asm | 2 +- src/x86/looprestoration_sse.asm | 2 +- src/x86/mc16_avx2.asm | 6 +++--- src/x86/mc16_avx512.asm | 8 ++++---- src/x86/mc16_sse.asm | 6 +++--- src/x86/mc_avx2.asm | 8 ++++---- src/x86/mc_avx512.asm | 6 +++--- src/x86/mc_sse.asm | 4 ++-- 19 files changed, 55 insertions(+), 42 deletions(-) diff --git a/src/ext/x86/x86inc.asm b/src/ext/x86/x86inc.asm index fc490b6f4..799ed0e0d 100644 --- a/src/ext/x86/x86inc.asm +++ b/src/ext/x86/x86inc.asm @@ -868,6 +868,19 @@ BRANCH_INSTR jz, je, jnz, jne, jl, jle, jnl, jnle, jg, jge, jng, jnge, ja, jae, extern %1 %endmacro +; %2 and %3 give control over symbol type and symbol visibility, respectively. +; E.g. `cextern_args some_symbol,data,hidden`. +; +; This can be life saving in position-independent contexts, where it is very easy to generate +; illegal relocations otherwise. +; +; See for more information. +%macro cextern_args 3 + %xdefine %1 mangle(private_prefix %+ _ %+ %1) + CAT_XDEFINE cglobaled_, %1, 2 + extern %1:%2 %3 +%endmacro + ; Like cextern, but without the prefix. This should be used for symbols from external libraries. %macro cextern_naked 1 %ifdef PREFIX diff --git a/src/x86/filmgrain_common.asm b/src/x86/filmgrain_common.asm index 74f7044e6..8d88adc8b 100644 --- a/src/x86/filmgrain_common.asm +++ b/src/x86/filmgrain_common.asm @@ -43,4 +43,4 @@ struc FGData .clip_to_restricted_range: resd 1 endstruc -cextern gaussian_sequence +cextern_args gaussian_sequence,data,hidden diff --git a/src/x86/ipred16_avx2.asm b/src/x86/ipred16_avx2.asm index 7b52abaa1..e083e0df3 100644 --- a/src/x86/ipred16_avx2.asm +++ b/src/x86/ipred16_avx2.asm @@ -129,8 +129,8 @@ JMP_TABLE ipred_cfl_left_16bpc, avx2, h4, h8, h16, h32 JMP_TABLE ipred_cfl_ac_444_16bpc, avx2, w4, w8, w16, w32 JMP_TABLE pal_pred_16bpc, avx2, w4, w8, w16, w32, w64 -cextern dr_intra_derivative -cextern filter_intra_taps +cextern_args dr_intra_derivative,data,hidden +cextern_args filter_intra_taps,data,hidden SECTION .text diff --git a/src/x86/ipred16_avx512.asm b/src/x86/ipred16_avx512.asm index 69802614c..c19765e97 100644 --- a/src/x86/ipred16_avx512.asm +++ b/src/x86/ipred16_avx512.asm @@ -121,10 +121,10 @@ JMP_TABLE ipred_z2_16bpc, avx512icl, w4, w8, w16, w32, w64 JMP_TABLE ipred_z3_16bpc, avx512icl, w4, w8, w16, w32, w64 JMP_TABLE pal_pred_16bpc, avx512icl, w4, w8, w16, w32, w64 -cextern smooth_weights_1d_16bpc -cextern smooth_weights_2d_16bpc -cextern dr_intra_derivative -cextern filter_intra_taps +cextern_args smooth_weights_1d_16bpc,data,hidden +cextern_args smooth_weights_2d_16bpc,data,hidden +cextern_args dr_intra_derivative,data,hidden +cextern_args filter_intra_taps,data,hidden SECTION .text diff --git a/src/x86/ipred16_sse.asm b/src/x86/ipred16_sse.asm index 5a311b144..735f5f494 100644 --- a/src/x86/ipred16_sse.asm +++ b/src/x86/ipred16_sse.asm @@ -99,10 +99,10 @@ JMP_TABLE ipred_cfl_left_16bpc, ssse3, h4, h8, h16, h32 JMP_TABLE ipred_cfl_ac_444_16bpc, ssse3, w4, w8, w16, w32 JMP_TABLE pal_pred_16bpc, ssse3, w4, w8, w16, w32, w64 -cextern smooth_weights_1d_16bpc -cextern smooth_weights_2d_16bpc -cextern dr_intra_derivative -cextern filter_intra_taps +cextern_args smooth_weights_1d_16bpc,data,hidden +cextern_args smooth_weights_2d_16bpc,data,hidden +cextern_args dr_intra_derivative,data,hidden +cextern_args filter_intra_taps,data,hidden SECTION .text diff --git a/src/x86/ipred_avx2.asm b/src/x86/ipred_avx2.asm index 2956ffaf2..2acf0bbc1 100644 --- a/src/x86/ipred_avx2.asm +++ b/src/x86/ipred_avx2.asm @@ -173,8 +173,8 @@ JMP_TABLE ipred_cfl_ac_422, avx2, w16_pad1, w16_pad2, w16_pad3 JMP_TABLE ipred_cfl_ac_444, avx2, w32_pad1, w32_pad2, w32_pad3, w4, w8, w16, w32 JMP_TABLE pal_pred, avx2, w4, w8, w16, w32, w64 -cextern dr_intra_derivative -cextern filter_intra_taps +cextern_args dr_intra_derivative,data,hidden +cextern_args filter_intra_taps,data,hidden SECTION .text diff --git a/src/x86/ipred_avx512.asm b/src/x86/ipred_avx512.asm index de953deba..05fd50ec8 100644 --- a/src/x86/ipred_avx512.asm +++ b/src/x86/ipred_avx512.asm @@ -213,8 +213,8 @@ JMP_TABLE ipred_dc_8bpc, avx512icl, h4, h8, h16, h32, h64, w4, w8, w16, s4-10*4, s8-10*4, s16-10*4, s32-10*4, s64-10*4 JMP_TABLE ipred_dc_left_8bpc, avx512icl, h4, h8, h16, h32, h64 -cextern dr_intra_derivative -cextern pb_0to63 +cextern_args dr_intra_derivative,data,hidden +cextern_args pb_0to63,data,hidden SECTION .text diff --git a/src/x86/ipred_sse.asm b/src/x86/ipred_sse.asm index f6b0cad00..8e28c11aa 100644 --- a/src/x86/ipred_sse.asm +++ b/src/x86/ipred_sse.asm @@ -141,8 +141,8 @@ JMP_TABLE ipred_cfl, ssse3, h4, h8, h16, h32, w4, w8, w16, w32, \ JMP_TABLE ipred_cfl_left, ssse3, h4, h8, h16, h32 JMP_TABLE ipred_filter, ssse3, w4, w8, w16, w32 -cextern dr_intra_derivative -cextern filter_intra_taps +cextern_args dr_intra_derivative,data,hidden +cextern_args filter_intra_taps,data,hidden SECTION .text diff --git a/src/x86/looprestoration16_avx2.asm b/src/x86/looprestoration16_avx2.asm index 4cf8b905c..5b06b9d8e 100644 --- a/src/x86/looprestoration16_avx2.asm +++ b/src/x86/looprestoration16_avx2.asm @@ -62,8 +62,8 @@ pd_0xf00801c7: dd 0xf00801c7 %define pw_256 sgr_lshuf5 -cextern pb_0to63 -cextern sgr_x_by_x_avx2 +cextern_args pb_0to63,data,hidden +cextern_args sgr_x_by_x_avx2,data,hidden SECTION .text diff --git a/src/x86/looprestoration16_avx512.asm b/src/x86/looprestoration16_avx512.asm index e560c54a4..3db3a7902 100644 --- a/src/x86/looprestoration16_avx512.asm +++ b/src/x86/looprestoration16_avx512.asm @@ -51,7 +51,7 @@ pd_m9: dd -9 pd_8: dd 8 pd_2147483648: dd 2147483648 -cextern sgr_x_by_x +cextern_args sgr_x_by_x,data,hidden SECTION .text diff --git a/src/x86/looprestoration16_sse.asm b/src/x86/looprestoration16_sse.asm index 872e50298..4818b79d7 100644 --- a/src/x86/looprestoration16_sse.asm +++ b/src/x86/looprestoration16_sse.asm @@ -59,7 +59,7 @@ pd_0xfffffff0: times 4 dd 0xfffffff0 wiener_shifts: dw 4, 4, 2048, 2048, 1, 1, 8192, 8192 wiener_round: dd 1049600, 1048832 -cextern sgr_x_by_x +cextern_args sgr_x_by_x,data,hidden SECTION .text diff --git a/src/x86/looprestoration_avx512.asm b/src/x86/looprestoration_avx512.asm index 1e571774c..e32c97aae 100644 --- a/src/x86/looprestoration_avx512.asm +++ b/src/x86/looprestoration_avx512.asm @@ -53,7 +53,7 @@ pd_m9: dd -9 pd_34816: dd 34816 pd_8421376: dd 8421376 -cextern sgr_x_by_x +cextern_args sgr_x_by_x,data,hidden SECTION .text diff --git a/src/x86/looprestoration_sse.asm b/src/x86/looprestoration_sse.asm index b5c73a51d..5df45d859 100644 --- a/src/x86/looprestoration_sse.asm +++ b/src/x86/looprestoration_sse.asm @@ -51,7 +51,7 @@ pd_0xffff: times 4 dd 0xffff pd_0xf00800a4: times 4 dd 0xf00800a4 pd_0xf00801c7: times 4 dd 0xf00801c7 -cextern sgr_x_by_x +cextern_args sgr_x_by_x,data,hidden SECTION .text diff --git a/src/x86/mc16_avx2.asm b/src/x86/mc16_avx2.asm index 6b4424946..bc313aaa9 100644 --- a/src/x86/mc16_avx2.asm +++ b/src/x86/mc16_avx2.asm @@ -194,11 +194,11 @@ SCALED_JMP_TABLE prep_8tap_scaled, avx2, 4, 8, 16, 32, 64, 128 %define table_offset(type, fn) type %+ fn %+ SUFFIX %+ _table - type %+ SUFFIX -cextern mc_subpel_filters +cextern_args mc_subpel_filters,data,hidden %define subpel_filters (mangle(private_prefix %+ _mc_subpel_filters)-8) -cextern mc_warp_filter -cextern resize_filter +cextern_args mc_warp_filter,data,hidden +cextern_args resize_filter,data,hidden SECTION .text diff --git a/src/x86/mc16_avx512.asm b/src/x86/mc16_avx512.asm index 27715c166..617626d2c 100644 --- a/src/x86/mc16_avx512.asm +++ b/src/x86/mc16_avx512.asm @@ -251,12 +251,12 @@ HV_JMP_TABLE prep, 8tap, avx512icl, 2, 4, 8, 16, 32, 64, 128 %define table_offset(type, fn) type %+ fn %+ SUFFIX %+ _table - type %+ SUFFIX -cextern mc_subpel_filters +cextern_args mc_subpel_filters,data,hidden %define subpel_filters (mangle(private_prefix %+ _mc_subpel_filters)-8) -cextern mc_warp_filter -cextern obmc_masks_avx2 -cextern resize_filter +cextern_args mc_warp_filter,data,hidden +cextern_args obmc_masks_avx2,data,hidden +cextern_args resize_filter,data,hidden SECTION .text diff --git a/src/x86/mc16_sse.asm b/src/x86/mc16_sse.asm index b0c42597f..f28e2cec3 100644 --- a/src/x86/mc16_sse.asm +++ b/src/x86/mc16_sse.asm @@ -158,11 +158,11 @@ BASE_JMP_TABLE prep, ssse3, 4, 8, 16, 32, 64, 128 SCALED_JMP_TABLE put_8tap_scaled, ssse3, 2, 4, 8, 16, 32, 64, 128 SCALED_JMP_TABLE prep_8tap_scaled, ssse3, 4, 8, 16, 32, 64, 128 -cextern mc_subpel_filters +cextern_args mc_subpel_filters,data,hidden %define subpel_filters (mangle(private_prefix %+ _mc_subpel_filters)-8) -cextern mc_warp_filter -cextern resize_filter +cextern_args mc_warp_filter,data,hidden +cextern_args resize_filter,data,hidden SECTION .text diff --git a/src/x86/mc_avx2.asm b/src/x86/mc_avx2.asm index df8bebb1c..1d5e214a5 100644 --- a/src/x86/mc_avx2.asm +++ b/src/x86/mc_avx2.asm @@ -91,10 +91,10 @@ pd_0x3ff: dd 0x3ff pd_0x4000: dd 0x4000 pq_0x40000000: dq 0x40000000 -cextern mc_subpel_filters -cextern mc_warp_filter2 -cextern resize_filter -cextern z_filter_s +cextern_args mc_subpel_filters,data,hidden +cextern_args mc_warp_filter2,data,hidden +cextern_args resize_filter,data,hidden +cextern_args z_filter_s,data,hidden %define subpel_filters (mangle(private_prefix %+ _mc_subpel_filters)-8) diff --git a/src/x86/mc_avx512.asm b/src/x86/mc_avx512.asm index 50e670ec2..87f1e2e1f 100644 --- a/src/x86/mc_avx512.asm +++ b/src/x86/mc_avx512.asm @@ -200,10 +200,10 @@ pd_512: dd 512 %define pb_64 (wm_sign+8) %define pd_2 (pd_0to7+8) -cextern mc_subpel_filters +cextern_args mc_subpel_filters,data,hidden %define subpel_filters (mangle(private_prefix %+ _mc_subpel_filters)-8) -cextern mc_warp_filter -cextern resize_filter +cextern_args mc_warp_filter,data,hidden +cextern_args resize_filter,data,hidden %macro BASE_JMP_TABLE 3-* %xdefine %1_%2_table (%%table - %3) diff --git a/src/x86/mc_sse.asm b/src/x86/mc_sse.asm index a447a8016..de77ff5ea 100644 --- a/src/x86/mc_sse.asm +++ b/src/x86/mc_sse.asm @@ -202,7 +202,7 @@ const mc_warp_filter2 ; dav1d_mc_warp_filter[] reordered for pmaddubsw usage pw_258: times 2 dw 258 -cextern mc_subpel_filters +cextern_args mc_subpel_filters,data,hidden %define subpel_filters (mangle(private_prefix %+ _mc_subpel_filters)-8) %macro BIDIR_JMP_TABLE 2-* @@ -9357,7 +9357,7 @@ cglobal emu_edge_8bpc, 10, 13, 2, bw, bh, iw, ih, x, \ %undef reg_blkm %undef reg_tmp -cextern resize_filter +cextern_args resize_filter,data,hidden %macro SCRATCH 3 %if ARCH_X86_32 From 117065e3687ca5a0dbe9524069d100aec20d9760 Mon Sep 17 00:00:00 2001 From: Clement Rey Date: Tue, 15 Oct 2024 17:39:57 +0200 Subject: [PATCH 2/2] Fix assembly on windows --- src/ext/x86/x86inc.asm | 14 ++++++++++---- src/x86/filmgrain_common.asm | 2 +- src/x86/ipred16_avx2.asm | 4 ++-- src/x86/ipred16_avx512.asm | 8 ++++---- src/x86/ipred16_sse.asm | 8 ++++---- src/x86/ipred_avx2.asm | 4 ++-- src/x86/ipred_avx512.asm | 4 ++-- src/x86/ipred_sse.asm | 4 ++-- src/x86/looprestoration16_avx2.asm | 4 ++-- src/x86/looprestoration16_avx512.asm | 2 +- src/x86/looprestoration16_sse.asm | 2 +- src/x86/looprestoration_avx512.asm | 2 +- src/x86/looprestoration_sse.asm | 2 +- src/x86/mc16_avx2.asm | 6 +++--- src/x86/mc16_avx512.asm | 8 ++++---- src/x86/mc16_sse.asm | 6 +++--- src/x86/mc_avx2.asm | 8 ++++---- src/x86/mc_avx512.asm | 6 +++--- src/x86/mc_sse.asm | 4 ++-- 19 files changed, 52 insertions(+), 46 deletions(-) diff --git a/src/ext/x86/x86inc.asm b/src/ext/x86/x86inc.asm index 799ed0e0d..e6e6d51c2 100644 --- a/src/ext/x86/x86inc.asm +++ b/src/ext/x86/x86inc.asm @@ -868,17 +868,23 @@ BRANCH_INSTR jz, je, jnz, jne, jl, jle, jnl, jnle, jg, jge, jng, jnge, ja, jae, extern %1 %endmacro -; %2 and %3 give control over symbol type and symbol visibility, respectively. -; E.g. `cextern_args some_symbol,data,hidden`. +; Like `cextern`, but assumes the symbol is hidden data (i.e. `extern:data hidden`). +; Portable across all supported platforms. ; ; This can be life saving in position-independent contexts, where it is very easy to generate ; illegal relocations otherwise. ; ; See for more information. -%macro cextern_args 3 +%macro cextern_hidden_data 1 %xdefine %1 mangle(private_prefix %+ _ %+ %1) CAT_XDEFINE cglobaled_, %1, 2 - extern %1:%2 %3 + %if FORMAT_ELF + extern %1:data hidden + %elif FORMAT_MACHO && HAVE_PRIVATE_EXTERN + extern %1:private_extern + %else + extern %1 + %endif %endmacro ; Like cextern, but without the prefix. This should be used for symbols from external libraries. diff --git a/src/x86/filmgrain_common.asm b/src/x86/filmgrain_common.asm index 8d88adc8b..f15bf3dc7 100644 --- a/src/x86/filmgrain_common.asm +++ b/src/x86/filmgrain_common.asm @@ -43,4 +43,4 @@ struc FGData .clip_to_restricted_range: resd 1 endstruc -cextern_args gaussian_sequence,data,hidden +cextern_hidden_data gaussian_sequence diff --git a/src/x86/ipred16_avx2.asm b/src/x86/ipred16_avx2.asm index e083e0df3..a11b7f777 100644 --- a/src/x86/ipred16_avx2.asm +++ b/src/x86/ipred16_avx2.asm @@ -129,8 +129,8 @@ JMP_TABLE ipred_cfl_left_16bpc, avx2, h4, h8, h16, h32 JMP_TABLE ipred_cfl_ac_444_16bpc, avx2, w4, w8, w16, w32 JMP_TABLE pal_pred_16bpc, avx2, w4, w8, w16, w32, w64 -cextern_args dr_intra_derivative,data,hidden -cextern_args filter_intra_taps,data,hidden +cextern_hidden_data dr_intra_derivative +cextern_hidden_data filter_intra_taps SECTION .text diff --git a/src/x86/ipred16_avx512.asm b/src/x86/ipred16_avx512.asm index c19765e97..18fc0dbe2 100644 --- a/src/x86/ipred16_avx512.asm +++ b/src/x86/ipred16_avx512.asm @@ -121,10 +121,10 @@ JMP_TABLE ipred_z2_16bpc, avx512icl, w4, w8, w16, w32, w64 JMP_TABLE ipred_z3_16bpc, avx512icl, w4, w8, w16, w32, w64 JMP_TABLE pal_pred_16bpc, avx512icl, w4, w8, w16, w32, w64 -cextern_args smooth_weights_1d_16bpc,data,hidden -cextern_args smooth_weights_2d_16bpc,data,hidden -cextern_args dr_intra_derivative,data,hidden -cextern_args filter_intra_taps,data,hidden +cextern_hidden_data smooth_weights_1d_16bpc +cextern_hidden_data smooth_weights_2d_16bpc +cextern_hidden_data dr_intra_derivative +cextern_hidden_data filter_intra_taps SECTION .text diff --git a/src/x86/ipred16_sse.asm b/src/x86/ipred16_sse.asm index 735f5f494..3416574c0 100644 --- a/src/x86/ipred16_sse.asm +++ b/src/x86/ipred16_sse.asm @@ -99,10 +99,10 @@ JMP_TABLE ipred_cfl_left_16bpc, ssse3, h4, h8, h16, h32 JMP_TABLE ipred_cfl_ac_444_16bpc, ssse3, w4, w8, w16, w32 JMP_TABLE pal_pred_16bpc, ssse3, w4, w8, w16, w32, w64 -cextern_args smooth_weights_1d_16bpc,data,hidden -cextern_args smooth_weights_2d_16bpc,data,hidden -cextern_args dr_intra_derivative,data,hidden -cextern_args filter_intra_taps,data,hidden +cextern_hidden_data smooth_weights_1d_16bpc +cextern_hidden_data smooth_weights_2d_16bpc +cextern_hidden_data dr_intra_derivative +cextern_hidden_data filter_intra_taps SECTION .text diff --git a/src/x86/ipred_avx2.asm b/src/x86/ipred_avx2.asm index 2acf0bbc1..4a5483725 100644 --- a/src/x86/ipred_avx2.asm +++ b/src/x86/ipred_avx2.asm @@ -173,8 +173,8 @@ JMP_TABLE ipred_cfl_ac_422, avx2, w16_pad1, w16_pad2, w16_pad3 JMP_TABLE ipred_cfl_ac_444, avx2, w32_pad1, w32_pad2, w32_pad3, w4, w8, w16, w32 JMP_TABLE pal_pred, avx2, w4, w8, w16, w32, w64 -cextern_args dr_intra_derivative,data,hidden -cextern_args filter_intra_taps,data,hidden +cextern_hidden_data dr_intra_derivative +cextern_hidden_data filter_intra_taps SECTION .text diff --git a/src/x86/ipred_avx512.asm b/src/x86/ipred_avx512.asm index 05fd50ec8..cdd36c23d 100644 --- a/src/x86/ipred_avx512.asm +++ b/src/x86/ipred_avx512.asm @@ -213,8 +213,8 @@ JMP_TABLE ipred_dc_8bpc, avx512icl, h4, h8, h16, h32, h64, w4, w8, w16, s4-10*4, s8-10*4, s16-10*4, s32-10*4, s64-10*4 JMP_TABLE ipred_dc_left_8bpc, avx512icl, h4, h8, h16, h32, h64 -cextern_args dr_intra_derivative,data,hidden -cextern_args pb_0to63,data,hidden +cextern_hidden_data dr_intra_derivative +cextern_hidden_data pb_0to63 SECTION .text diff --git a/src/x86/ipred_sse.asm b/src/x86/ipred_sse.asm index 8e28c11aa..8a1bf08c8 100644 --- a/src/x86/ipred_sse.asm +++ b/src/x86/ipred_sse.asm @@ -141,8 +141,8 @@ JMP_TABLE ipred_cfl, ssse3, h4, h8, h16, h32, w4, w8, w16, w32, \ JMP_TABLE ipred_cfl_left, ssse3, h4, h8, h16, h32 JMP_TABLE ipred_filter, ssse3, w4, w8, w16, w32 -cextern_args dr_intra_derivative,data,hidden -cextern_args filter_intra_taps,data,hidden +cextern_hidden_data dr_intra_derivative +cextern_hidden_data filter_intra_taps SECTION .text diff --git a/src/x86/looprestoration16_avx2.asm b/src/x86/looprestoration16_avx2.asm index 5b06b9d8e..7f1a45663 100644 --- a/src/x86/looprestoration16_avx2.asm +++ b/src/x86/looprestoration16_avx2.asm @@ -62,8 +62,8 @@ pd_0xf00801c7: dd 0xf00801c7 %define pw_256 sgr_lshuf5 -cextern_args pb_0to63,data,hidden -cextern_args sgr_x_by_x_avx2,data,hidden +cextern_hidden_data pb_0to63 +cextern_hidden_data sgr_x_by_x_avx2 SECTION .text diff --git a/src/x86/looprestoration16_avx512.asm b/src/x86/looprestoration16_avx512.asm index 3db3a7902..2722d0e70 100644 --- a/src/x86/looprestoration16_avx512.asm +++ b/src/x86/looprestoration16_avx512.asm @@ -51,7 +51,7 @@ pd_m9: dd -9 pd_8: dd 8 pd_2147483648: dd 2147483648 -cextern_args sgr_x_by_x,data,hidden +cextern_hidden_data sgr_x_by_x SECTION .text diff --git a/src/x86/looprestoration16_sse.asm b/src/x86/looprestoration16_sse.asm index 4818b79d7..05aa9ab24 100644 --- a/src/x86/looprestoration16_sse.asm +++ b/src/x86/looprestoration16_sse.asm @@ -59,7 +59,7 @@ pd_0xfffffff0: times 4 dd 0xfffffff0 wiener_shifts: dw 4, 4, 2048, 2048, 1, 1, 8192, 8192 wiener_round: dd 1049600, 1048832 -cextern_args sgr_x_by_x,data,hidden +cextern_hidden_data sgr_x_by_x SECTION .text diff --git a/src/x86/looprestoration_avx512.asm b/src/x86/looprestoration_avx512.asm index e32c97aae..3a9294e7c 100644 --- a/src/x86/looprestoration_avx512.asm +++ b/src/x86/looprestoration_avx512.asm @@ -53,7 +53,7 @@ pd_m9: dd -9 pd_34816: dd 34816 pd_8421376: dd 8421376 -cextern_args sgr_x_by_x,data,hidden +cextern_hidden_data sgr_x_by_x SECTION .text diff --git a/src/x86/looprestoration_sse.asm b/src/x86/looprestoration_sse.asm index 5df45d859..9538979b2 100644 --- a/src/x86/looprestoration_sse.asm +++ b/src/x86/looprestoration_sse.asm @@ -51,7 +51,7 @@ pd_0xffff: times 4 dd 0xffff pd_0xf00800a4: times 4 dd 0xf00800a4 pd_0xf00801c7: times 4 dd 0xf00801c7 -cextern_args sgr_x_by_x,data,hidden +cextern_hidden_data sgr_x_by_x SECTION .text diff --git a/src/x86/mc16_avx2.asm b/src/x86/mc16_avx2.asm index bc313aaa9..9fae60152 100644 --- a/src/x86/mc16_avx2.asm +++ b/src/x86/mc16_avx2.asm @@ -194,11 +194,11 @@ SCALED_JMP_TABLE prep_8tap_scaled, avx2, 4, 8, 16, 32, 64, 128 %define table_offset(type, fn) type %+ fn %+ SUFFIX %+ _table - type %+ SUFFIX -cextern_args mc_subpel_filters,data,hidden +cextern_hidden_data mc_subpel_filters %define subpel_filters (mangle(private_prefix %+ _mc_subpel_filters)-8) -cextern_args mc_warp_filter,data,hidden -cextern_args resize_filter,data,hidden +cextern_hidden_data mc_warp_filter +cextern_hidden_data resize_filter SECTION .text diff --git a/src/x86/mc16_avx512.asm b/src/x86/mc16_avx512.asm index 617626d2c..a6ddbc231 100644 --- a/src/x86/mc16_avx512.asm +++ b/src/x86/mc16_avx512.asm @@ -251,12 +251,12 @@ HV_JMP_TABLE prep, 8tap, avx512icl, 2, 4, 8, 16, 32, 64, 128 %define table_offset(type, fn) type %+ fn %+ SUFFIX %+ _table - type %+ SUFFIX -cextern_args mc_subpel_filters,data,hidden +cextern_hidden_data mc_subpel_filters %define subpel_filters (mangle(private_prefix %+ _mc_subpel_filters)-8) -cextern_args mc_warp_filter,data,hidden -cextern_args obmc_masks_avx2,data,hidden -cextern_args resize_filter,data,hidden +cextern_hidden_data mc_warp_filter +cextern_hidden_data obmc_masks_avx2 +cextern_hidden_data resize_filter SECTION .text diff --git a/src/x86/mc16_sse.asm b/src/x86/mc16_sse.asm index f28e2cec3..6c066d28d 100644 --- a/src/x86/mc16_sse.asm +++ b/src/x86/mc16_sse.asm @@ -158,11 +158,11 @@ BASE_JMP_TABLE prep, ssse3, 4, 8, 16, 32, 64, 128 SCALED_JMP_TABLE put_8tap_scaled, ssse3, 2, 4, 8, 16, 32, 64, 128 SCALED_JMP_TABLE prep_8tap_scaled, ssse3, 4, 8, 16, 32, 64, 128 -cextern_args mc_subpel_filters,data,hidden +cextern_hidden_data mc_subpel_filters %define subpel_filters (mangle(private_prefix %+ _mc_subpel_filters)-8) -cextern_args mc_warp_filter,data,hidden -cextern_args resize_filter,data,hidden +cextern_hidden_data mc_warp_filter +cextern_hidden_data resize_filter SECTION .text diff --git a/src/x86/mc_avx2.asm b/src/x86/mc_avx2.asm index 1d5e214a5..98b435448 100644 --- a/src/x86/mc_avx2.asm +++ b/src/x86/mc_avx2.asm @@ -91,10 +91,10 @@ pd_0x3ff: dd 0x3ff pd_0x4000: dd 0x4000 pq_0x40000000: dq 0x40000000 -cextern_args mc_subpel_filters,data,hidden -cextern_args mc_warp_filter2,data,hidden -cextern_args resize_filter,data,hidden -cextern_args z_filter_s,data,hidden +cextern_hidden_data mc_subpel_filters +cextern_hidden_data mc_warp_filter2 +cextern_hidden_data resize_filter +cextern_hidden_data z_filter_s %define subpel_filters (mangle(private_prefix %+ _mc_subpel_filters)-8) diff --git a/src/x86/mc_avx512.asm b/src/x86/mc_avx512.asm index 87f1e2e1f..d8b86dafc 100644 --- a/src/x86/mc_avx512.asm +++ b/src/x86/mc_avx512.asm @@ -200,10 +200,10 @@ pd_512: dd 512 %define pb_64 (wm_sign+8) %define pd_2 (pd_0to7+8) -cextern_args mc_subpel_filters,data,hidden +cextern_hidden_data mc_subpel_filters %define subpel_filters (mangle(private_prefix %+ _mc_subpel_filters)-8) -cextern_args mc_warp_filter,data,hidden -cextern_args resize_filter,data,hidden +cextern_hidden_data mc_warp_filter +cextern_hidden_data resize_filter %macro BASE_JMP_TABLE 3-* %xdefine %1_%2_table (%%table - %3) diff --git a/src/x86/mc_sse.asm b/src/x86/mc_sse.asm index de77ff5ea..558145a99 100644 --- a/src/x86/mc_sse.asm +++ b/src/x86/mc_sse.asm @@ -202,7 +202,7 @@ const mc_warp_filter2 ; dav1d_mc_warp_filter[] reordered for pmaddubsw usage pw_258: times 2 dw 258 -cextern_args mc_subpel_filters,data,hidden +cextern_hidden_data mc_subpel_filters %define subpel_filters (mangle(private_prefix %+ _mc_subpel_filters)-8) %macro BIDIR_JMP_TABLE 2-* @@ -9357,7 +9357,7 @@ cglobal emu_edge_8bpc, 10, 13, 2, bw, bh, iw, ih, x, \ %undef reg_blkm %undef reg_tmp -cextern_args resize_filter,data,hidden +cextern_hidden_data resize_filter %macro SCRATCH 3 %if ARCH_X86_32