From patchwork Fri Dec 28 23:12:53 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manoj Gupta X-Patchwork-Id: 11579 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id 2FF0244C742 for ; Sat, 29 Dec 2018 01:20:52 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id DA95668A7AF; Sat, 29 Dec 2018 01:20:48 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wr1-f68.google.com (mail-wr1-f68.google.com [209.85.221.68]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id C2EBC68A774 for ; Sat, 29 Dec 2018 01:20:42 +0200 (EET) Received: by mail-wr1-f68.google.com with SMTP id l9so22092258wrt.13 for ; Fri, 28 Dec 2018 15:20:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:from:date:message-id:subject:to:cc; bh=K+kMTPXTfnmDsM4GjXxgw3lR/gavHa+PlOxr0SoS2fc=; b=XE+ASFUfo4pZOQBaeNOEtr4F+wtMUT0zS2FkmYqYCrtFaFbMArWHw5ueqdnTyMNCsW 4dRjrDAnGdu605xOEfqHU1Pzlw/7t/nVBMHIFB5BH8DBuhk17s18uCCav0djBI58FSdP fafAbgKjmuEXrbWK1l+cWhKYKEUewM+90sPdM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to:cc; bh=K+kMTPXTfnmDsM4GjXxgw3lR/gavHa+PlOxr0SoS2fc=; b=GsVsX5DGB8SCLZiPI0mKgJgzZV+DyRDg8ENFIH+WOguxLaTHsERqqmUmw2Di9l+oFI GoTUz3vnRzPoVttvmuIEJHfmqaO0/9jhhdiq5ld3pBeUO1ZlCP9OP4+CnBfxOIT7CkED EW4ta2x2DWejzvQOJnh5csu5NQdzuVi6ON/eidpto+iHSwU5zGcUG8Hc+GYMrg3UrXpo hGCJszUFkZc6kBkRgT1TGW+ebec/hm2A0BnzaoT2jKWlshpjxZJzmyfMrGwGcqW1ad3B s0dlWmcVzgrlOGegCaCcHLtcqfS51vprVyXM6MXb9b4r1qWzymfophyqQ5yQZQ/x7gXh uU1w== X-Gm-Message-State: AJcUukecprTMInDNizEWtN33PAFANsOK3xDwLwi92HmWs16MsbUxtGX7 Ycc2yt89r29vGmvtqGLsa5Ivh29mTYQKMiaJAPWqP32S+QI= X-Google-Smtp-Source: ALg8bN5uSvjkXNyQE0ENT6PvaJ6ED2qHfURQ8gFqjOzOIyWJs8byZROps+IS2PL7pk0no8/Vzy80y1LSu3YboKvULLE= X-Received: by 2002:adf:9dd2:: with SMTP id q18mr26534532wre.12.1546038783566; Fri, 28 Dec 2018 15:13:03 -0800 (PST) MIME-Version: 1.0 From: Manoj Gupta Date: Fri, 28 Dec 2018 15:12:53 -0800 Message-ID: To: ffmpeg-devel@ffmpeg.org Subject: [FFmpeg-devel] [PATCH] libavcodec: Remove dynamic relocs from aarch64/h264idct_neon.S X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 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 Cc: Dale Curtis , Frank Liberato Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Hi All, I recently had a problem building ffmpeg for AArch64 where lld linker complained about text relocations in readonly segment. The following patch fixes the linker complains by referring to a local label instead of function name. This is similar in nature as the following previous commits: https://www.mail-archive.com/ffmpeg-cvslog@ffmpeg.org/msg34290.html https://www.mail-archive.com/ffmpeg-cvslog@ffmpeg.org/msg34419.html Thanks, Manoj Patch: libavcodec: Remove dynamic relocs from aarch64/h264idct_neon.S Some of the assembly functions e.g. ff_h264_idct_dc_add_neon has code like: movrel x14, X(ff_h264_idct_add_neon) Linker cannot resolve them fully at link time and emits dynamic relocations. Use explicit labels instead so that no dynamic relocations are needed at all. This avoids lld complains about text relocations. For background, see https://crbug.com/917919 Signed-off-by: Manoj Gupta --- libavcodec/aarch64/h264idct_neon.S | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) -- diff --git a/libavcodec/aarch64/h264idct_neon.S b/libavcodec/aarch64/h264idct_neon.S index 825ec49f8c..7de44205d3 100644 --- a/libavcodec/aarch64/h264idct_neon.S +++ b/libavcodec/aarch64/h264idct_neon.S @@ -23,6 +23,7 @@ #include "neon.S" function ff_h264_idct_add_neon, export=1 +.L_ff_h264_idct_add_neon: ld1 {v0.4H, v1.4H, v2.4H, v3.4H}, [x1] sxtw x2, w2 movi v30.8H, #0 @@ -77,6 +78,7 @@ function ff_h264_idct_add_neon, export=1 endfunc function ff_h264_idct_dc_add_neon, export=1 +.L_ff_h264_idct_dc_add_neon: sxtw x2, w2 mov w3, #0 ld1r {v2.8H}, [x1] @@ -106,8 +108,8 @@ function ff_h264_idct_add16_neon, export=1 mov w9, w3 // stride movrel x7, scan8 mov x10, #16 - movrel x13, X(ff_h264_idct_dc_add_neon) - movrel x14, X(ff_h264_idct_add_neon) + movrel x13, .L_ff_h264_idct_dc_add_neon + movrel x14, .L_ff_h264_idct_add_neon 1: mov w2, w9 ldrb w3, [x7], #1 ldrsw x0, [x5], #4 @@ -133,8 +135,8 @@ function ff_h264_idct_add16intra_neon, export=1 mov w9, w3 // stride movrel x7, scan8 mov x10, #16 - movrel x13, X(ff_h264_idct_dc_add_neon) - movrel x14, X(ff_h264_idct_add_neon) + movrel x13, .L_ff_h264_idct_dc_add_neon + movrel x14, .L_ff_h264_idct_add_neon 1: mov w2, w9 ldrb w3, [x7], #1 ldrsw x0, [x5], #4 @@ -160,8 +162,8 @@ function ff_h264_idct_add8_neon, export=1 add x5, x1, #16*4 // block_offset add x9, x2, #16*32 // block mov w19, w3 // stride - movrel x13, X(ff_h264_idct_dc_add_neon) - movrel x14, X(ff_h264_idct_add_neon) + movrel x13, .L_ff_h264_idct_dc_add_neon + movrel x14, .L_ff_h264_idct_add_neon movrel x7, scan8, 16 mov x10, #0 mov x11, #16 @@ -263,6 +265,7 @@ endfunc .endm function ff_h264_idct8_add_neon, export=1 +.L_ff_h264_idct8_add_neon: movi v19.8H, #0 sxtw x2, w2 ld1 {v24.8H, v25.8H}, [x1] @@ -326,6 +329,7 @@ function ff_h264_idct8_add_neon, export=1 endfunc function ff_h264_idct8_dc_add_neon, export=1 +.L_ff_h264_idct8_dc_add_neon: mov w3, #0 sxtw x2, w2 ld1r {v31.8H}, [x1] @@ -375,8 +379,8 @@ function ff_h264_idct8_add4_neon, export=1 mov w2, w3 movrel x7, scan8 mov w10, #16 - movrel x13, X(ff_h264_idct8_dc_add_neon) - movrel x14, X(ff_h264_idct8_add_neon) + movrel x13, .L_ff_h264_idct8_dc_add_neon + movrel x14, .L_ff_h264_idct8_add_neon 1: ldrb w9, [x7], #4 ldrsw x0, [x5], #16 ldrb w9, [x4, w9, UXTW]