[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
some problem about libbfd
From: |
骆宇冲 |
Subject: |
some problem about libbfd |
Date: |
Tue, 4 Jul 2017 16:01:34 +0800 (GMT+08:00) |
When I'm using libbfd(bfd.h), I met some problems.I wrote a simple file(test.cpp) and compiled it successfully. Then I ran 'objdump test' and I got all infomation(etc. sections syms) correctly.
I installed binutils on my server, and built a check_test.cpp just like what objdump.c do. When I ran './check_test test', I got the section Info correctly but I coundn't get other info(even bfd_get_filename (abfd) and abfd->format are null).
I have checked my code many times and i cannot find bug, so I guess maybe my compiling option were not right.
I use 'g++ -g check_test.cpp /usr/lib64/libbfd.a /usr/lib64/libiberty.a -ldl -lz -o check_test' or 'g++ -g check_test.cpp -lbfd -liberty -ldl -lz -o check_test', and the problem was same as before.
So I want to know how to compile a cpp using bfd? What else should I know to use libbfd?
The attachment is my code.
Yours Sincerely.
check_toy.cpp
Description: Text document
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- some problem about libbfd,
骆宇冲 <=