fbpx
Wikipedia

Binary File Descriptor library

The Binary File Descriptor library (BFD) is the GNU Project's main mechanism for the portable manipulation of object files in a variety of formats. As of 2003, it supports approximately 50 file formats for some 25 instruction set architectures.

Binary File Descriptor library
Original author(s)Cygnus Solutions
Repository
  • sourceware.org/git/?p=binutils-gdb.git%3Ba%3Dtree%3Bf%3Dbfd
Written inC
TypeLibrary
LicenseGNU General Public License

History edit

When David Henkel-Wallace of Cygnus Support proposed developing the library as a way to open up new business opportunities for the company, Richard Stallman said that it would be difficult; David's response was that it wasn't such a "Big Fucking Deal". Abbreviated to "BFD", this became the library name.[1] "Binary File Descriptor" was invented later as a backronym for "BFD".

Design edit

BFD works by presenting a common abstract view of object files. An object file has a "header" with descriptive info; a variable number of "sections" that each has a name, some attributes, and a block of data; a symbol table; relocation entries; and so forth.

Internally, BFD translates the data from the abstract view into the details of the bit/byte layout required by the target processor and file format. Its key services include handling byte order differences, such as between a little-endian host and big-endian target, correct conversion between 32-bit and 64-bit data, and details of address arithmetic specified by relocation entries.

BFD[2] library can be logically divided into two parts. The front-end and the back-end. The front-end gives a common interface independent of underlying object file view. Users will be interacting with the object files with this interface. Even if the layout of the object files are not to known the user, user still be able to use the interface. This hiding of the detail is done with the help of the back-end. The back-end implements how the front-end interface interacts with the object files layout. Whenever a new object files type is introduced the back-end needs to register the type and implement it if it needs to be supported by the BFD application.

Although BFD was originally designed to be a generic library usable by a wide variety of tools, the frequent need to tinker with the API to accommodate new systems' capabilities has tended to limit its use;[3][4][5] BFD's main clients are the GNU Assembler (GAS), GNU Linker (GLD), and other GNU Binary Utilities ("binutils") tools, and the GNU Debugger (GDB). As a result, BFD is not distributed separately, but is always included with releases of binutils and GDB. Nevertheless, BFD is a critical component in the use of GNU tools for embedded systems development.

The BFD library can be used to read the structured data out of a core dump.

BFD Library Usage edit

Eg: Print object file size using bfd library apis.

#include "bfd.h" #include <stdio.h> int main() { bfd* abfd = bfd_openr("a.o",NULL); printf("%llu\n", bfd_get_size(abfd)); return 0; } 

Build command:

gcc main.c -lbfd -o output ./output # prints the size 

References edit

  1. ^ "Open Sources: Voices from the Open Source Revolution". O'Reilly. January 1999. Retrieved 2011-11-11. Gumby began designing the library and discussing the design with Stallman. Stallman said that the job was too difficult—it would require a complete rewrite of all the tools, and it would be too difficult to maintain. Gumby told him it wasn't such a "Big F*cking Deal" and hence named this new creation the BFD library. (We explained to our customers that BFD stood for the binary file descriptor library.)
  2. ^ [1]BFD specificaiton
  3. ^ Langasek, Steve (2005-05-22). "Re: depending on shared libbfd from binutils-dev". debian-devel (Mailing list). Retrieved 2011-04-03.
  4. ^ Kuratomi, Toshio (2010-06-04). "binutils once more". Fedora-packaging (Mailing list). Retrieved 2011-04-03.
  5. ^ Taylor, Ian (2003-09-12). "Re: FreeBSD 4.6 - binutils 2.14 installs useless libbfd". binutils (Mailing list). Retrieved 2011-04-03.

External links edit

  • Binutils page, with access to current BFD sources
  • objdump implementation, uses many BFD apis

