[llvm-commits] [PATCH] basic reading reloc visitor for x86_64 ELF

Eli Bendersky eliben at google.com
Tue Nov 6 05:11:56 PST 2012


> 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.
>

A slightly expanded version of this will make for a great comment in
the code :-) Seriously, please document the purpose of the new
relocMap data structure you're adding.

> 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.
>

I'm not sure I understood #2 - can you elaborate?

> 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.

Do you have any tests for this?

Eli



More information about the llvm-commits mailing list