Latest LQ Deal: Latest LQ Deals
Go Back > Forums > Linux Forums > Linux - Software
User Name
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.


  Search this Thread
Old 12-25-2003, 02:26 PM   #1
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:

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



Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 07:40 AM
Make failure in BFD while installing GDB salmatele Linux - Software 0 08-15-2005 02:53 AM
DLL and BFD blinux1 Programming 1 03-02-2005 12:28 PM
Cannot find symbol, which is in static library, in a exe file. amumu Programming 0 02-03-2005 11:47 PM
HELP how to get file information wilson-china Programming 1 03-11-2004 11:50 PM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 06:49 PM.

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