binary, file, descriptor, library, topic, this, article, meet, wikipedia, notability, guidelines, products, services, please, help, demonstrate, notability, topic, citing, reliable, secondary, sources, that, independent, topic, provide, significant, coverage, . The topic of this article may not meet Wikipedia s notability guidelines for products and services Please help to demonstrate the notability of the topic by citing reliable secondary sources that are independent of the topic and provide significant coverage of it beyond a mere trivial mention If notability cannot be shown the article is likely to be merged redirected or deleted Find sources Binary File Descriptor library news newspapers books scholar JSTOR July 2011 Learn how and when to remove this template message The Binary File Descriptor library BFD is the GNU Project s main mechanism for the portable manipulation of object files in a variety of formats As of 2003 update it supports approximately 50 file formats for some 25 instruction set architectures Binary File Descriptor libraryOriginal author s Cygnus SolutionsRepositorysourceware wbr org wbr git wbr p binutils gdb wbr git 3Ba 3Dtree 3Bf 3DbfdWritten inCTypeLibraryLicenseGNU General Public License Contents 1 History 2 Design 3 BFD Library Usage 4 References 5 External linksHistory editWhen David Henkel Wallace of Cygnus Support proposed developing the library as a way to open up new business opportunities for the company Richard Stallman said that it would be difficult David s response was that it wasn t such a Big Fucking Deal Abbreviated to BFD this became the library name 1 Binary File Descriptor was invented later as a backronym for BFD Design editBFD works by presenting a common abstract view of object files An object file has a header with descriptive info a variable number of sections that each has a name some attributes and a block of data a symbol table relocation entries and so forth Internally BFD translates the data from the abstract view into the details of the bit byte layout required by the target processor and file format Its key services include handling byte order differences such as between a little endian host and big endian target correct conversion between 32 bit and 64 bit data and details of address arithmetic specified by relocation entries BFD 2 library can be logically divided into two parts The front end and the back end The front end gives a common interface independent of underlying object file view Users will be interacting with the object files with this interface Even if the layout of the object files are not to known the user user still be able to use the interface This hiding of the detail is done with the help of the back end The back end implements how the front end interface interacts with the object files layout Whenever a new object files type is introduced the back end needs to register the type and implement it if it needs to be supported by the BFD application Although BFD was originally designed to be a generic library usable by a wide variety of tools the frequent need to tinker with the API to accommodate new systems capabilities has tended to limit its use 3 4 5 BFD s main clients are the GNU Assembler GAS GNU Linker GLD and other GNU Binary Utilities binutils tools and the GNU Debugger GDB As a result BFD is not distributed separately but is always included with releases of binutils and GDB Nevertheless BFD is a critical component in the use of GNU tools for embedded systems development The BFD library can be used to read the structured data out of a core dump BFD Library Usage editEg Print object file size using bfd library apis include bfd h include lt stdio h gt int main bfd abfd bfd openr a o NULL printf llu n bfd get size abfd return 0 Build command gcc main c lbfd o output output prints the sizeReferences edit nbsp Free and open source software portal Open Sources Voices from the Open Source Revolution O Reilly January 1999 Retrieved 2011 11 11 Gumby began designing the library and discussing the design with Stallman Stallman said that the job was too difficult it would require a complete rewrite of all the tools and it would be too difficult to maintain Gumby told him it wasn t such a Big F cking Deal and hence named this new creation the BFD library We explained to our customers that BFD stood for the binary file descriptor library 1 BFD specificaiton Langasek Steve 2005 05 22 Re depending on shared libbfd from binutils dev debian devel Mailing list Retrieved 2011 04 03 Kuratomi Toshio 2010 06 04 binutils once more Fedora packaging Mailing list Retrieved 2011 04 03 Taylor Ian 2003 09 12 Re FreeBSD 4 6 binutils 2 14 installs useless libbfd binutils Mailing list Retrieved 2011 04 03 External links editBinutils page with access to current BFD sources objdump implementation uses many BFD apis Retrieved from https en wikipedia org w index php title Binary File Descriptor library amp oldid 1165046386, wikipedia, wiki, book, books, library,

article

, read, download, free, free download, mp3, video, mp4, 3gp, jpg, jpeg, gif, png, picture, music, song, movie, book, game, games.