title: Determining symbol addresses using binutils/readelf
body: <p>I am working on a project where our verification test scripts need to locate symbol addresses within the build of software being tested.  This might be used for setting breakpoints or reading static data from memory.  What I am after is to create a map file containing symbol names, base address in memory, and size.  Our build outputs an ELF file which has the information I want.  I've been trying to use the <em>readelf, nm, and objdump</em> tools to try and to gain the symbol addresses I need.</p>
  
  <p>I originally tried <code>readelf -s file.elf</code> and that seemed to access some symbols, particularly those which were written in assembler.  However, many of the symbols that I wanted were not in there - specifically those that originated within our Ada code.  </p>
  
  <p>I used <code>readelf --debug-dump file.elf</code> to dump all debug information.  From that I do see all symbols, including those that were in the Ada code.  However, the format seems to be in the DWARF format.  Does anyone know why these symbols would not be output by readelf when I ask it to list the symbolic information?  Perhaps there is simply an option I am missing.</p>
  
  <p>Now I could go to the trouble of writing a custom DWARF parser to get the information but if I can get it using one of the Binutils (nm, readelf, objdump) then I'd really like prefer a standard solution.  </p>