Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Alexey Brodkin <Alexey.Brodkin@synopsys.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH] uclibc: ldso/arc: fix LD_DEBUG segv when printing R_ARC_NONE
Date: Tue,  7 Aug 2018 20:33:59 +0300	[thread overview]
Message-ID: <20180807173359.35041-1-abrodkin@synopsys.com> (raw)

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 <abrodkin@synopsys.com>
---
 ...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 <Vineet.Gupta1@synopsys.com>
+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 <vgupta@synopsys.com>
+Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
+---
+ 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
+
-- 
2.16.2

             reply	other threads:[~2018-08-07 17:33 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-07 17:33 Alexey Brodkin [this message]
2018-08-08 14:28 ` [Buildroot] [PATCH] uclibc: ldso/arc: fix LD_DEBUG segv when printing R_ARC_NONE Peter Korsgaard
2018-08-23 22:27 ` Peter Korsgaard

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180807173359.35041-1-abrodkin@synopsys.com \
    --to=alexey.brodkin@synopsys.com \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox