[lldb-dev] ELF 64

Eli Friedman eli.friedman at gmail.com
Tue Jul 6 16:12:08 PDT 2010


On Tue, Jul 6, 2010 at 3:42 PM, Stephen Wilson <steve.wilson at start.ca> wrote:
> Hi all,
>
> Attached is an initial implementation of a 64-bit ELF object file
> reader.  It is based on the existing 32-bit reader.
>
> This patch allows disassemble to work on x86_64 linux.  Support for
> dependent modules is included, though LLDB still needs to be taught how
> to resolve shared objects on linux (currently works only when the .so is
> in the working directory).
>
> Planed work includes renaming the existing 32 bit reader from
> ObjectFileELF to ObjectFileELF32, extend with features from the 64 bit
> version, and create a base class containing common functionality.
>
> Any feedback greatly appreciated!

One good first step would be to get rid of the local elf.h and start
using llvm/Support/ELF.h.

+        bool have_32bit = magic[EI_CLASS] == 1;

Magic "1" is bad; use ELFCLASS32 (which is in the LLVM ELF.h).

Can you make the diff for ObjectFileELF64.cpp on top of an "svn cp"?
It's difficult to review otherwise.

-Eli




More information about the lldb-dev mailing list