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