[LLVMdev] [PATCH] basic reading reloc visitor for x86_64 ELF

Michael Spencer bigcheesegs at gmail.com
Tue Nov 6 00:00:51 PST 2012


On Mon, Nov 5, 2012 at 5:17 PM, Eric Christopher <echristo at gmail.com> wrote:
> 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.
>
> 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.
>
> Couple of areas that will need to be improved later:
>
> 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
>   1) A better mapping that contains section + address (since the debug
> sections are mapped at address 0 I can't just use total offset)
>   2) More mappings per section we're disassembling
>
> I'm likely to go with #2 rather than #1, but I'm open to any rationale
> either direction.
>
> b) Symbol relocations for function sections and/or functions as well as
> hooking it into, e.g. the aranges disassembly.
>
> 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.
>
> Thoughts?
>
> -eric
>
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>

This seems to be missing RelocVisitor.h

- Michael Spencer



More information about the llvm-dev mailing list