[llvm-commits] PPC64 MCJIT support

Adhemerval Zanella azanella at linux.vnet.ibm.com
Tue Aug 14 11:07:49 PDT 2012


This patch adds preliminary MCJIT support for PPC64. Currently it handles
the generated relocations done in my previous patch, with constant symbol
values being handled correctly with the generated TOC.

Two things I'd like some sugestions:

+  } else if (Arch == Triple::ppc64) {
+    RelocationEntry RE(Rel.SectionID, Rel.Offset, RelType, Value.Addend);
+    if (Value.SymbolName && (SymType == SymbolRef::ST_Function))
+      addRelocationForSymbol(RE, Value.SymbolName);
+    else
+      addRelocationForSection(RE, Value.SectionID);

I had to add this code to avoid the relocation emission for .TOC. at tocbase
symbol (which is a ST_DEBUG in this case), but I presume it not the best
solution. I am checking if I can omit the symbol emission or add a better
logic to handle this.

Another snippet I'd like recommendation is this one:

--- lib/ExecutionEngine/RuntimeDyld/RuntimeDyldImpl.h	(revision 161879)
+++ lib/ExecutionEngine/RuntimeDyld/RuntimeDyldImpl.h	(working copy)
@@ -41,6 +41,9 @@
 /// linker.
 class SectionEntry {
 public:
+  /// Name - section name.
+  StringRef Name;
+
   /// Address - address in the linker's memory where the section resides.
   uint8_t *Address;

I had to add the Name field on the MCJIT sections because I can't find a better
way to identify the section (which is used to find the .TOC. one to be used
on the function descriptors).

Now I'm working on internal branches (R_PPC64_REL24) so internal function
call can be called.

-- 
Adhemerval Zanella Netto
  Software Engineer
  Linux Technology Center Brazil
  Toolchain / GLIBC on Power Architecture
  azanella at linux.vnet.ibm.com / azanella at br.ibm.com
  +55 61 8642-9890

-------------- next part --------------
A non-text attachment was scrubbed...
Name: llvm-ppc64-mcjit.patch
Type: text/x-patch
Size: 7716 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120814/d9d6e2f0/attachment.bin>


More information about the llvm-commits mailing list