From patchwork Tue Aug 7 17:33:59 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexey Brodkin X-Patchwork-Id: 954606 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.137; helo=fraxinus.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=synopsys.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=synopsys.com header.i=@synopsys.com header.b="FRrynBCo"; dkim-atps=neutral Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41lM874MBzz9rvt for ; Wed, 8 Aug 2018 03:34:15 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id DD00E84887; Tue, 7 Aug 2018 17:34:13 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id J7KjN7DHOz1v; Tue, 7 Aug 2018 17:34:11 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 9C7A38064B; Tue, 7 Aug 2018 17:34:11 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 831F61C2648 for ; Tue, 7 Aug 2018 17:34:10 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 7EEB582F6E for ; Tue, 7 Aug 2018 17:34:10 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id eyv0ywUj9v6b for ; Tue, 7 Aug 2018 17:34:09 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from smtprelay.synopsys.com (smtprelay.synopsys.com [198.182.60.111]) by whitealder.osuosl.org (Postfix) with ESMTPS id B309082E4E for ; Tue, 7 Aug 2018 17:34:09 +0000 (UTC) Received: from mailhost.synopsys.com (mailhost2.synopsys.com [10.13.184.66]) by smtprelay.synopsys.com (Postfix) with ESMTP id 6E83410C0622 for ; Tue, 7 Aug 2018 10:34:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1533663249; bh=K7+3REE8aBC5JhyFAVUNwd4y2GtnVfiD3ZBPf1QhfMM=; h=From:To:Cc:Subject:Date:From; b=FRrynBCo3EpkgnJ4jJrN94as5/2XOczQYQw8X36F1do6nFXDM6DjPBo7SnCf3pwoC zd9UQ8acObG3okKBe1N1ePxn2qCv9VyAh2GnDQLcTkxlgi1pj9DzdGOtz1GzhVEh+7 dhe9cETqWE1gPxm28tL8y1TV67hcbrs+J0PXWNM7yy63CFQVvietaCgRKXocouFcBj C5tUNmONxVkyqEi4dZpJuzaFEof3Y6n3o6DnYR9r4PFFSV1N91Zhezyg/wHPq4AvPm /iA0EyQUsiiOvyGtdy9XMvKpG7BSC1A5Qiria1bQIhTpGHfxyudbrRUaqer0IvOYJa Et6swKb0EvD4A== Received: from ru20arcgnu1.internal.synopsys.com (ru20arcgnu1.internal.synopsys.com [10.121.9.48]) by mailhost.synopsys.com (Postfix) with ESMTP id A7ABA3D87; Tue, 7 Aug 2018 10:34:05 -0700 (PDT) From: Alexey Brodkin To: buildroot@busybox.net Date: Tue, 7 Aug 2018 20:33:59 +0300 Message-Id: <20180807173359.35041-1-abrodkin@synopsys.com> X-Mailer: git-send-email 2.16.2 Subject: [Buildroot] [PATCH] uclibc: ldso/arc: fix LD_DEBUG segv when printing R_ARC_NONE X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.24 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alexey Brodkin , ARC Buildroot mailing list MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Dynamic linker used to segfault on attempt to print info about R_ARC_NONE reloaction. The fix is already in upstream master [1], should be removed on uClibc version bump. [1] https://cgit.uclibc-ng.org/cgi/cgit/uclibc-ng.git/commit/?id=269a2a2a0f863e1b43dc02f2f4f0f3c50299456e Signed-off-by: Alexey Brodkin --- ...ix-LD_DEBUG-segv-when-printing-R_ARC_NONE.patch | 45 ++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 package/uclibc/0003-ldso-arc-fix-LD_DEBUG-segv-when-printing-R_ARC_NONE.patch diff --git a/package/uclibc/0003-ldso-arc-fix-LD_DEBUG-segv-when-printing-R_ARC_NONE.patch b/package/uclibc/0003-ldso-arc-fix-LD_DEBUG-segv-when-printing-R_ARC_NONE.patch new file mode 100644 index 0000000000..ad87698f53 --- /dev/null +++ b/package/uclibc/0003-ldso-arc-fix-LD_DEBUG-segv-when-printing-R_ARC_NONE.patch @@ -0,0 +1,45 @@ +From 269a2a2a0f863e1b43dc02f2f4f0f3c50299456e Mon Sep 17 00:00:00 2001 +From: Vineet Gupta +Date: Tue, 26 Jun 2018 18:26:24 -0700 +Subject: [PATCH] ldso/arc: fix LD_DEBUG segv when printing R_ARC_NONE + +Signed-off-by: Vineet Gupta +Signed-off-by: Alexey Brodkin +--- + 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 5a02bc234..a30c19bcb 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 +-- +2.16.2 +