Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAEg67G=yLdAa8Q66N6K-7z7UKL54ninhsL35T66rRm7G=B3ySg@mail.gmail.com>
Date: Wed, 28 Oct 2020 12:48:02 +1100
From: Patrick Oppenlander <patrick.oppenlander@...il.com>
To: musl@...ts.openwall.com
Cc: unicorn_wang <unicorn_wang@...look.com>
Subject: Re: [Question] about arch/riscv64/crt_arch.h

On Wed, Oct 28, 2020 at 12:40 PM Chen Wang <unicorn_wang@...look.com> wrote:
>
> hi,
> I'm reading musl (1.2.1) code for riscv. In arch/riscv64/crt_arch.h,
>
> __asm__(
> ......
> "andi sp, sp, -16\n\t" // <--- why do we need this?
> "tail " START "_c"
> );
>

I'm not familiar with RISC-V, but it's there to guarantee that the
stack is 16-byte aligned which must be either an architectural or ABI
requirement.

Perhaps the kernel can start the process with a more relaxed stack
alignment. Otherwise it's there for safety (paranoia).

Patrick

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.