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]

Re: How to lookup a symbol for vma using BFD?


2008/8/7 Frank Ch. Eigler <fche@redhat.com>:
> There is no way in general.  Source code file names do not propagate
> to ordinary (stripped, -g debugging information-less) object files.

(I didn't noticed I've sent this mail to Frank personnaly. Perhaps, it
will be informational for others, so sending it to maillist)

As you could notice, I'm using ADS tools for ELF creation.

I've found a reason for such an "information-less" object files. These
files in fact contain debug information, but are linked in 2 steps:
initially some files are "partially" linked together and later this
partially linked object is linked with other objects.

Here is the quote from ARM linker guide:
"If you are creating a partially-linked object rather than an image,
armlink discards the debug input sections it finds in the input
objects, but does produce the symbol and string table in the
partially-linked object."

Thus, some of the information exists in the resulting ELF. But as I
said, comp_unit_maybe_decode_line_info() does not try to load variable
and function tables. I suppose, this info can be used as is and can be
useful even if BFD cannot locate an exact line number.

I'm going to enforce comp_unit_maybe_decode_line_info() to load symbol
info (call scan_unit_for_symbols() ) and comp_unit_find_line() to
ignore result of comp_unit_maybe_decode_line_info.

Perhaps such a change can be applied to further BFD versions? If not,
I will use my personal version.

Dmitry


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