Currently syscallTable is filled out statically in syscall_table.c.
This has to be done in C to make it read-only because of a limitation
in g++.
An alternative would be to fill out the table at run time.
From http://codereview.chromium.org/3414016/show:
"syscall_table.c is only saving us 4k of memory vs. populating at
runtime, and only for non-PIC code. Building this into a PIE or a
library would lose the saving.
Populating the table at runtime would make it easier to define
policies or have alternate syscall handlers. e.g. NaCl requires
modify_ldt(), but it would be good to disable this for other
processes just in case. Plash would like to intercept open() to
operate purely via message passing."
Another advantage would be that the table can be filled out in C++.
The asm("playground$foo") tricks we use to mix C and C++ wouldn't be
needed any more.
Original issue reported on code.google.com by mseaborn@chromium.org on 30 Oct 2010 at 1:38
Original issue reported on code.google.com by
mseaborn@chromium.org
on 30 Oct 2010 at 1:38