title: BFD unknown command when using gaddr2line
body: <p>I'm trying to use <code>gaddr2line</code> to print a prettier version of backtrace symbols.  I'm just getting the addresses from <code>backtrace()</code> then feeding them to <code>gaddr2line</code> by executing it using <code>popen</code>.  Using <code>addr2line</code> under linux works fine, but for some reason I'm getting strange errors when using <code>gaddr2line</code> on OS X.  When trying this on Mac OS I keep getting <code>BFD: ... : unknown load command ...</code>  I saw some posts metioning GDB, so I tried installing that with homebrew, but that didn't help. </p>
  
  <p>Here is my code:</p>
  
  <pre><code>    // set to the maximum possible path size
      char exe_path[4096];
  
      // Used to check if an error occured while setting up command
      bool error = false;
  
      // Check if we are running on Mac OS or not, and select appropriate command
      char* command;
      #ifdef __APPLE__
          // Check if 'gaddr2line' function is available, if not exit
          if( !system( "which gaddr2line &gt; /dev/null 2&gt;&amp;1" ) ) {
              command = "gaddr2line -Cfspe";
              pid_t pid = getpid();
              int path_length = proc_pidpath( pid, exe_path, sizeof( exe_path ) );
              if( path_length &lt;= 0 ) {
                  writeLog( SIMPLOG_LOGGER, "Unable to get execution path. Defaulting to standard backtrace." );
                  error = true;
              }
              exe_path[path_length] = 0;
          } else {
              writeLog( SIMPLOG_LOGGER, "Function 'gaddr2line' unavailable. Defaulting to standard backtrace. Please install package 'binutils' for better stacktrace output." );
              error = true;
          }
      #endif
  </code></pre>
  
  <p>Here is the output:</p>
  
  <pre><code>gaddr2line -Cfspe /Users/nate/git/SimpleLogger/build/test 7408927
  BFD: /Users/nate/git/SimpleLogger/build/test: unknown load command 0x2a
  BFD: /Users/nate/git/SimpleLogger/build/test: unknown load command 0x28
  BFD: /Users/nate/git/SimpleLogger/build/test: unknown load command 0x29
  BFD: /Users/nate/git/SimpleLogger/build/test: unknown load command 0x2b
  </code></pre>