This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

gc-sections removing required sections of elf


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]