Open louisom opened 7 years ago
CI fails because of incorrect linkage.
@jserv How could I prevent kernel / user function multiple define?
l4test and kernel all define the name strcmp
build/discoveryf4/user/apps/l4test/string.o: In function `strcmp':
/home/travis/build/f9micro/f9-kernel/user/apps/l4test/string.c:21: multiple definition of `strcmp'
build/discoveryf4/kernel/lib/strcmp.o:/home/travis/build/f9micro/f9-kernel/kernel/lib/strcmp.c:12: first defined here
make: *** [build/discoveryf4/f9_nosym.elf] Error 1
@grapherd, there should be only one implementation providing strcmp
: kernel/lib/strcmp.c
. You would need appropriate declarations where user applications include include/lib/string.h
In Linux kernel, kprobe can choose to register by address or symbol name, but currently F9 microkernel can only register by address.
In F9 microkernel, it can include ksymbols when compiling kernel with CONFIG_SYMMAP, which means F9 microkernel can support regiser kprobe via symbol name, too.
This commit change two parts in F9 microkernel, ksym and kprobes.
symbol_name
in struct kprobe.kprobe_addr
,kprobe_addr
will return correct function address. Also,kprobe_addr
will failed when it cannot match the symbol name in symtab, or address and symbol name are used in the same time.Example usage:
or