public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* bfd_get_section_size() returns zero?
@ 2011-02-17  0:11 Reid Linnemann
  2011-02-17  3:57 ` Alan Modra
  0 siblings, 1 reply; 4+ messages in thread
From: Reid Linnemann @ 2011-02-17  0:11 UTC (permalink / raw)
  To: binutils

I'm fairly new to BFD, so please bear with me. I'm making a quick and
dirty dwarf parser and using BFD to fetch the relevant .debug*
sections. After I fetch a section with bfd_get_section_by_name(), if I
attempt to get the section size with bfd_get_section_size(), thus far
on an amd64 system I have been getting the appropriate size, but on an
i386 system the same code is returning 0! All size members in the
asection struct are zero, and line_filepos appears to be an invalid
address. I don't understand. I can get the section contents with
bfd_malloc_and_get_section(), but no size information. This happens
with all sections AFAICT. Both systems are based on RHEL 5 and are
using the same binutils (2.17.50.0.6-12.el5). Can anyone assist?

Thanks,
Reid

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: bfd_get_section_size() returns zero?
  2011-02-17  0:11 bfd_get_section_size() returns zero? Reid Linnemann
@ 2011-02-17  3:57 ` Alan Modra
  2011-02-17 15:32   ` Reid Linnemann
  0 siblings, 1 reply; 4+ messages in thread
From: Alan Modra @ 2011-02-17  3:57 UTC (permalink / raw)
  To: Reid Linnemann; +Cc: binutils

Your most likely problem is that bfd headers don't match the bfd
library you are linking/running against.

-- 
Alan Modra
Australia Development Lab, IBM

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: bfd_get_section_size() returns zero?
  2011-02-17  3:57 ` Alan Modra
@ 2011-02-17 15:32   ` Reid Linnemann
  2011-02-17 21:55     ` Reid Linnemann
  0 siblings, 1 reply; 4+ messages in thread
From: Reid Linnemann @ 2011-02-17 15:32 UTC (permalink / raw)
  To: Reid Linnemann, binutils

On Wed, Feb 16, 2011 at 9:57 PM, Alan Modra <amodra@gmail.com> wrote:
> Your most likely problem is that bfd headers don't match the bfd
> library you are linking/running against.
>
> --
> Alan Modra
> Australia Development Lab, IBM
>

I'm fairly certain that's not the case. If it were I would still
expect bfd_get_section_size() to return a valid value since libbfd
would internally agree on the structure of the asection record. Would
you agree?

Is it generally accepted that fetching a section with
bfd_get_section_by_name() will always yield an asection with size
information? Or can lbbfd perform a "lazy load" that needs
supplementary actions to fetch all information for the section? And
what would those supplementary actions be?

Thanks for your assistance,
Reid

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: bfd_get_section_size() returns zero?
  2011-02-17 15:32   ` Reid Linnemann
@ 2011-02-17 21:55     ` Reid Linnemann
  0 siblings, 0 replies; 4+ messages in thread
From: Reid Linnemann @ 2011-02-17 21:55 UTC (permalink / raw)
  To: Reid Linnemann, binutils

On Thu, Feb 17, 2011 at 9:32 AM, Reid Linnemann <linnemannr@gmail.com> wrote:
> On Wed, Feb 16, 2011 at 9:57 PM, Alan Modra <amodra@gmail.com> wrote:
>> Your most likely problem is that bfd headers don't match the bfd
>> library you are linking/running against.
>>
>> --
>> Alan Modra
>> Australia Development Lab, IBM
>>
>
> I'm fairly certain that's not the case. If it were I would still
> expect bfd_get_section_size() to return a valid value since libbfd
> would internally agree on the structure of the asection record. Would
> you agree?
>
> Is it generally accepted that fetching a section with
> bfd_get_section_by_name() will always yield an asection with size
> information? Or can lbbfd perform a "lazy load" that needs
> supplementary actions to fetch all information for the section? And
> what would those supplementary actions be?
>
> Thanks for your assistance,
> Reid
>

After enough rummaging around I found this:
https://bugzilla.redhat.com/show_bug.cgi?id=529028

Basically the bfd.h header was not matching the ABI, as was suspected.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-02-17 21:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-02-17  0:11 bfd_get_section_size() returns zero? Reid Linnemann
2011-02-17  3:57 ` Alan Modra
2011-02-17 15:32   ` Reid Linnemann
2011-02-17 21:55     ` Reid Linnemann

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