diff options
author | Martin Storsjö <martin@martin.st> | 2022-07-11 12:02:23 +0300 |
---|---|---|
committer | Martin Storsjö <martin@martin.st> | 2022-09-02 23:13:29 +0300 |
commit | e4ac156b7c47725327dff78bb83f5eecbaee3add (patch) | |
tree | 4417a1abdaa7e087f33a751ec7e6d33d1257786f /libavcodec/vp9dsp.h | |
parent | 0dd8fe6f4b072077d2d87eb3a2933e145ac41df1 (diff) |
libavcodec: Set hidden visibility on global symbols accessed from AArch64 assembly
The AArch64 assembly accesses those symbols directly, without
indirection via e.g. the GOT on ELF. In order for this not to
require text relocations, those symbols need to be resolved fully
at link time, i.e. those symbols can't be interposable.
Normally, so far, this is achieved when linking shared libraries
in two ways; we have a version script (libavcodec/libavcodec.v) which
marks all symbols that don't start with av* as local. Additionally,
we try to add -Wl,-Bsymbolic to the linker options if supported,
making sure that such symbol references are resolved fully at link
time, instead of making them interposable.
When the libavcodec static library is linked into another shared
library, there's no guarantee that it uses similar options (even though
that would be favourable), which would end up requiring text relocations
in the AArch64 assembly.
Explicitly mark the symbols that are accessed from AArch64 assembly
as hidden, so that they are resolved fully at link time even without
the version script and -Wl,-Bsymbolic.
Signed-off-by: Martin Storsjö <martin@martin.st>
Diffstat (limited to 'libavcodec/vp9dsp.h')
-rw-r--r-- | libavcodec/vp9dsp.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libavcodec/vp9dsp.h b/libavcodec/vp9dsp.h index 700dd72de8..be0ac0b181 100644 --- a/libavcodec/vp9dsp.h +++ b/libavcodec/vp9dsp.h @@ -28,6 +28,7 @@ #include <stdint.h> #include "libavcodec/vp9.h" +#include "libavutil/attributes_internal.h" typedef void (*vp9_mc_func)(uint8_t *dst, ptrdiff_t dst_stride, const uint8_t *ref, ptrdiff_t ref_stride, @@ -120,7 +121,7 @@ typedef struct VP9DSPContext { vp9_scaled_mc_func smc[5][N_FILTERS][2]; } VP9DSPContext; -extern const int16_t ff_vp9_subpel_filters[3][16][8]; +extern const int16_t attribute_visibility_hidden ff_vp9_subpel_filters[3][16][8]; void ff_vp9dsp_init(VP9DSPContext *dsp, int bpp, int bitexact); |