Undefined reference to -finstrument-functions

2019-08-02 08:24发布

I am trying to trace kernel functions and I am using -finstrument-functions to do that, but I get undefined reference errors as below:

arch/arm/kernel/elf.c:9: undefined reference to `__cyg_profile_func_enter'
arch/arm/kernel/elf.c:13: undefined reference to `__cyg_profile_func_exit'
arch/arm/kernel/built-in.o: In function `elf_set_personality':
arch/arm/kernel/elf.c:42: undefined reference to `__cyg_profile_func_enter'
arch/arm/kernel/elf.c:75: undefined reference to `__cyg_profile_func_exit'

There are many more errors similar to above in drivers also. I have exported the __cyg_profile_func_enter and __cyg_profile_func_exit symbols, but still I get this error. I use linux 4.1 kernel and arm board.

1条回答
来,给爷笑一个
2楼-- · 2019-08-02 09:19

Have you made the entries of __cyg_profile_func_enter and __cyg_profile_func_exit in the header file as well. If not then pls declare these function in the header file and make sure that module is compiling.

查看更多
登录 后发表回答