This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
newbie: problems initializing a bfd*
- From: "George Hicken" <gh299 at ecs dot soton dot ac dot uk>
- To: "binutils" <binutils at sources dot redhat dot com>
- Date: Thu, 29 Nov 2001 17:45:25 -0000
- Subject: newbie: problems initializing a bfd*
I am new the the bfd and am having problems initializing a bfd* with it.
I have read the docs but they weren't that helpful with the problem.
The following code encapsulates where I am going wrong:
int main(int argc, char **argv) {
long storage_needed;
asymbol **symbol_table;
long number_of_symbols;
bfd* abfd;
bfd_init();
// have tried bfd_openr with elf32-i386 for the target
// and that didn't help, didn't help
abfd = bfd_openr("object_file.o", NULL);
if (!abfd)
return 1;
storage_needed = bfd_get_symtab_upper_bound (abfd);
return 0;
}
I get an exception in _bfd_elf_get_symtab_upper_bound
System:
Red Hat Linux 7.2
Binutils snapshot 011128 (compiled sucessfully with gcc 3.0.2)
I have also looked through objdump.c to see if that helped. I
couldn't see any major difference in the way I am using the openr
function (I assume that this is where the problem is) or any
intialization that I was missing.
Any help would be great.
--
George Hicken
icq#: 462051