From patchwork Wed Jun 27 01:26:24 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vineet Gupta X-Patchwork-Id: 935219 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=linux-snps-arc-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=synopsys.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="D9WbnQva"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=synopsys.com header.i=@synopsys.com header.b="d8fHaagT"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41Flcs4Cn4z9s1B for ; Wed, 27 Jun 2018 11:26:53 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=jSW74Lql1Epj9WxhzHvdMpHT2ozlsd++fD1EKWCA9is=; b=D9WbnQvaZ5JE2H v4CtmKl+VZb+a39I/U9wvoO4EnNIOC3GwLw1ZG6NyWTRBRFPqMlPLN6utlfmsV8s3x4cb3FfajiXS BJRFBrXPdsVBtO8uz5dYa1/AYoy5xHxVUiRvpgvez5bYexNDT18RspgjjehBYj0fmjcg/TijL4M0H VIKNXAETchqUfxTTaJ5qmS9MDowXI3s5M2ZSo29QS8FYjBMJzJDPSpjDTllIP6xd69YXMSgj55J6x 8v+v5Oc4yTxFWZqpIcUAZbov5Uxr7bCXo0mDkADE+qCQEi9pC9V1UOfprgqLiJju14K9pv07/2HRo v9JLiqE1qt4dodACMDAA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fXzER-00027G-HT; Wed, 27 Jun 2018 01:26:51 +0000 Received: from smtprelay4.synopsys.com ([198.182.47.9] helo=smtprelay.synopsys.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fXzEP-00026B-1X for linux-snps-arc@lists.infradead.org; Wed, 27 Jun 2018 01:26:50 +0000 Received: from mailhost.synopsys.com (mailhost1.synopsys.com [10.12.238.239]) by smtprelay.synopsys.com (Postfix) with ESMTP id 389D024E0940; Tue, 26 Jun 2018 18:26:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1530062797; bh=PUqVaJgNv45GJopEh5Ntz8JJxglApdu2jmMemt3aM5U=; h=From:To:CC:Subject:Date:From; b=d8fHaagTPCQC5/ad43pX2xEZvsHz4/cw3NXbnbGQg41z5b9TVfTW6DOxM9FBAWg+Z 1WtOAnGkUuZVTPnBE98EbyAneeKcuFp3GNNe0+TR+XG91CiFIwvCUvlN1JXJDn4PQa 2/1mGSd++wkMHHhElGxuFa3MUoABedYthit21zRVVaLEqF3JfdCStR/fzs12K2MQ9u mKGACgh5ngEoHLCjcRj5sMwNO5i0oXsfkafJTCdtK8IftLEYmrB9XT2ezxstMX2Gk+ yaQgQTIR0JJAByqOepzs49fLffRBYnP7bqfmboHEkHiflt6le7WZMa7JWNYRwM7xys OLLMam1oDCVsA== Received: from US01WEHTC2.internal.synopsys.com (us01wehtc2.internal.synopsys.com [10.12.239.237]) by mailhost.synopsys.com (Postfix) with ESMTP id 018BE5483; Tue, 26 Jun 2018 18:26:36 -0700 (PDT) Received: from IN01WEHTCB.internal.synopsys.com (10.144.199.106) by US01WEHTC2.internal.synopsys.com (10.12.239.237) with Microsoft SMTP Server (TLS) id 14.3.361.1; Tue, 26 Jun 2018 18:26:36 -0700 Received: from IN01WEHTCA.internal.synopsys.com (10.144.199.103) by IN01WEHTCB.internal.synopsys.com (10.144.199.105) with Microsoft SMTP Server (TLS) id 14.3.361.1; Wed, 27 Jun 2018 06:56:33 +0530 Received: from vineetg-Latitude-E7450.internal.synopsys.com (10.10.161.98) by IN01WEHTCA.internal.synopsys.com (10.144.199.243) with Microsoft SMTP Server (TLS) id 14.3.361.1; Wed, 27 Jun 2018 06:56:33 +0530 From: Vineet Gupta To: Subject: [PATCH v2] ldso/arc: fix LD_DEBUG segv when printing R_ARC_NONE Date: Tue, 26 Jun 2018 18:26:24 -0700 Message-ID: <1530062784-12353-1-git-send-email-vgupta@synopsys.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 X-Originating-IP: [10.10.161.98] X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180626_182649_101006_12567FC5 X-CRM114-Status: GOOD ( 10.06 ) X-Spam-Score: -0.1 (/) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-0.1 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [198.182.47.9 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-snps-arc@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Linux on Synopsys ARC Processors List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-snps-arc@lists.infradead.org, Vineet Gupta , Alexey.Brodkin@synopsys.com Sender: "linux-snps-arc" Errors-To: linux-snps-arc-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Signed-off-by: Vineet Gupta --- v2: Also remove a bogus trailing l in prints --- ldso/ldso/arc/elfinterp.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ldso/ldso/arc/elfinterp.c b/ldso/ldso/arc/elfinterp.c index 5a02bc2348da..a30c19bcb832 100644 --- a/ldso/ldso/arc/elfinterp.c +++ b/ldso/ldso/arc/elfinterp.c @@ -64,7 +64,7 @@ _dl_linux_resolver(struct elf_resolve *tpnt, unsigned int plt_pc) if (_dl_debug_bindings) { _dl_dprintf(_dl_debug_file, "\nresolve function: %s", symname); if (_dl_debug_detail) - _dl_dprintf(_dl_debug_file, "\n\tpatched %x ==> %pc @ %pl\n", + _dl_dprintf(_dl_debug_file, "\n\tpatched %x ==> %pc @ %p\n", *got_addr, new_addr, got_addr); } @@ -178,7 +178,7 @@ _dl_do_reloc(struct elf_resolve *tpnt, struct r_scope_elem *scope, log_entry: #if defined __SUPPORT_LD_DEBUG__ - if (_dl_debug_detail) + if (_dl_debug_detail && (reloc_type != R_ARC_NONE)) _dl_dprintf(_dl_debug_file,"\tpatched: %x ==> %x @ %x", old_val, *reloc_addr, reloc_addr); #endif @@ -214,7 +214,7 @@ _dl_do_lazy_reloc(struct elf_resolve *tpnt, struct r_scope_elem *scope, } #if defined __SUPPORT_LD_DEBUG__ - if (_dl_debug_reloc && _dl_debug_detail) + if (_dl_debug_reloc && _dl_debug_detail && (reloc_type != R_ARC_NONE)) _dl_dprintf(_dl_debug_file, "\tpatched: %x ==> %x @ %x\n", old_val, *reloc_addr, reloc_addr); #endif