From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/12171 Path: news.gmane.org!.POSTED!not-for-mail From: Szabolcs Nagy Newsgroups: gmane.linux.lib.musl.general Subject: Re: [PATCH] Wasm support patch 2 (static syscalls) Date: Tue, 28 Nov 2017 18:52:22 +0100 Message-ID: <20171128175221.GP15263@port70.net> References: <20171128125948.GK15263@port70.net> <20171128140531.GM15263@port70.net> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: blaine.gmane.org 1511891555 26099 195.159.176.226 (28 Nov 2017 17:52:35 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 28 Nov 2017 17:52:35 +0000 (UTC) User-Agent: Mutt/1.6.0 (2016-04-01) To: musl@lists.openwall.com Original-X-From: musl-return-12187-gllmg-musl=m.gmane.org@lists.openwall.com Tue Nov 28 18:52:31 2017 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by blaine.gmane.org with smtp (Exim 4.84_2) (envelope-from ) id 1eJk3a-0006Qv-60 for gllmg-musl@m.gmane.org; Tue, 28 Nov 2017 18:52:30 +0100 Original-Received: (qmail 26085 invoked by uid 550); 28 Nov 2017 17:52:34 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Original-Received: (qmail 26058 invoked from network); 28 Nov 2017 17:52:34 -0000 Mail-Followup-To: musl@lists.openwall.com Content-Disposition: inline In-Reply-To: Xref: news.gmane.org gmane.linux.lib.musl.general:12171 Archived-At: * John Starks [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.