rt-thread/bsp/x86/src/extract.sh
parai 2957cf6f52 x86: bring up share object module on i386 machine
1. upddate kernel module to support i386
2. update libdl to support open *.so by absolute path
3. new test case bsp/x86/src/hello.c to test i386 module feature

Signed-off-by: parai <parai@foxmail.com>
2017-08-20 20:24:07 +08:00

29 lines
468 B
Bash
Executable File

#! /bin/sh
imap=$1
iout=$2
echo "!!! extract symbol from $imap to $iout !!!"
symlist="rt_kprintf \
rt_kputs \
rt_vsprintf \
rt_sprintf \
rt_snprintf \
rt_thread_create \
"
echo "#ifndef RT_THREAD_SYM_H_H" > $iout
echo "#define RT_THREAD_SYM_H_H" >> $iout
for sym in $symlist
do
dlim=`echo $sym | cut -b 1`
addr=`cat $imap | grep $sym | head -n 1 | cut -d $dlim -f 1`
echo "#define __abs_$sym $addr" >> $iout
done
echo "#endif /* RT_THREAD_SYM_H_H */" >> $iout