From: Rich Felker Date: Wed, 8 Mar 2017 18:35:33 +0000 (-0500) Subject: fix ld-behavior-dependent crash in ppc64 ldso startup X-Git-Tag: v1.1.17~102 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=fc85fb38605a8bf341c367b8ab0d36edab2bdbfc;p=oweals%2Fmusl.git fix ld-behavior-dependent crash in ppc64 ldso startup the 32-bit pc-relative address for stage 2 of dynamic linker entry was wrongly loaded with a zero-extending load instead of sign-extending load, resulting in an invalid jump if the offset happened to be negative, which depends on the linker's ordering of text sections. --- diff --git a/arch/powerpc64/reloc.h b/arch/powerpc64/reloc.h index e1bad009..faf70acd 100644 --- a/arch/powerpc64/reloc.h +++ b/arch/powerpc64/reloc.h @@ -27,6 +27,6 @@ " bl 1f \n" \ " .long " #sym "-. \n" \ "1: mflr %1 \n" \ - " lwz %0, 0(%1) \n" \ + " lwa %0, 0(%1) \n" \ " add %0, %0, %1 \n" \ : "=r"(*(fp)), "=r"((long){0}) : : "memory", "lr" )