mirror of
https://github.com/genodelabs/genode.git
synced 2024-12-19 05:37:54 +00:00
25 lines
567 B
Bash
Executable File
25 lines
567 B
Bash
Executable File
#!/bin/sh
|
|
#
|
|
# usage: dde_kit_find_initcalls <list of object files>
|
|
#
|
|
|
|
tempfile="/tmp/dde_kit-$(date +%s)"
|
|
|
|
nm -C "$@" | grep "dde_kit_initcall_" > $tempfile
|
|
sed -i "s/^.* \(dde_kit_initcall_.*\)/\1/" $tempfile
|
|
|
|
echo "/*"
|
|
echo " * Automatically generated by \"os/tool/dde_kit_find_initcalls $@\"."
|
|
echo " */"
|
|
cat $tempfile | sed "s/\(.*\)/extern int (*\1)(void);/" | sort | uniq
|
|
echo
|
|
echo "void do_initcalls(void)"
|
|
echo "{"
|
|
cat $tempfile | sed "s/\(.*\)/ \1();/" | sort | uniq
|
|
echo "}"
|
|
echo "/*"
|
|
echo " * End of automatically generated code."
|
|
echo " */"
|
|
|
|
rm $tempfile
|