On Mon, Aug 23, 2021 at 07:05:38PM +0200, Christophe Leroy wrote:
> Le 23/08/2021 à 17:58, Segher Boessenkool a écrit :
> >On Mon, Aug 23, 2021 at 07:53:01AM +, Christophe Leroy wrote:
> >> /* Be careful, this will clobber the lr register. */
> >> #define LOAD_REG_ADDR_PIC(reg, name)
Le 23/08/2021 à 17:58, Segher Boessenkool a écrit :
On Mon, Aug 23, 2021 at 07:53:01AM +, Christophe Leroy wrote:
/* Be careful, this will clobber the lr register. */
#define LOAD_REG_ADDR_PIC(reg, name) \
- bl 0f; \
+ bcl 20,3
On Mon, Aug 23, 2021 at 07:53:01AM +, Christophe Leroy wrote:
> /* Be careful, this will clobber the lr register. */
> #define LOAD_REG_ADDR_PIC(reg, name) \
> - bl 0f; \
> + bcl 20,31,0f\
> 0: mflrreg;
Use bcl 20,31,+4 instead of bl in order to preserve link stack.
See commit c974809a26a1 ("powerpc/vdso: Avoid link stack corruption
in __get_datapage()") for details.
Signed-off-by: Christophe Leroy
---
arch/powerpc/include/asm/ppc_asm.h| 2 +-
arch/powerpc/kernel/exceptions-64e.S