[llvm-commits] [PATCH] ELFObjectFile with dynamic loading support

Xerxes Rånby xerxes at zafena.se
Mon Jan 9 11:33:08 PST 2012


2012-01-09 19:56, Xerxes Rånby skrev:
> 2012-01-09 16:15, Bendersky, Eli skrev:
>> Hello, Following the email I sent to LLVMdev earlier today (http://lists.cs.uiuc.edu/pipermail/llvmdev/2012-January/046671.html), please find attached the first patch in the MCJIT/ELF series. It presents a subclass of ELFObjectFile, named DyldELFObject, which supports basic dynamic loading. This class is used by MCJIT/ELF to load an ELF image generated by MC into memory and executing it.
>> 
>> Please note that there are no stand-alone tests for this class yet. It is being tested extensively in the ExecutionEngine tests run on MCJIT/ELF, which will be part of the next patch in the series, once this one is accepted and committed.
>> 
>> Thanks in advance,
>> 
>> Eli
> 
> Hi Eli!
> 
> Thank you and your team for working on MCJIT/ELF support!
> 

Clang on my system got picky while trying to resolve the getSymbolTableIndex when I compiled the patched ELFObjectFile.

llvm[2]: Compiling ELFObjectFile.cpp for Debug+Asserts build
/home/xranby/llvm/lib/Object/ELFObjectFile.cpp:1583:9: error: use of undeclared identifier 'getSymbolTableIndex'
        getSymbolTableIndex(symb) == ELF::SHN_COMMON && Size > 0) {
        ^
        this->
/home/xranby/llvm/lib/Object/ELFObjectFile.cpp:1636:20: note: in instantiation of member function '<anonymous
      namespace>::DyldELFObject<1, false>::rebaseObject' requested here
        return new DyldELFObject<support::little, false>(Object, MemoryMap, ec);
                   ^
/home/xranby/llvm/lib/Object/ELFObjectFile.cpp:388:19: note: must qualify identifier to find this declaration in dependent base class
  ELF::Elf64_Word getSymbolTableIndex(const Elf_Sym *symb) const;
                  ^
/home/xranby/llvm/lib/Object/ELFObjectFile.cpp:1619:7: error: use of undeclared identifier 'getSymbolTableIndex'
  if (getSymbolTableIndex(symb) == ELF::SHN_COMMON) {
      ^
      this->
/home/xranby/llvm/lib/Object/ELFObjectFile.cpp:1636:20: note: in instantiation of member function '<anonymous
      namespace>::DyldELFObject<1, false>::getSymbolAddress' requested here
        return new DyldELFObject<support::little, false>(Object, MemoryMap, ec);
                   ^
/home/xranby/llvm/lib/Object/ELFObjectFile.cpp:388:19: note: must qualify identifier to find this declaration in dependent base class
  ELF::Elf64_Word getSymbolTableIndex(const Elf_Sym *symb) const;
                  ^
/home/xranby/llvm/lib/Object/ELFObjectFile.cpp:1583:9: error: no member named 'getSymbolTableIndex' in
      '<anonymous>::DyldELFObject<0, false>'
        getSymbolTableIndex(symb) == ELF::SHN_COMMON && Size > 0) {
        ^~~~~~~~~~~~~~~~~~~

tested using
clang version 2.9 (tags/RELEASE_29/final)
Target: i386-pc-linux-gnu
Thread model: posix

I will re test using clang 3.0.

Cheers
Xerxes



More information about the llvm-commits mailing list