Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20171128185521.GC1627@brightrain.aerifal.cx>
Date: Tue, 28 Nov 2017 13:55:21 -0500
From: Rich Felker <dalias@...c.org>
To: musl@...ts.openwall.com
Subject: Re: [PATCH] Wasm support patch 2 (static syscalls)

On Tue, Nov 28, 2017 at 06:52:22PM +0100, Szabolcs Nagy wrote:
> * John Starks <John.Starks@...rosoft.com> [2017-11-28 16:51:19 +0000]:
> > What if you redefine the syscall numbers in wasm to be function
> > pointers to the actual syscalls, e.g. #define SYS_unlink
> > ((long)&__syscall_unlink). Then __syscall and friends can just
> > apply the arguments to the function pointer. This should play nice
> > with the linker and probably optimizes well.
> 
> you have to be able to cast it to the right type of
> function pointer then and pass the right amount of
> arguments.

To make this formally correct, I think all the __syscall_x functions
should just take 6 (or 7?) arguments and always be called with a dummy
arg of 0 in the additional slots. This can be done in the wasm
syscall_arch.h with no changes to musl code.

Rich

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.