From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 8C3D7432A9 for ; Wed, 27 Jul 2022 12:01:22 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 2C35168B901; Wed, 27 Jul 2022 15:01:19 +0300 (EEST) Received: from wout1-smtp.messagingengine.com (wout1-smtp.messagingengine.com [64.147.123.24]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 0858E68B840 for ; Wed, 27 Jul 2022 15:01:13 +0300 (EEST) Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id 4FF3C320047A for ; Wed, 27 Jul 2022 08:01:08 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Wed, 27 Jul 2022 08:01:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gllm.fr; h=cc :content-transfer-encoding:date:date:from:from:in-reply-to :message-id:mime-version:reply-to:sender:subject:subject:to:to; s=fm2; t=1658923267; x=1659009667; bh=+T8Jw3lSjL9WW9tYXTBhrzR8G Uzrq0JBk5Q73v8t4eo=; b=fiKERXukHE+R/kFlcX0LYY8dJOb1Y+SI2o3EdPPxg +PYBHsMyXvgJKIqqsbYGb1LS88n2XbA9AW4b4+defoM2qkJPt50qD0zQ62SzaOct kgmkU7GIR1z3/hn+W/+6yClx7dlIvcR1MDGYX8BmylL9EUaNfcx8D/vbjhbeGSk4 BSKctb05SWmnUr1zxshoQseELEtQ5n6n4YBegZkugIHseLGx25OcuQSQHHtvG47a UpIfda4NMzdGKOyZhMQoMF30SRVnmWASIyMVkwcze2xeOWaM6F05rgjx0zyDIpXt kwEuM70pGFPsy6A66SnqLnDZeoPvZbmfNXMwZnpL3rr2g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:date :feedback-id:feedback-id:from:from:in-reply-to:message-id :mime-version:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t= 1658923267; x=1659009667; bh=+T8Jw3lSjL9WW9tYXTBhrzR8GUzrq0JBk5Q 73v8t4eo=; b=VEZXdBjGS7Lvaq5t3ipJZnaCqjZDmQYAKOJOamIVHPvLgVPfJse HcTIQN5ohoS2bHIMUsbpu0YI00j0Y1nSMjhlqW0Y2TpxXsHyFfBJiyW3FbO7jJka 4QkAnamfzVGsd710iJ2SULMPMoZ32TG4yGxVp+oZsdhX8sHAvqN34YWaDxDH4J7g 2SSYBFjkc/w+7BJEQ6aY5TXIQb3kaK8Xw7Cb/AwZEm33ISxlKrgdTXZmUWcrwJcw 9zbaITVATX2wtrtsUcNnykvGFxK+kQqgWfOWWfw670aNhyjz1s41jVFB4McQzp/H RKFyR2DO3tTHODoSJnLMw8twzcJvOWVXsJw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrvdduvddggeejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgggfestdekredtre dttdenucfhrhhomhepvfhhohhmrghsucfiuhhilhhlvghmuceothhhohhmrghssehglhhl mhdrfhhrqeenucggtffrrghtthgvrhhnpefgtdelgfevtddtledufeetgfefjeehgefhvd evffevgfdtvedtkeejieekvefgjeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgr mhepmhgrihhlfhhrohhmpehthhhomhgrshesghhllhhmrdhfrh X-ME-Proxy: Feedback-ID: i239440f1:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Wed, 27 Jul 2022 08:01:06 -0400 (EDT) From: Thomas Guillem To: ffmpeg-devel@ffmpeg.org Date: Wed, 27 Jul 2022 14:00:00 +0200 Message-Id: <20220727120000.3596575-1-thomas@gllm.fr> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 2/2] libavcodec: Set hidden visibility on global symbols accessed from x86_64 assembly X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: DECLARE_ALIGNED, DECLARE_ASM_ALIGNED, and DECLARE_ASM_CONST will include attribute_visibility_hidden. ld: error: relocation R_X86_64_PC32 cannot be used against symbol 'ff_h264_cabac_tables'; recompile with -fPIC >>> defined in /home/tom/work/git/vlc-android/vlc/contrib/x86_64-linux-android/lib/libavcodec.a(cabac.o) >>> referenced by cabac.h:187 (libavcodec/x86/cabac.h:187) >>> h264_cabac.o:(ff_h264_decode_mb_cabac) in archive /home/tom/work/git/vlc-android/vlc/contrib/x86_64-linux-android/lib/libavcodec.a --- libavcodec/ac3dsp.h | 3 +- libavcodec/cabac.h | 3 +- libavcodec/h263dsp.h | 3 +- libavcodec/x86/constants.h | 81 +++++++++++++++++++------------------- libavutil/mem.h | 6 +-- libswscale/x86/rgb2rgb.c | 2 +- 6 files changed, 51 insertions(+), 47 deletions(-) diff --git a/libavcodec/ac3dsp.h b/libavcodec/ac3dsp.h index a23b11526e..f8c03a7c23 100644 --- a/libavcodec/ac3dsp.h +++ b/libavcodec/ac3dsp.h @@ -23,12 +23,13 @@ #define AVCODEC_AC3DSP_H #include +#include "libavutil/internal.h" /** * Number of mantissa bits written for each bap value. * bap values with fractional bits are set to 0 and are calculated separately. */ -extern const uint16_t ff_ac3_bap_bits[16]; +extern const uint16_t attribute_visibility_hidden ff_ac3_bap_bits[16]; typedef struct AC3DSPContext { /** diff --git a/libavcodec/cabac.h b/libavcodec/cabac.h index 38d06b2842..356aa368d0 100644 --- a/libavcodec/cabac.h +++ b/libavcodec/cabac.h @@ -28,8 +28,9 @@ #define AVCODEC_CABAC_H #include +#include "libavutil/internal.h" -extern const uint8_t ff_h264_cabac_tables[512 + 4*2*64 + 4*64 + 63]; +extern const uint8_t attribute_visibility_hidden ff_h264_cabac_tables[512 + 4*2*64 + 4*64 + 63]; #define H264_NORM_SHIFT_OFFSET 0 #define H264_LPS_RANGE_OFFSET 512 #define H264_MLPS_STATE_OFFSET 1024 diff --git a/libavcodec/h263dsp.h b/libavcodec/h263dsp.h index 1abea3ca8c..514a148fb1 100644 --- a/libavcodec/h263dsp.h +++ b/libavcodec/h263dsp.h @@ -20,8 +20,9 @@ #define AVCODEC_H263DSP_H #include +#include "libavutil/internal.h" -extern const uint8_t ff_h263_loop_filter_strength[32]; +extern const uint8_t attribute_visibility_hidden ff_h263_loop_filter_strength[32]; typedef struct H263DSPContext { void (*h263_h_loop_filter)(uint8_t *src, int stride, int qscale); diff --git a/libavcodec/x86/constants.h b/libavcodec/x86/constants.h index 85da38b7b9..c84b0d4324 100644 --- a/libavcodec/x86/constants.h +++ b/libavcodec/x86/constants.h @@ -22,51 +22,52 @@ #define AVCODEC_X86_CONSTANTS_H #include +#include "libavutil/internal.h" #include "libavutil/x86/asm.h" -extern const ymm_reg ff_pw_1; -extern const ymm_reg ff_pw_2; -extern const xmm_reg ff_pw_3; -extern const ymm_reg ff_pw_4; -extern const xmm_reg ff_pw_5; -extern const xmm_reg ff_pw_8; -extern const xmm_reg ff_pw_9; -extern const uint64_t ff_pw_15; -extern const xmm_reg ff_pw_16; -extern const xmm_reg ff_pw_18; -extern const xmm_reg ff_pw_20; -extern const xmm_reg ff_pw_32; -extern const uint64_t ff_pw_42; -extern const uint64_t ff_pw_53; -extern const xmm_reg ff_pw_64; -extern const uint64_t ff_pw_96; -extern const uint64_t ff_pw_128; -extern const ymm_reg ff_pw_255; -extern const ymm_reg ff_pw_256; -extern const ymm_reg ff_pw_512; -extern const ymm_reg ff_pw_1023; -extern const ymm_reg ff_pw_1024; -extern const ymm_reg ff_pw_2048; -extern const ymm_reg ff_pw_4095; -extern const ymm_reg ff_pw_4096; -extern const ymm_reg ff_pw_8192; -extern const ymm_reg ff_pw_m1; +extern const ymm_reg attribute_visibility_hidden ff_pw_1; +extern const ymm_reg attribute_visibility_hidden ff_pw_2; +extern const xmm_reg attribute_visibility_hidden ff_pw_3; +extern const ymm_reg attribute_visibility_hidden ff_pw_4; +extern const xmm_reg attribute_visibility_hidden ff_pw_5; +extern const xmm_reg attribute_visibility_hidden ff_pw_8; +extern const xmm_reg attribute_visibility_hidden ff_pw_9; +extern const uint64_t attribute_visibility_hidden ff_pw_15; +extern const xmm_reg attribute_visibility_hidden ff_pw_16; +extern const xmm_reg attribute_visibility_hidden ff_pw_18; +extern const xmm_reg attribute_visibility_hidden ff_pw_20; +extern const xmm_reg attribute_visibility_hidden ff_pw_32; +extern const uint64_t attribute_visibility_hidden ff_pw_42; +extern const uint64_t attribute_visibility_hidden ff_pw_53; +extern const xmm_reg attribute_visibility_hidden ff_pw_64; +extern const uint64_t attribute_visibility_hidden ff_pw_96; +extern const uint64_t attribute_visibility_hidden ff_pw_128; +extern const ymm_reg attribute_visibility_hidden ff_pw_255; +extern const ymm_reg attribute_visibility_hidden ff_pw_256; +extern const ymm_reg attribute_visibility_hidden ff_pw_512; +extern const ymm_reg attribute_visibility_hidden ff_pw_1023; +extern const ymm_reg attribute_visibility_hidden ff_pw_1024; +extern const ymm_reg attribute_visibility_hidden ff_pw_2048; +extern const ymm_reg attribute_visibility_hidden ff_pw_4095; +extern const ymm_reg attribute_visibility_hidden ff_pw_4096; +extern const ymm_reg attribute_visibility_hidden ff_pw_8192; +extern const ymm_reg attribute_visibility_hidden ff_pw_m1; -extern const ymm_reg ff_pb_0; -extern const ymm_reg ff_pb_1; -extern const ymm_reg ff_pb_2; -extern const ymm_reg ff_pb_3; -extern const ymm_reg ff_pb_80; -extern const ymm_reg ff_pb_FE; -extern const uint64_t ff_pb_FC; +extern const ymm_reg attribute_visibility_hidden ff_pb_0; +extern const ymm_reg attribute_visibility_hidden ff_pb_1; +extern const ymm_reg attribute_visibility_hidden ff_pb_2; +extern const ymm_reg attribute_visibility_hidden ff_pb_3; +extern const ymm_reg attribute_visibility_hidden ff_pb_80; +extern const ymm_reg attribute_visibility_hidden ff_pb_FE; +extern const uint64_t attribute_visibility_hidden ff_pb_FC; -extern const xmm_reg ff_ps_neg; +extern const xmm_reg attribute_visibility_hidden ff_ps_neg; -extern const ymm_reg ff_pd_1; -extern const ymm_reg ff_pd_16; -extern const ymm_reg ff_pd_32; -extern const ymm_reg ff_pd_8192; -extern const ymm_reg ff_pd_65535; +extern const ymm_reg attribute_visibility_hidden ff_pd_1; +extern const ymm_reg attribute_visibility_hidden ff_pd_16; +extern const ymm_reg attribute_visibility_hidden ff_pd_32; +extern const ymm_reg attribute_visibility_hidden ff_pd_8192; +extern const ymm_reg attribute_visibility_hidden ff_pd_65535; #endif /* AVCODEC_X86_CONSTANTS_H */ diff --git a/libavutil/mem.h b/libavutil/mem.h index d91174196c..88fea4bfe7 100644 --- a/libavutil/mem.h +++ b/libavutil/mem.h @@ -113,9 +113,9 @@ #define DECLARE_ASM_ALIGNED(n,t,v) t av_used __attribute__ ((aligned (FFMIN(n, 16)))) v #define DECLARE_ASM_CONST(n,t,v) static const t av_used __attribute__ ((aligned (FFMIN(n, 16)))) v #elif defined(__GNUC__) || defined(__clang__) - #define DECLARE_ALIGNED(n,t,v) t __attribute__ ((aligned (n))) v - #define DECLARE_ASM_ALIGNED(n,t,v) t av_used __attribute__ ((aligned (n))) v - #define DECLARE_ASM_CONST(n,t,v) static const t av_used __attribute__ ((aligned (n))) v + #define DECLARE_ALIGNED(n,t,v) attribute_visibility_hidden t __attribute__ ((aligned (n))) v + #define DECLARE_ASM_ALIGNED(n,t,v) attribute_visibility_hidden t av_used __attribute__ ((aligned (n))) v + #define DECLARE_ASM_CONST(n,t,v) attribute_visibility_hidden static const t av_used __attribute__ ((aligned (n))) v #elif defined(_MSC_VER) #define DECLARE_ALIGNED(n,t,v) __declspec(align(n)) t v #define DECLARE_ASM_ALIGNED(n,t,v) __declspec(align(n)) t v diff --git a/libswscale/x86/rgb2rgb.c b/libswscale/x86/rgb2rgb.c index b325e5dbd5..100f608d04 100644 --- a/libswscale/x86/rgb2rgb.c +++ b/libswscale/x86/rgb2rgb.c @@ -70,7 +70,7 @@ DECLARE_ASM_CONST(8, uint64_t, mul15_hi) = 0x0210021002100210ULL; DECLARE_ASM_CONST(8, uint64_t, mul16_mid) = 0x2080208020802080ULL; DECLARE_ALIGNED(8, extern const uint64_t, ff_bgr2YOffset); -DECLARE_ALIGNED(8, extern const uint64_t, ff_w1111); +attribute_visibility_hidden DECLARE_ALIGNED(8, extern const uint64_t, ff_w1111); DECLARE_ALIGNED(8, extern const uint64_t, ff_bgr2UVOffset); #define BY ((int)( 0.098*(1<