LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 12-25-2003, 01:26 PM   #1
Oxyd
Member
 
Registered: Oct 2003
Distribution: Fedora Core 3
Posts: 34

Rep: Reputation: 15
How to get symbol information from .o file using BFD?


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.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
APF - BFD How I know these are running? latino Linux - Software 2 08-12-2006 06:40 AM
Make failure in BFD while installing GDB salmatele Linux - Software 0 08-15-2005 01:53 AM
DLL and BFD blinux1 Programming 1 03-02-2005 11:28 AM
Cannot find symbol, which is in static library, in a exe file. amumu Programming 0 02-03-2005 10:47 PM
HELP how to get file information wilson-china Programming 1 03-11-2004 10:50 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 01:33 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration