llvm.org GIT mirror llvm / 994754f
Object/RelocVisitor: Add minimal support, R_PPC64_ADDR32, for ppc64. It fixes llvm-dwarfdump for ppc64-elf. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173566 91177308-0d34-0410-b5e6-96231b3b80d8 NAKAMURA Takumi 7 years ago
1 changed file(s) with 16 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
7575 HasError = true;
7676 return RelocToApply();
7777 }
78 } else if (FileFormat == "ELF64-ppc64") {
79 switch (RelocType) {
80 case llvm::ELF::R_PPC64_ADDR32:
81 return visitELF_PPC64_ADDR32(R, Value);
82 default:
83 HasError = true;
84 return RelocToApply();
85 }
7886 }
7987 HasError = true;
8088 return RelocToApply();
139147 int32_t Res = (Value + Addend) & 0xFFFFFFFF;
140148 return RelocToApply(Res, 4);
141149 }
150
151 /// PPC64 ELF
152 RelocToApply visitELF_PPC64_ADDR32(RelocationRef R, uint64_t Value) {
153 int64_t Addend;
154 R.getAdditionalInfo(Addend);
155 uint32_t Res = (Value + Addend) & 0xFFFFFFFF;
156 return RelocToApply(Res, 4);
157 }
142158 };
143159
144160 }