[PATCH] lld part of the mips64 little endian patch

Rafael Ávila de Espíndola rafael.espindola at gmail.com
Tue Apr 2 17:18:50 PDT 2013


rafael added you to the CC list for the revision "lld part of the mips64 little endian patch".

Hi Bigcheese,

http://llvm-reviews.chandlerc.com/D616

Files:
  lib/ReaderWriter/ELF/Atoms.h
  lib/ReaderWriter/ELF/File.h

Index: lib/ReaderWriter/ELF/Atoms.h
===================================================================
--- lib/ReaderWriter/ELF/Atoms.h
+++ lib/ReaderWriter/ELF/Atoms.h
@@ -33,16 +33,18 @@
   typedef llvm::object::Elf_Rel_Impl<ELFT, true> Elf_Rela;
 public:
 
-  ELFReference(const Elf_Rela *rela, uint64_t offset, const Atom *target)
-      : _target(target), _targetSymbolIndex(rela->getSymbol()),
+  ELFReference(const Elf_Rela *rela, uint64_t offset, const Atom *target,
+               bool isMips)
+      : _target(target), _targetSymbolIndex(rela->getSymbol(isMips)),
         _offsetInAtom(offset), _addend(rela->r_addend) {
-    _kind = (Kind) rela->getType();
+    _kind = (Kind) rela->getType(isMips);
   }
 
-  ELFReference(const Elf_Rel *rel, uint64_t offset, const Atom *target)
-      : _target(target), _targetSymbolIndex(rel->getSymbol()),
+  ELFReference(const Elf_Rel *rel, uint64_t offset, const Atom *target,
+               bool isMips)
+      : _target(target), _targetSymbolIndex(rel->getSymbol(isMips)),
         _offsetInAtom(offset), _addend(0) {
-    _kind = (Kind) rel->getType();
+    _kind = (Kind) rel->getType(isMips);
   }
 
   ELFReference(Kind kind)
Index: lib/ReaderWriter/ELF/File.h
===================================================================
--- lib/ReaderWriter/ELF/File.h
+++ lib/ReaderWriter/ELF/File.h
@@ -577,7 +577,8 @@
               (rai.r_offset < symbol->st_value + content.size())))
           continue;
         auto *ERef = new (_readerStorage)
-            ELFReference<ELFT>(&rai, rai.r_offset - symbol->st_value, nullptr);
+           ELFReference<ELFT>(&rai, rai.r_offset - symbol->st_value, nullptr,
+                              _objFile->isMips64EL());
         _references.push_back(ERef);
       }
 
@@ -587,7 +588,8 @@
         if ((ri.r_offset >= symbol->st_value) &&
             (ri.r_offset < symbol->st_value + content.size())) {
           auto *ERef = new (_readerStorage)
-              ELFReference<ELFT>(&ri, ri.r_offset - symbol->st_value, nullptr);
+             ELFReference<ELFT>(&ri, ri.r_offset - symbol->st_value, nullptr,
+                                _objFile->isMips64EL());
           // Read the addend from the section contents
           // TODO : We should move the way lld reads relocations totally from
           // ELFObjectFile
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D616.1.patch
Type: text/x-patch
Size: 2333 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130402/5e7ad25c/attachment.bin>


More information about the llvm-commits mailing list