Undefined reference to -finstrument-functions

帅比萌擦擦* 提交于 2019-12-11 06:54:21

问题


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:


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.



来源:https://stackoverflow.com/questions/41776363/undefined-reference-to-finstrument-functions

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!