• Ulrich Weigand's avatar
    powerpc: Fix unsafe accesses to parameter area in ELFv2 · 752a6422
    Ulrich Weigand authored
    Some of the assembler files in lib/ make use of the fact that in the
    ELFv1 ABI, the caller guarantees to provide stack space to save the
    parameter registers r3 ... r10.  This guarantee is no longer present
    in ELFv2 for functions that have no variable argument list and no
    more than 8 arguments.
    
    Change the affected routines to temporarily store registers in the
    red zone and/or the top of their own stack frame (in the space
    provided to save r31 .. r29, which is actually not used in these
    routines).
    
    In opal_query_takeover, simply always allocate a stack frame;
    the routine is not performance critical.
    Signed-off-by: default avatarUlrich Weigand <ulrich.weigand@de.ibm.com>
    Signed-off-by: default avatarAnton Blanchard <anton@samba.org>
    752a6422
opal-takeover.S 2.64 KB