zephyr/scripts
Andrew Boie 3ae644457e gen_syscall_header: create dummy handler refs
The core kernel is built with the --no-whole-archive linker option.
For all the individual .o files which make up the kernel, if there
are no external references to symbols within these object files,
everything in the object file is dropped.

This has a subtle interaction with system call handlers. If an object
file has system call handlers inside it, and nothing else in the
object file is referenced, then the linker will prefer the weak
version of the handler in the generated syscall_dispatch.c. The
user will get an "unimplemented system call" error if the associated
system call for that handler is made.

Fix this by making a fake reference to the handler function at the
system call site. The address gets stored inside a special section
"hndlr_ref".  This is enough to prevent the handlers from being
dropped, and the hndlr_ref section is itself dropped from the binary
from gc-sections; these references will not consume space.

Handlers for system calls that are never invoked anywhere will still be
dropped if nothing else in their containing C files is used, which is
a good thing. A future enhancement could be to split out all handlers
into individual object files, such that we can guarantee that any system
call that is not made somewhere in the application will have its handler
dropped. This will need to be extended to driver subsystems as well.
This won't be pretty but will ensure the tightest binary size.

Fixes #5184.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-11-29 14:18:20 -08:00
..
checkpatch checkpatch: add NANO_ESF as a typedef to avoid spacing errors 2017-11-03 10:29:41 -04:00
ci ci: verify author identity 2017-11-24 10:21:53 -05:00
cmake Introduce cmake-based rewrite of KBuild 2017-11-08 20:00:22 -05:00
cross_compiler toolchains: fix xtools configurations 2017-10-12 16:27:12 -05:00
dts yaml: fix properties syntax to 'mapping' instead of 'series' 2017-11-28 11:42:59 -06:00
footprint scripts: move footprint scripts to footprint/ 2017-09-11 08:53:56 -07:00
gitlint ci: do not treat message parts as xml 2017-10-28 09:00:50 -04:00
kconfig kbuild: Removed KBuild 2017-11-08 20:00:22 -05:00
sanity_chk sanitycheck: add extra_configs for testing with multiple values 2017-10-17 08:55:38 -04:00
support scripts: jlink: Don't reset after load 2017-11-15 09:09:58 -06:00
.gitignore
check_link_map.py check_link_map: fix check for app memory 2017-06-29 07:46:58 -04:00
checkpatch.pl scripts: Update checkpatch to latest from the linux kernel 2017-10-02 18:48:56 -04:00
checkstack.pl
CMakeLists.txt Introduce cmake-based rewrite of KBuild 2017-11-08 20:00:22 -05:00
file2hex.py build: Add rules in Makefile.gen to generate a hex file 2017-09-18 14:56:16 -04:00
filter-known-issues.py doc: filter-known-issues.py and empty files 2017-09-21 16:58:17 -04:00
gcc-version.sh
gen_gdt.py gen_gdt: add debug statements and simplify logic 2017-11-07 09:31:49 -08:00
gen_idt.py scripts: add version check for pyelftools 2017-07-25 13:41:16 -04:00
gen_kobject_list.py userspace: assign thread IDs at build time 2017-11-03 11:29:23 -07:00
gen_mmu_x86.py gen_mmu_x86.py: decrease verbosity 2017-11-07 09:31:49 -08:00
gen_offset_header.py scripts: fix offset.h header guard 2017-08-01 15:05:13 -04:00
gen_syscall_header.py gen_syscall_header: create dummy handler refs 2017-11-29 14:18:20 -08:00
gen_syscalls.py kernel: allow system call with 64-bit return val 2017-10-12 16:25:00 -07:00
headerdep.pl
make-ll license: Replace Apache boilerplate with SPDX tag 2017-01-19 03:50:58 +00:00
Makefile.qemu_jailhouse x86: add new board to accomodate Jailhouse port 2017-11-07 08:58:49 -05:00
mksysmap
process_gperf.py kernel: introduce object validation mechanism 2017-09-07 16:33:33 -07:00
qemu-machine-hack.py build: make sure we are calling python3 in all scripts 2017-04-13 20:22:54 +00:00
requirements.txt scripts: require python module wheel 2017-10-31 12:32:34 -04:00
sanitycheck sanitycheck: remove obsolete DISABLE_TRYRUN 2017-11-28 15:31:27 -05:00
spelling.txt scripts: updated spelling.txt file 2017-07-14 12:57:40 +03:00
tags.sh
timestamp license: Replace Apache boilerplate with SPDX tag 2017-01-19 03:50:58 +00:00
uncrustify.cfg scripts: add configuration file for uncrustify 2017-02-04 01:46:29 +00:00
vercomp sdk: zephyr: check for minimum required version of SDK 2016-09-15 21:17:02 +00:00
waitpid sanitycheck: Let waitpid script kill Xtensa ISS if user hits ctrl+c. 2017-04-11 16:53:41 +00:00