[lld] r224813 - [Mips] Use OR operation to set the microMIPS bit

Simon Atanasyan simon at atanasyan.com
Wed Dec 24 04:19:19 PST 2014


Author: atanasyan
Date: Wed Dec 24 06:19:18 2014
New Revision: 224813

URL: http://llvm.org/viewvc/llvm-project?rev=224813&view=rev
Log:
[Mips] Use OR operation to set the microMIPS bit

Modified:
    lld/trunk/lib/ReaderWriter/ELF/Mips/MipsDynamicTable.h
    lld/trunk/lib/ReaderWriter/ELF/Mips/MipsExecutableWriter.h

Modified: lld/trunk/lib/ReaderWriter/ELF/Mips/MipsDynamicTable.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/Mips/MipsDynamicTable.h?rev=224813&r1=224812&r2=224813&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/ELF/Mips/MipsDynamicTable.h (original)
+++ lld/trunk/lib/ReaderWriter/ELF/Mips/MipsDynamicTable.h Wed Dec 24 06:19:18 2014
@@ -97,7 +97,7 @@ protected:
     if (const auto *da = dyn_cast<DefinedAtom>(al->_atom))
       if (da->codeModel() == DefinedAtom::codeMipsMicro ||
           da->codeModel() == DefinedAtom::codeMipsMicroPIC)
-        return al->_virtualAddr + 1;
+        return al->_virtualAddr | 1;
     return al->_virtualAddr;
   }
 

Modified: lld/trunk/lib/ReaderWriter/ELF/Mips/MipsExecutableWriter.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/Mips/MipsExecutableWriter.h?rev=224813&r1=224812&r2=224813&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/ELF/Mips/MipsExecutableWriter.h (original)
+++ lld/trunk/lib/ReaderWriter/ELF/Mips/MipsExecutableWriter.h Wed Dec 24 06:19:18 2014
@@ -66,7 +66,7 @@ std::error_code MipsExecutableWriter<ELF
     if (ea->codeModel() == DefinedAtom::codeMipsMicro ||
         ea->codeModel() == DefinedAtom::codeMipsMicroPIC)
       // Adjust entry symbol value if this symbol is microMIPS encoded.
-      this->_elfHeader->e_entry(al->_virtualAddr + 1);
+      this->_elfHeader->e_entry(al->_virtualAddr | 1);
   }
 
   _writeHelper.setELFHeader(*this->_elfHeader);





More information about the llvm-commits mailing list