structure of a compiled binary

This is a discussion on structure of a compiled binary within the C Programming forums, part of the General Programming Boards category; Hi all, I am using a GCC cross-compiler toolchain to compile for an ARM target. I am interested in learning ...

  1. #1
    Pea
    Pea is offline
    Registered User
    Join Date
    Oct 2004
    Posts
    36

    structure of a compiled binary

    Hi all,

    I am using a GCC cross-compiler toolchain to compile for an ARM target.

    I am interested in learning about the structure of the compiled binary file. Does anybody have any links to this information, or know what to search for?

    FYI: I am compiling Position Independant Code (PIC) and want to find out how to parse/manipulate the Global Offste Table (GOT) and how to find the addresses of certain functions (or at least the main function) within the code.

    Thanks in advance,
    Pea

  2. #2
    Registered User Codeplug's Avatar
    Join Date
    Mar 2003
    Posts
    4,630
    Lookup the ELF object file format.

    http://www.linuxjournal.com/article/1059

    gg

  3. #3
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,417
    Code:
    $ ld --help | grep map
      -M, --print-map             Print map file on standard output
      -Map FILE                   Write a map file
    Any use?

    Or use the 'nm' utility, or perhaps at a push, you could presuade 'objdump' to do something.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Dikumud
    By maxorator in forum C++ Programming
    Replies: 1
    Last Post: 10-01-2005, 06:39 AM
  2. Tutorial review
    By Prelude in forum A Brief History of Cprogramming.com
    Replies: 11
    Last Post: 03-22-2004, 08:40 PM
  3. binary to decimal
    By miryellis in forum C Programming
    Replies: 7
    Last Post: 03-14-2004, 07:35 PM
  4. Request for comments
    By Prelude in forum A Brief History of Cprogramming.com
    Replies: 15
    Last Post: 01-02-2004, 09:33 AM
  5. Structure Within Structure
    By Shakira in forum C Programming
    Replies: 3
    Last Post: 11-04-2003, 02:35 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21