Expand relocation type field to 64 bits. MachO scattered relocations require 33...
authorOwen Anderson <resistor@mac.com>
Wed, 26 Oct 2011 17:08:49 +0000 (17:08 +0000)
committerOwen Anderson <resistor@mac.com>
Wed, 26 Oct 2011 17:08:49 +0000 (17:08 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@143032 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Object/COFF.h
include/llvm/Object/MachO.h
include/llvm/Object/ObjectFile.h
lib/Object/COFFObjectFile.cpp
lib/Object/ELFObjectFile.cpp
lib/Object/MachOObjectFile.cpp
tools/llvm-objdump/MachODump.cpp

index 1f577c74339d7a21917ca59feb5f6f84e5114b2b..71e342fc8bffe8e3c8f94ed2201b165aac3ecdb7 100644 (file)
@@ -138,7 +138,7 @@ protected:
   virtual error_code getRelocationSymbol(DataRefImpl Rel,
                                          SymbolRef &Res) const;
   virtual error_code getRelocationType(DataRefImpl Rel,
-                                       uint32_t &Res) const;
+                                       uint64_t &Res) const;
   virtual error_code getRelocationTypeName(DataRefImpl Rel,
                                            SmallVectorImpl<char> &Result) const;
   virtual error_code getRelocationAdditionalInfo(DataRefImpl Rel,
index dcf116e6c211b629b2a86c48d2c8c77e98f22eb4..fc2e10e042539c0776b2c7abc796122a046d848a 100644 (file)
@@ -81,7 +81,7 @@ protected:
   virtual error_code getRelocationSymbol(DataRefImpl Rel,
                                          SymbolRef &Res) const;
   virtual error_code getRelocationType(DataRefImpl Rel,
-                                       uint32_t &Res) const;
+                                       uint64_t &Res) const;
   virtual error_code getRelocationTypeName(DataRefImpl Rel,
                                            SmallVectorImpl<char> &Result) const;
   virtual error_code getRelocationAdditionalInfo(DataRefImpl Rel,
index 0c7a518305f4633f0112718afdfce8cf3be5a9bd..947e290c8cde166a864b9159ccc44de9b93f56e7 100644 (file)
@@ -99,7 +99,7 @@ public:
 
   error_code getAddress(uint64_t &Result) const;
   error_code getSymbol(SymbolRef &Result) const;
-  error_code getType(uint32_t &Result) const;
+  error_code getType(uint64_t &Result) const;
 
   /// @brief Indicates whether this relocation should hidden when listing
   /// relocations, usually because it is the trailing part of a multipart
@@ -284,7 +284,7 @@ protected:
   virtual error_code getRelocationSymbol(DataRefImpl Rel,
                                          SymbolRef &Res) const = 0;
   virtual error_code getRelocationType(DataRefImpl Rel,
-                                       uint32_t &Res) const = 0;
+                                       uint64_t &Res) const = 0;
   virtual error_code getRelocationTypeName(DataRefImpl Rel,
                                        SmallVectorImpl<char> &Result) const = 0;
   virtual error_code getRelocationAdditionalInfo(DataRefImpl Rel,
@@ -474,7 +474,7 @@ inline error_code RelocationRef::getSymbol(SymbolRef &Result) const {
   return OwningObject->getRelocationSymbol(RelocationPimpl, Result);
 }
 
-inline error_code RelocationRef::getType(uint32_t &Result) const {
+inline error_code RelocationRef::getType(uint64_t &Result) const {
   return OwningObject->getRelocationType(RelocationPimpl, Result);
 }
 
index a048cf50a587db18b86721adbcf90d98615253dd..f19836b718aa0037804a6968aa40a44f2a1352d6 100644 (file)
@@ -623,7 +623,7 @@ error_code COFFObjectFile::getRelocationSymbol(DataRefImpl Rel,
   return object_error::success;
 }
 error_code COFFObjectFile::getRelocationType(DataRefImpl Rel,
-                                             uint32_t &Res) const {
+                                             uint64_t &Res) const {
   const coff_relocation* R = toRel(Rel);
   Res = R->Type;
   return object_error::success;
index 97ba9167a533c536ea22f893179125cffeed6ce9..d1a43e7b958d56fde4e64c942853d196e3d362d7 100644 (file)
@@ -358,7 +358,7 @@ protected:
   virtual error_code getRelocationSymbol(DataRefImpl Rel,
                                          SymbolRef &Res) const;
   virtual error_code getRelocationType(DataRefImpl Rel,
-                                       uint32_t &Res) const;
+                                       uint64_t &Res) const;
   virtual error_code getRelocationTypeName(DataRefImpl Rel,
                                            SmallVectorImpl<char> &Result) const;
   virtual error_code getRelocationAdditionalInfo(DataRefImpl Rel,
@@ -923,7 +923,7 @@ error_code ELFObjectFile<target_endianness, is64Bits>
 template<support::endianness target_endianness, bool is64Bits>
 error_code ELFObjectFile<target_endianness, is64Bits>
                         ::getRelocationType(DataRefImpl Rel,
-                                            uint32_t &Result) const {
+                                            uint64_t &Result) const {
   const Elf_Shdr *sec = getSection(Rel.w.b);
   switch (sec->sh_type) {
     default :
index d973f430c4209db55894d9167cf12c34b15b24e4..9ed5445ddaa983d1746329f3c6187bc694efef45 100644 (file)
@@ -634,7 +634,7 @@ error_code MachOObjectFile::getRelocationSymbol(DataRefImpl Rel,
   return object_error::success;
 }
 error_code MachOObjectFile::getRelocationType(DataRefImpl Rel,
-                                              uint32_t &Res) const {
+                                              uint64_t &Res) const {
   InMemoryStruct<macho::RelocationEntry> RE;
   getRelocation(Rel, RE);
   Res = RE->Word1;
index c61ec4c11e215792d98e3745d9c9eb1cbf8e26f0..2420dd7a2b2d34a73080c8b268f9a9614ceaa7c3 100644 (file)
@@ -394,7 +394,7 @@ void llvm::DisassembleInputMachO(StringRef Filename) {
       Sections[SectIdx].getAddress(SectionAddress);
       RelocOffset -= SectionAddress;
 
-      uint32_t RelocInfo;
+      uint64_t RelocInfo;
       RI->getType(RelocInfo);
 
       Relocs.push_back(std::make_pair(RelocOffset, RelocInfo));