<div><span style="font-family:arial,sans-serif;font-size:13.333333015441895px">(sent this to llvmdev the first time, sorry about the duplicates)</span></div><span style="font-family:arial,sans-serif;font-size:13.333333015441895px"><div>
<span style="font-family:arial,sans-serif;font-size:13.333333015441895px"><br></span></div>For llvm-dwarfdump we need to handle relocations inside the debug info sections in order to successfully dump the dwarf info including strings. Nick sent out a partial patch that did this not too long ago and I've taken it and gone in a bit of a different direction, but kept the same basic architecture.</span><div style="font-family:arial,sans-serif;font-size:13.333333015441895px">
<br></div><div style="font-family:arial,sans-serif;font-size:13.333333015441895px">In place of applying the relocations to the data we've read from disk I'm keeping a separate mapping table to the side and checking that at locations in the dwarf I'm expecting relocated values. This adds a bit of complexity to the dwarf parsing/extraction at the benefit of not allocating memory for the entire size of the debug info section.</div>
<div style="font-family:arial,sans-serif;font-size:13.333333015441895px"><br></div><div style="font-family:arial,sans-serif;font-size:13.333333015441895px">Couple of areas that will need to be improved later:</div><div style="font-family:arial,sans-serif;font-size:13.333333015441895px">
<br></div><div style="font-family:arial,sans-serif;font-size:13.333333015441895px">a) Relocations in more than a single section: the .debug_info section is the primary one I cared about first, however, we'll need either</div>
<div style="font-family:arial,sans-serif;font-size:13.333333015441895px">  1) A better mapping that contains section + address (since the debug sections are mapped at address 0 I can't just use total offset)</div><div style="font-family:arial,sans-serif;font-size:13.333333015441895px">
  2) More mappings per section we're disassembling</div><div style="font-family:arial,sans-serif;font-size:13.333333015441895px"><br></div><div style="font-family:arial,sans-serif;font-size:13.333333015441895px">I'm likely to go with #2 rather than #1, but I'm open to any rationale either direction.</div>
<div style="font-family:arial,sans-serif;font-size:13.333333015441895px"><br></div><div style="font-family:arial,sans-serif;font-size:13.333333015441895px">b) Symbol relocations for function sections and/or functions as well as hooking it into, e.g. the aranges disassembly.</div>
<div style="font-family:arial,sans-serif;font-size:13.333333015441895px"><br></div><div style="font-family:arial,sans-serif;font-size:13.333333015441895px">I've got plans to add these things as I go along, but since it was now pretty usable for testing/dumping I wanted to get it in and then incremental on top of it.</div>
<div style="font-family:arial,sans-serif;font-size:13.333333015441895px"><br></div><div style="font-family:arial,sans-serif;font-size:13.333333015441895px">Thoughts?</div><div style="font-family:arial,sans-serif;font-size:13.333333015441895px">
<br></div><div style="font-family:arial,sans-serif;font-size:13.333333015441895px">-eric</div>