I need to get informations about symbols inside an .o file. So I'm trying it with BFD library (or whatever it is). I have this code:
Code:
#include <iostream>
#include <bfd.h>
using namespace std;
int main ()
{
bfd *abfd = 0;
bfd_init ();
abfd = bfd_openr ("mdl.o", "elf32-i386");
if (abfd == 0) {
cerr << "Can't initialize abfd!\n";
return 1;
}
long needed = bfd_get_symtab_upper_bound (abfd);
cout << "Needed = " << needed << endl;
}
- It causes segmentation fault error. I don't know why? Btw - I took it from "info bfd" if anyone's interested.
I'm on G++ 3.2.2....
Oxyd.