lkml.org 
[lkml]   [2019]   [Sep]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH 4/4] x86: fix function types in COND_SYSCALL
On Fri, Sep 13, 2019 at 5:28 PM Andy Lutomirski <luto@amacapital.net> wrote:
> Ah, I get it. Doesn’t this cause a little bit of code bloat, though?

A little bit yes, a few extra functions for syscalls that are not
otherwise implemented.

> What if you made __x86_ni_syscall, etc (possibly using the *DEFINE_SYSCALL0 macros) and then generate weak aliases to those?

That would be convenient, but COND_SYSCALL is used in kernel/sys_ni.c,
and we can't create an alias to a function defined elsewhere:

$ cat test.c
long b(void);
long a(void) __attribute__((alias("b")));
$ gcc -c test.c
test.c:2:6: error: ‘a’ aliased to undefined symbol ‘b’
long a(void) __attribute__((alias("b")));
^

Curiously, when we use inline assembly to create the alias (similarly
to the current cond_syscall), gcc just quietly drops the alias if the
function is not defined.

Sami

\
 
 \ /
  Last update: 2019-09-18 00:45    [W:0.063 / U:1.200 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site