Questions tagged [bfd]

BFD is the GNU Binary File Descriptor library.

BFD is the GNU Binary File Descriptor library. It is a library for reading and writing object files in various formats, and is used by the GNU binutils and gdb.

31 questions
1
vote
0 answers

BFD unknown command when using gaddr2line

I'm trying to use gaddr2line to print a prettier version of backtrace symbols. I'm just getting the addresses from backtrace() then feeding them to gaddr2line by executing it using popen. Using addr2line under linux works fine, but for some reason…
PseudoPsyche
  • 4,332
  • 5
  • 37
  • 58
0
votes
0 answers

Address resolution of a symbol with Windows (WLS2)

I am working on a library that gives information on what happens during the execution of a program. In the Unix world, I use BFD to resolve the address of the symbols used in the program. For instance, if I am interested in multi-threaded programs,…
0
votes
1 answer

Where in GDB source is the transition from GDB to BFD which will interact with the memory to "apply" a breakpoint?

I am currently investigating the GDB sources. I tried to find where the transition from GDB to BFD is where the interaction with the memory to "apply" a breakpoint is. So where the place in code is where the memory is manipulated in order to set a…
Toroid
  • 117
  • 1
  • 7
0
votes
1 answer

How to link with libbfd on MacOS?

I'm trying to build with libbfd on MacOS. I haven't found anything that indicates that Apple Clang would provide anything similar so I'm "stuck" on Homebrew. Linking with /usr/local/opt/binutils/lib/libbfd.a I get a lot of unresolved symbols, some…
thoni56
  • 3,145
  • 3
  • 31
  • 49
0
votes
0 answers

Problem when compiling program using libbfd (bfd library)

Hi I have a problme please. When I try to compile a binary analysis tool that uses the bfd library with this command: g++ -std=c++11 -o loader_demo loader_demo.cc loader.o -lbfd (I have compiled earlier the loader.o and it was successful) but with…
koko52
  • 1
0
votes
1 answer

libbfd: Write COFF object with AMD64 machine type

Im using libbfd to write out the contents of a coff object file for windows that contains x86-64 code. Writing symbols, sections and relocations works, but the resulting file does not have the machine type set in the coff header. I manually write…
tly
  • 1,202
  • 14
  • 17
0
votes
1 answer

Adding bfd peers using python

I am trying to add bfd peers in FRR using python. The process goes like this: root@10:~# vtysh Hello, this is FRRouting (version 7.6-dev-MyOwnFRRVersion-g9c28522e1). Copyright 1996-2005 Kunihiro Ishiguro, et al. This is a git build of…
0
votes
1 answer

getting virtual memory address(vma) of linker symbols

I'm playing around the bfd library (), and I was able to implement my own version of objdump -h on binary files by printing out sections, their vmas, size, etc. Now, I'm having trouble implementing nm. I'm able to use the bfd library to…
Aaron Li
  • 89
  • 10
0
votes
1 answer

Is there some equivalent of GNU Binary File Descriptor (BFD) for Windows .lib files?

I have a .lib file that was compiled from C++ and would like to be able to do some of the same things you can do with .so files using BFD in Linux. Are there any alternatives or ways to get BFD to work with .lib files? Thanks!
0
votes
0 answers

GNU BFD on binary results to "No such file or directory" (binary not executed)

There is this piece of C code that is used extract info from binaries: bincode_t *initialize_bincode(const char *file) { bfd *abfd; bincode_t *bin; //char *target = "x86_64-unknown-linux-gnu"; char *target = "i686-pc-linux-gnu"; …
jowabels
  • 122
  • 1
  • 9
0
votes
2 answers

Make BFD library find the location of a class member function

I am using the function bfd_find_nearest_line to find the source location of a function (from an executable with debugging symbols --compiled with -g). Naturally one of the arguments is a pointer to the function I want to…
alfC
  • 14,261
  • 4
  • 67
  • 118
0
votes
1 answer

How to translate an lib build with g++ 2.96 to new BFD format?

I've a library file which was built using g++ version 2.96. The source code of the lib is not available and also there is no support from the original developer. I want to link it with my application using the latest g++ version (say 4.x). As I…
0
votes
2 answers

static library linking issue using SUSE Linux and C

I have some very simple C code I was trying to compile to try to understand how static libraries work and also BFDs. I built the code using this gcc command and it could not find libbfd, and libbfd.a static library is located in both /usr/lib64 and…
user1943660
  • 65
  • 1
  • 6
0
votes
1 answer

How to retrieve flat binary from an executable file in C

How to retrieve a block of binary from .text section in an executable? I know objcopy can help by using: objcopy --only-section=.text --output-target binary a.out a.out.bin But it would be much better if I can realize the same goal within a…
zhoubot
  • 1
  • 1
0
votes
1 answer

How to relocate the bfd size symbols?

When embedding binary files in a elf image with gcc, is there a way to change the address of the automatically generated _binary_*_size symbols? Unlike the _binary_*_start and _binary_*_end symbols, the _binary_*_size symbols don't seem to follow…
Dominic
  • 619
  • 5
  • 4