From aa19637bf1d1384e93eb43a365d1a592d6e41c1f Mon Sep 17 00:00:00 2001 From: Matthew Waters Date: Wed, 29 Nov 2017 16:30:35 +1100 Subject: [PATCH] Add visibility="protected" attribute for global variables referenced in asm files. Based off upstream change https://chromium.googlesource.com/webm/libvpx/+/0d88e15454b632d92404dd6a7181c58d9985e2a2 --- vp8/common/postproc.c | 2 +- vp8/common/x86/filter_x86.c | 2 +- vp9/common/vp9_postproc.c | 2 +- vpx_ports/mem.h | 6 ++++++ 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/vp8/common/postproc.c b/vp8/common/postproc.c index 6baf00f1e..90462e94a 100644 --- a/vp8/common/postproc.c +++ b/vp8/common/postproc.c @@ -72,7 +72,7 @@ static const unsigned char MV_REFERENCE_FRAME_colors[MAX_REF_FRAMES][3] = }; #endif -const short vp8_rv[] = +DECLARE_PROTECTED(const short vp8_rv[]) = { 8, 5, 2, 2, 8, 12, 4, 9, 8, 3, 0, 3, 9, 0, 0, 0, 8, 3, 14, 4, diff --git a/vp8/common/x86/filter_x86.c b/vp8/common/x86/filter_x86.c index 7f496ed7d..b87cc0e29 100644 --- a/vp8/common/x86/filter_x86.c +++ b/vp8/common/x86/filter_x86.c @@ -22,7 +22,7 @@ DECLARE_ALIGNED(16, const short, vp8_bilinear_filters_x86_4[8][8]) = { 16, 16, 16, 16, 112, 112, 112, 112 } }; -DECLARE_ALIGNED(16, const short, vp8_bilinear_filters_x86_8[8][16]) = +DECLARE_PROTECTED(DECLARE_ALIGNED(16, const short, vp8_bilinear_filters_x86_8[8][16])) = { { 128, 128, 128, 128, 128, 128, 128, 128, 0, 0, 0, 0, 0, 0, 0, 0 }, { 112, 112, 112, 112, 112, 112, 112, 112, 16, 16, 16, 16, 16, 16, 16, 16 }, diff --git a/vp9/common/vp9_postproc.c b/vp9/common/vp9_postproc.c index c04cc8f05..7f3dbfe3d 100644 --- a/vp9/common/vp9_postproc.c +++ b/vp9/common/vp9_postproc.c @@ -32,7 +32,7 @@ static const int16_t kernel5[] = { 1, 1, 4, 1, 1 }; -const int16_t vp9_rv[] = { +DECLARE_PROTECTED(const int16_t vp9_rv[]) = { 8, 5, 2, 2, 8, 12, 4, 9, 8, 3, 0, 3, 9, 0, 0, 0, 8, 3, 14, 4, 10, 1, 11, 14, 1, 14, 9, 6, 12, 11, diff --git a/vpx_ports/mem.h b/vpx_ports/mem.h index 7502f9063..b4b28f5be 100644 --- a/vpx_ports/mem.h +++ b/vpx_ports/mem.h @@ -34,6 +34,12 @@ #define UNINITIALIZED_IS_SAFE(x) x #endif +#if defined(__GNUC__) && __GNUC__ >= 4 && !defined(_WIN32) +#define DECLARE_PROTECTED(decl) decl __attribute__((visibility("protected"))) +#else +#define DECLARE_PROTECTED(decl) decl +#endif + #if HAVE_NEON && defined(_MSC_VER) #define __builtin_prefetch(x) #endif -- 2.15.0