This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
gc-sections removing required sections of elf
- From: Nagaraju Mekala <gnuuser dot raj at gmail dot com>
- To: binutils at sourceware dot org
- Date: Thu, 20 Feb 2014 23:11:19 +0530
- Subject: gc-sections removing required sections of elf
- Authentication-results: sourceware.org; auth=none
Hi All,
I am using gcc-4.8.3 with binutils-2.23 and newlib-1.19 for a private port.
I am facing an issue with gc-sections. I have compiled a small
program with -O2, -g, -ffunction-sections,-fdata-sections,
-gc-sections options.
Below is the dump of the generated elf.
.....
2c: 30a30000 addik r5, r3, 0
00000030 <_exit>:
30: b8000000 bri 0 // 30 <_exit>
......
When I set the breakpoint at _exit function it is setting at 0x2c
location. when I debugged GDB I found that dwarf line number
information of _exit function is missing.
This is being deleted by garbage collector. If I remove -gc-sections
flag then it is setting breakpoint at 0x30 location correctly.
Can anyone please let me know how can we tell the garbage collector
to not to delete .debug information of _exit function.
Thanks,
Nagaraju