title: How to see the GNU debuglink value of an ELF file?
body: <p>So I can <em>add</em> a link to a debug symbol file like this <code>objcopy --add-gnu-debuglink=$name.dbg $name</code>, but how can I later retrieve that value again?</p>
  
  <p>I checked with <code>readelf -a</code> and grepped for <code>\.dbg</code> without any luck. Similarly I checked the with <code>objdump -sj .gnu_debuglink</code> (<code>.gnu_debuglink</code> is the section) and could see the value there:</p>
  
  <pre><code>$ objdump -sj .gnu_debuglink helloworld|grep \.dbg
  0000 68656c6c 6f776f72 6c642e64 62670000  helloworld.dbg..
  </code></pre>
  
  <p>However, would there be a command that allows me to extract the retrieve the exact value again (i.e. <code>helloworld.dbg</code> in the above example)? That is the file name <em>only</em> ...</p>
  
  <p>I realize I could use some shell foo here, but it seems odd that an option exists to set this value but none to retrieve it. So I probably just missed it.</p>