Commit 062b88841d for ffmpeg
commit 062b88841d4ea505240d991e5153553c3a019335
Author: Iason Nikolas <jasonnikolas5480@gmail.com>
Date: Fri Nov 6 00:00:53 2026 +0200
avutil/tx: give the tables hidden visibility
tx_float_neon.S loads the ff_tx_tab_*_float tables with movrel, which on
ELF with PIC is a plain adrp + add against the symbol. The tables had
default visibility, so when a static libavutil is linked into a shared
library, such as an Android app, the linker rejects these references
unless the shared library is linked with -Bsymbolic:
ld.lld: error: relocation R_AARCH64_ADR_PREL_PG_HI21 cannot be used
against symbol 'ff_tx_tab_32_float'; recompile with -fPIC
The tables are only used inside libavutil, and a shared libavutil
already keeps ff_ symbols local through its version script, so shared
builds do not change.
Fixes #25787.
Signed-off-by: Iason Nikolas <jasonnikolas5480@gmail.com>
diff --git a/libavutil/tx_template.c b/libavutil/tx_template.c
index ecee572e40..03f3883113 100644
--- a/libavutil/tx_template.c
+++ b/libavutil/tx_template.c
@@ -24,9 +24,13 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include "attributes_internal.h"
#include "mem.h"
+/* Hidden, so that assembly can address the tables PC-relatively even when
+ * libavutil is linked statically into a shared library. */
#define TABLE_DEF(name, size) \
+ attribute_visibility_hidden \
DECLARE_ALIGNED(32, TXSample, TX_TAB(ff_tx_tab_ ##name))[size]
#define SR_POW2_TABLES \