public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: Michael Eager <eager@eagercon.com>
To: Nagaraju Mekala <gnuuser.raj@gmail.com>,
	Michael Eager <eager@eagercon.com>
Cc: gcc-help <gcc-help@gcc.gnu.org>
Subject: Re: Issue with debug symbols with garbage collector
Date: Thu, 21 Apr 2022 11:11:05 -0700	[thread overview]
Message-ID: <f9f84fe2-de17-7cac-0244-9245fc1052de@eagercon.com> (raw)
In-Reply-To: <CAKuVEhBot73i-AKZdujwyzMKe7Aarz1tjELG64q0CpRYp5MO7g@mail.gmail.com>

On 4/21/22 00:27, Nagaraju Mekala via Gcc-help wrote:
>>   I meant instead of pointing to _start, Debug symbols were pointing to
> microblaze_register_handler.

Both symbols are at location 0.

> 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.

There are two places where symbols are defined.  One is in the ELF
symbol table:

    $ readelf -s kc705_hello.elf | grep " _start"
    277: 0000000000000000     0 FUNC    GLOBAL DEFAULT    1 _start

The other in the DWARF debug_info section:

    $ readelf -w kc705_hello.elf
<1><383>: Abbrev Number: 15 (DW_TAG_subprogram)
     <384>   DW_AT_external    : 1
     <384>   DW_AT_name        : (indirect string, offset: 0xf783): 
microblaze_register_handler
     <388>   DW_AT_decl_file   : 1
     <389>   DW_AT_decl_line   : 86
     <38a>   DW_AT_decl_column : 6
     <38b>   DW_AT_prototyped  : 1
     <38b>   DW_AT_low_pc      : 0x0              <=== Fun is at 0x0000
     <393>   DW_AT_high_pc     : 0x18
     <39b>   DW_AT_frame_base  : 1 byte block: 9c 
(DW_OP_call_frame_cfa)
     <39d>   DW_AT_call_all_calls: 1
     <39d>   DW_AT_sibling     : <0x3bc>

GDB uses the DWARF information before falling back to using the
ELF symbol table.

-- 
Michael Eager

  reply	other threads:[~2022-04-21 18:11 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-20  9:15 Nagaraju Mekala
2022-04-20 19:22 ` Michael Eager
2022-04-21  7:27   ` Nagaraju Mekala
2022-04-21 18:11     ` Michael Eager [this message]
2022-04-21 18:28       ` Michael Eager
2022-04-22  6:29         ` Nagaraju Mekala

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f9f84fe2-de17-7cac-0244-9245fc1052de@eagercon.com \
    --to=eager@eagercon.com \
    --cc=gcc-help@gcc.gnu.org \
    --cc=gnuuser.raj@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).