Skip to content

Commit 2e83c36

Browse files
committed
Mark syscall dispatcher as weak symbol
Allows architecture-specific syscall implementations to override the generic dispatcher at link time for privilege separation.
1 parent 3d94a32 commit 2e83c36

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

kernel/syscall.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ static const void *syscall_table[SYS_COUNT] = {SYSCALL_TABLE};
1717
#undef _
1818

1919
/* Weak, generic dispatcher */
20-
int syscall(int num, void *a1, void *a2, void *a3)
20+
__attribute__((weak)) int syscall(int num, void *a1, void *a2, void *a3)
2121
{
2222
if (unlikely(num <= 0 || num >= SYS_COUNT))
2323
return -ENOSYS;

0 commit comments

Comments
 (0)