Issue with debug symbols with garbage collector

Nagaraju Mekala gnuuser.raj@gmail.com
Thu Apr 21 07:27:04 GMT 2022


Hi Michael,

Thanks for the reply.

On Thu, Apr 21, 2022 at 12:52 AM Michael Eager <eager@eagercon.com> wrote:

> On 4/20/22 02:15, Nagaraju Mekala via Gcc-help wrote:
> > Hello All,
> >
> > When I enable the garbage collector for the microblaze compiler
> compilation
> > seems to be fine, but the debug symbols are not generated properly.
> >
> > If we set a breakpoint at 0x0 it is showing some different location, we
> can
> > see the same in the objdump as well.
>
> What different location?
>
>  I meant instead of pointing to _start, Debug symbols were pointing to
microblaze_register_handler.

> >
> >
> > Disassembly of section .vectors.reset:
> >
> > 00000000 <_start>:
> > *
> > *
> >
> ****************************************************************************/
> > void microblaze_register_handler(XInterruptHandler Handler, void
> *DataPtr)
> > {
> >     MB_InterruptVectorTable[0].Handler = Handler;
> >     0: b0008000 imm -32768
> >     4: b8080000 brai 0
> >
> > for the _start symbols "void
> microblaze_register_handler(XInterruptHandler
> > Handler, void *DataPtr)" is coming up.
>
> It looks like both _start and microblaze_register_handler are both at 0.
> What did you expect?
>
> GDB picks the first symbol which matches the address.
>
I have attached the elf, where we cannot find any symbols related to
microblaze_register_handler function but the debug_loc is somehow showing
up at _start address.


> > If I disable the garbage-collector then everything seems fine.
> > I have used "-ffunction-sections and -fdata-sections" options during
> > compilation and -gc-sections during linking command.
> >
> > Please let me know how to tell the garbage collector to not delete
> > debug_loc information.
>
> Why do you think that the garbage collector is deleting debug info?
>
I was just guessing since _start debug symbols were mixed with
microblaze_register_handler.


> --
> Michael Eager
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: kc705_hello.elf
Type: application/octet-stream
Size: 202256 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc-help/attachments/20220421/87f66e6e/attachment-0001.obj>


More information about the Gcc-help mailing list