[llvm-commits] [llvm] r173566 - Object/RelocVisitor: Add minimal support, R_PPC64_ADDR32, for ppc64.
NAKAMURA Takumi
geek4civic at gmail.com
Sat Jan 26 00:27:30 PST 2013
Author: chapuni
Date: Sat Jan 26 02:27:29 2013
New Revision: 173566
URL: http://llvm.org/viewvc/llvm-project?rev=173566&view=rev
Log:
Object/RelocVisitor: Add minimal support, R_PPC64_ADDR32, for ppc64.
It fixes llvm-dwarfdump for ppc64-elf.
Modified:
llvm/trunk/include/llvm/Object/RelocVisitor.h
Modified: llvm/trunk/include/llvm/Object/RelocVisitor.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Object/RelocVisitor.h?rev=173566&r1=173565&r2=173566&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Object/RelocVisitor.h (original)
+++ llvm/trunk/include/llvm/Object/RelocVisitor.h Sat Jan 26 02:27:29 2013
@@ -76,6 +76,14 @@ public:
HasError = true;
return RelocToApply();
}
+ } else if (FileFormat == "ELF64-ppc64") {
+ switch (RelocType) {
+ case llvm::ELF::R_PPC64_ADDR32:
+ return visitELF_PPC64_ADDR32(R, Value);
+ default:
+ HasError = true;
+ return RelocToApply();
+ }
}
HasError = true;
return RelocToApply();
@@ -140,6 +148,14 @@ private:
int32_t Res = (Value + Addend) & 0xFFFFFFFF;
return RelocToApply(Res, 4);
}
+
+ /// PPC64 ELF
+ RelocToApply visitELF_PPC64_ADDR32(RelocationRef R, uint64_t Value) {
+ int64_t Addend;
+ R.getAdditionalInfo(Addend);
+ uint32_t Res = (Value + Addend) & 0xFFFFFFFF;
+ return RelocToApply(Res, 4);
+ }
};
}
More information about the llvm-commits
mailing list