Problems with BFD library
John Zoidberg
the.real.doctor.zoidberg@gmail.com
Mon Jun 18 14:52:00 GMT 2007
More information about the Binutils mailing list
Mon Jun 18 14:52:00 GMT 2007
- Previous message (by thread): ALIGNOF broke binutils build
- Next message (by thread): Problems with BFD library
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
I've been banging my head on the wall but can't still figure it out
what is wrong with this piece of code.
I just want to know how many sections an ELF file has.
The call bfd_count_sections keeps returning 0 sections!!! Even though
I initialize the magic numbers table.
#include <stdio.h>
#include "bfd.h"
int main(int argc, char *argv[])
{
bfd *ibfd;
char *filename;
filename = argv[1];
bfd_init();
ibfd = bfd_openr(filename, NULL);
int sections_count=bfd_count_sections(ibfd);
printf("%s section count %d\n",argv[1],sections_count);
bfd_close(ibfd);
return 0;
}
I build this code with: gcc bfdtool.c -o bfdtool -lbfd.
Thank you for any help.
- Previous message (by thread): ALIGNOF broke binutils build
- Next message (by thread): Problems with BFD library
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Binutils mailing list