diff mbox series

[1/2] DTPMOD mod fix for musl's rcrt0

Message ID 20171214105706.4577-1-aep@exys.org
State Changes Requested
Headers show
Series [1/2] DTPMOD mod fix for musl's rcrt0 | expand

Commit Message

Arvid E. Picciani Dec. 14, 2017, 10:57 a.m. UTC
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

Comments

Thomas Petazzoni Dec. 14, 2017, 2:19 p.m. UTC | #1
Hello,

Thanks for your contribution!

On Thu, 14 Dec 2017 11:57:05 +0100, Arvid E. Picciani wrote:
> 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

All patches need a description and a Signed-off-by. Also is this patch
in upstream musl? Has it been submitted?

Thanks!

Thomas
diff mbox series

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
+