This is the mail archive of the
mailing list for the binutils project.
Problem caused by removed function and its remaining dwarf entry
- From: "Terry Guo" <terry dot guo at arm dot com>
- To: <binutils at sourceware dot org>
- Cc: "Yao Qi" <Yao dot Qi at arm dot com>, "Joey Ye" <Joey dot Ye at arm dot com>
- Date: Fri, 13 Feb 2015 17:07:08 +0800
- Subject: Problem caused by removed function and its remaining dwarf entry
- Authentication-results: sourceware.org; auth=none
I have an unused function foo in file foo.c which is then compiled with -O0
and -ffunction-sections. The foo function will be kept in foo.o and will get
a dwarf entry in dwarf section. Lately the --gc-section will discard this
unused function and its section, but won't clean its dwarf entry. Then when
set breakpoint for function foo under gdb, gdb will use such remaining and
incorrect dwarf entry to set breakpoint for no-longer-existing function foo.
For embedded target, such incorrect information like PC value will be passed
to hardware debug unit to set breakpoint, this will cause trouble.
Is it possible to remove corresponding dwarf entry after --gc-section
discarded sections? Please help. Thanks in advance.