This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: How to lookup a symbol for vma using BFD?
Perhaps, I did not mention that the comp unit contains info about this
symbol (gsData) and its location is exactly the same as a symbol value
found by search previously.
Compilation Unit @ offset 0xaabb50:
Length: 268
Version: 2
Abbrev Offset: 0
Pointer Size: 4
<0><aabb5b>: Abbrev Number: 8 (DW_TAG_compile_unit)
DW_AT_name : ../../s4000/arm.elf.cygwin.ads/kwceziapp.mod.c
DW_AT_producer : Thumb C Compiler, ADS1.2 [Build 842]
DW_AT_language : 1 (ANSI C)
...
<1><aabc2a>: Abbrev Number: 61 (DW_TAG_variable)
DW_AT_name : gsData
DW_AT_type : DW_FORM_ref_udata <aabc26>
DW_AT_location : 5 byte block: 3 7c a0 61 1 (DW_OP_addr: 161a07c)
DW_AT_start_scope : 0
2008/8/7 Dmitry Smirnov <divis1969@gmail.com>:
> Yes, I understand it.
> But let's assume I do not have such a possibility. I just need to know
> what is the name of the file that contains some address.
>
> 2008/8/7 Nick Clifton <nickc@redhat.com>:
>> Hi Dmitry,
>>
>>> I've found that the comp unit for this file contains no
>>> DW_AT_stmt_list attribute and comp_unit_maybe_decode_line_info() from
>>> dwarf2.c returns FALSE thus preventing comp_unit_find_line() from
>>> looking up variable table.
>>
>> You need to include DWARF2 debugging info in your object files for this
>> work. ie you need to have the "-g" switch present on gcc's command line
>> when you compile your object files.
>>
>> Cheers
>> Nick
>>
>>
>>
>