llvm.org GIT mirror llvm / 737de9d
[mips] Emit all three relocation operations for each relocation entry on Mips64 big-endian systems. Summary: The N64 ABI allows up to three operations to be specified per relocation record independently of the endianness. Reviewers: dsanders Reviewed By: dsanders Differential Revision: http://reviews.llvm.org/D3529 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207636 91177308-0d34-0410-b5e6-96231b3b80d8 Matheus Almeida 6 years ago
3 changed file(s) with 16 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
315315 getRelocationSymbol(const Elf_Shdr *RelSec, const RelT *Rel) const;
316316
317317 ELFFile(MemoryBuffer *Object, error_code &ec);
318
319 bool isMipsELF64() const {
320 return Header->e_machine == ELF::EM_MIPS &&
321 Header->getFileClass() == ELF::ELFCLASS64;
322 }
318323
319324 bool isMips64EL() const {
320325 return Header->e_machine == ELF::EM_MIPS &&
536541 template
537542 void ELFFile::getRelocationTypeName(uint32_t Type,
538543 SmallVectorImpl &Result) const {
539 if (!isMips64EL()) {
544 if (!isMipsELF64()) {
540545 StringRef Name = getRelocationTypeName(Type);
541546 Result.append(Name.begin(), Name.end());
542547 } else {
548 // The Mips N64 ABI allows up to three operations to be specified per
549 // relocation record. Unfortunately there's no easy way to test for the
550 // presence of N64 ELFs as they have no special flag that identifies them
551 // as being N64. We can safely assume at the moment that all Mips
552 // ELFCLASS64 ELFs are N64. New Mips64 ABIs should provide enough
553 // information to disambiguate between old vs new ABIs.
543554 uint8_t Type1 = (Type >> 0) & 0xFF;
544555 uint8_t Type2 = (Type >> 8) & 0xFF;
545556 uint8_t Type3 = (Type >> 16) & 0xFF;
0 // RUN: llvm-mc -filetype=obj -triple=mips64el-pc-linux -mcpu=mips64 %s -o - | llvm-readobj -r | FileCheck %s
1 // RUN: llvm-mc -filetype=obj -triple=mips64-pc-linux -mcpu=mips64 %s -o - | llvm-readobj -r | FileCheck %s
12
23 // Check for N64 relocation production.
34 // Check that the appropriate relocations were created.
0 // RUN: llvm-mc -filetype=obj -triple=mips64el-pc-linux -mcpu=mips64 %s -o - \
1 // RUN: | llvm-readobj -r \
2 // RUN: | FileCheck %s
3 // RUN: llvm-mc -filetype=obj -triple=mips64-pc-linux -mcpu=mips64 %s -o - \
14 // RUN: | llvm-readobj -r \
25 // RUN: | FileCheck %s
36