Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Arvid E. Picciani <aep@exys.org>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 1/2] DTPMOD mod fix for musl's rcrt0
Date: Thu, 14 Dec 2017 11:57:05 +0100	[thread overview]
Message-ID: <20171214105706.4577-1-aep@exys.org> (raw)

See https://github.com/rust-lang/rust/issues/46566

Signed-off-by: Arvid E. Picciani <aep@exys.org>
---
 package/musl/0002-fix-rcrt1.o.patch | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)
 create mode 100644 package/musl/0002-fix-rcrt1.o.patch

diff --git a/package/musl/0002-fix-rcrt1.o.patch b/package/musl/0002-fix-rcrt1.o.patch
new file mode 100644
index 0000000000..3dae65569f
--- /dev/null
+++ b/package/musl/0002-fix-rcrt1.o.patch
@@ -0,0 +1,26 @@
+diff --git a/ldso/dlstart.c b/ldso/dlstart.c
+index 4dbe178..0dd1d5a 100644
+--- a/ldso/dlstart.c
++++ b/ldso/dlstart.c
+@@ -128,16 +128,18 @@ void _dlstart_c(size_t *sp, size_t *dynv)
+ 	rel = (void *)(base+dyn[DT_REL]);
+ 	rel_size = dyn[DT_RELSZ];
+ 	for (; rel_size; rel+=2, rel_size-=2*sizeof(size_t)) {
+-		if (!IS_RELATIVE(rel[1], 0)) continue;
+ 		size_t *rel_addr = (void *)(base + rel[0]);
++		if (rel[1] == REL_DTPMOD) *rel_addr = 1;
++		if (!IS_RELATIVE(rel[1], 0)) continue;
+ 		*rel_addr += base;
+ 	}
+ 
+ 	rel = (void *)(base+dyn[DT_RELA]);
+ 	rel_size = dyn[DT_RELASZ];
+ 	for (; rel_size; rel+=3, rel_size-=3*sizeof(size_t)) {
+-		if (!IS_RELATIVE(rel[1], 0)) continue;
+ 		size_t *rel_addr = (void *)(base + rel[0]);
++		if (rel[1] == REL_DTPMOD) *rel_addr = 1;
++		if (!IS_RELATIVE(rel[1], 0)) continue;
+ 		*rel_addr = base + rel[2];
+ 	}
+ #endif
+
-- 
2.15.1

             reply	other threads:[~2017-12-14 10:57 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-14 10:57 Arvid E. Picciani [this message]
2017-12-14 10:57 ` [Buildroot] [PATCH 2/2] enable static linking for libfuse Arvid E. Picciani
2017-12-14 15:21   ` Thomas Petazzoni
2017-12-14 15:27     ` Arvid Picciani
2017-12-14 15:52       ` Thomas Petazzoni
2017-12-15 13:12         ` Stefan Fröberg
2017-12-15 13:22           ` Stefan Fröberg
2017-12-15 14:10           ` Thomas Petazzoni
2017-12-15 13:07       ` Stefan Fröberg
     [not found]         ` <CABukmmN5UjdWupf_8zuCkx13tuNVFxeD9AOE=cemfQ_Soe1AUQ@mail.gmail.com>
2017-12-18  6:25           ` Thomas Petazzoni
2017-12-14 14:19 ` [Buildroot] [PATCH 1/2] DTPMOD mod fix for musl's rcrt0 Thomas Petazzoni

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=20171214105706.4577-1-aep@exys.org \
    --to=aep@exys.org \
    --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