llvm-6502/lib/Target/Mips
Jack Carter 93ee286e8d The ELF relocation record format is different for N64
which many Mips 64 ABIs use than for O64 which many 
if not all other target ABIs use.

Most architectures have the following 64 bit relocation record format:

  typedef struct
  {
    Elf64_Addr   r_offset; /* Address of reference */
    Elf64_Xword  r_info;   /* Symbol index and type of relocation */
  } Elf64_Rel;

  typedef struct
  {
    Elf64_Addr    r_offset;
    Elf64_Xword   r_info;
    Elf64_Sxword  r_addend;
  } Elf64_Rela;

Whereas N64 has the following format:

  typedef struct
  {
    Elf64_Addr    r_offset;/* Address of reference */
    Elf64_Word  r_sym;     /* Symbol index */
    Elf64_Byte  r_ssym;    /* Special symbol */
    Elf64_Byte  r_type3;   /* Relocation type */
    Elf64_Byte  r_type2;   /* Relocation type */
    Elf64_Byte  r_type;    /* Relocation type */
  } Elf64_Rel;

  typedef struct
  {
    Elf64_Addr    r_offset;/* Address of reference */
    Elf64_Word  r_sym;     /* Symbol index */
    Elf64_Byte  r_ssym;    /* Special symbol */
    Elf64_Byte  r_type3;   /* Relocation type */
    Elf64_Byte  r_type2;   /* Relocation type */
    Elf64_Byte  r_type;    /* Relocation type */
    Elf64_Sxword  r_addend;
  } Elf64_Rela;

The structure is the same size, but the r_info data element 
is now 5 separate elements. Besides the content aspects, 
endian byte reordering will be different for the area with 
each element being endianized separately.

I treat this as generic and continue to pass r_type as 
an integer masking and unmasking the byte sized N64 
values for N64 mode. I've implemented this and it causes no 
affect on other current targets.

This passes make check.

Jack


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159299 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-27 22:28:30 +00:00
..
AsmParser Mips/AsmParser/CMakeLists.txt: Fix dependency. 2012-06-16 15:33:52 +00:00
Disassembler Revert r158846. 2012-06-20 21:19:39 +00:00
InstPrinter Fix typos found by http://github.com/lyda/misspell-check 2012-06-02 10:20:22 +00:00
MCTargetDesc The ELF relocation record format is different for N64 2012-06-27 22:28:30 +00:00
TargetInfo remove Emacs-tag form .cpp files in Mips Backend, and fix some typo. 2012-02-17 08:55:11 +00:00
CMakeLists.txt llvm/lib: [CMake] Add explicit dependency to intrinsics_gen. 2012-06-24 13:32:01 +00:00
LLVMBuild.txt Add disassembler to MIPS. 2012-04-17 18:03:21 +00:00
Makefile Add disassembler to MIPS. 2012-04-17 18:03:21 +00:00
Mips16InstrFormats.td Clean up trailing blanks in Mips16InstrFormats.td 2012-06-13 02:42:47 +00:00
Mips16InstrInfo.td 1. fix null program output after some other changes 2012-06-21 20:39:10 +00:00
Mips64InstrInfo.td 1. introduce MipsPat in place of Pat in order to exclude those from 2012-06-14 21:03:23 +00:00
Mips.h Add long branch expansion pass for MIPS. 2012-06-14 01:19:35 +00:00
Mips.td This patch adds the register class for MIPS16 as well as the ability for 2012-05-16 22:19:56 +00:00
MipsAnalyzeImmediate.cpp Fix undefined behavior in the Mips backend. 2012-03-09 06:36:45 +00:00
MipsAnalyzeImmediate.h Fix undefined behavior in the Mips backend. 2012-03-09 06:36:45 +00:00
MipsAsmPrinter.cpp The inline asm operand modifier 'c' is suppose 2012-06-21 17:14:46 +00:00
MipsAsmPrinter.h Emit all directives except for ".cprestore" during asm printing rather than emit 2012-03-28 00:22:50 +00:00
MipsCallingConv.td Implement fastcc calling convention for MIPS. 2012-06-13 18:06:00 +00:00
MipsCodeEmitter.cpp Use MachineBasicBlock::instr_iterator instead of MachineBasicBlock::iterator in 2012-06-19 03:39:45 +00:00
MipsCondMov.td 1. introduce MipsPat in place of Pat in order to exclude those from 2012-06-14 21:03:23 +00:00
MipsDelaySlotFiller.cpp Fix coding style violations. Remove white spaces and tabs. 2012-06-14 21:10:56 +00:00
MipsFrameLowering.cpp Fix bug in computation of stack size in MipsFrameLowering.cpp. 2012-06-27 00:20:39 +00:00
MipsFrameLowering.h remove blanks, and some code format 2012-02-28 07:46:26 +00:00
MipsInstrFormats.td This patch adds a predicate to existing mips32 and mips64 so that those 2012-05-22 03:10:09 +00:00
MipsInstrFPU.td 1. introduce MipsPat in place of Pat in order to exclude those from 2012-06-14 21:03:23 +00:00
MipsInstrInfo.cpp Fix coding style violations. Remove white spaces and tabs. 2012-06-14 21:10:56 +00:00
MipsInstrInfo.h Define function MipsInstrInfo::GetInstSizeInBytes, which will be called to 2012-06-14 01:16:45 +00:00
MipsInstrInfo.td 1. introduce MipsPat in place of Pat in order to exclude those from 2012-06-14 21:03:23 +00:00
MipsISelDAGToDAG.cpp Silence uninitialized variable warning in MipsISelDAGToDAG.cpp. 2012-06-27 00:49:46 +00:00
MipsISelLowering.cpp Fix coding style violations. Remove white spaces and tabs. 2012-06-14 21:10:56 +00:00
MipsISelLowering.h Fix coding style violations. Remove white spaces and tabs. 2012-06-14 21:10:56 +00:00
MipsJITInfo.cpp Fix coding style violations. Remove white spaces and tabs. 2012-06-14 21:10:56 +00:00
MipsJITInfo.h Fix coding style violations. Remove white spaces and tabs. 2012-06-14 21:10:56 +00:00
MipsLongBranch.cpp Make MipsLongBranch::runOnMachineFunction return true. 2012-06-19 03:45:29 +00:00
MipsMachineFunction.cpp Delete all functions that are no longer needed in MipsFunctionInfo, including 2012-05-12 03:22:13 +00:00
MipsMachineFunction.h Add methods to MipsFunctionInfo for initializing and accessing the stack frame 2012-06-14 01:15:36 +00:00
MipsMCInstLower.cpp Fix coding style violations. Remove white spaces and tabs. 2012-06-14 21:10:56 +00:00
MipsMCInstLower.h Fix coding style violations. Remove white spaces and tabs. 2012-06-14 21:10:56 +00:00
MipsRegisterInfo.cpp Fix coding style violations. Remove white spaces and tabs. 2012-06-14 21:10:56 +00:00
MipsRegisterInfo.h Fix coding style violations. Remove white spaces and tabs. 2012-06-14 21:10:56 +00:00
MipsRegisterInfo.td Revert r158846. 2012-06-20 21:19:39 +00:00
MipsRelocations.h remove blanks, and some code format 2012-02-28 07:46:26 +00:00
MipsSchedule.td remove blanks, and some code format 2012-02-28 07:46:26 +00:00
MipsSelectionDAGInfo.cpp remove Emacs-tag form .cpp files in Mips Backend, and fix some typo. 2012-02-17 08:55:11 +00:00
MipsSelectionDAGInfo.h Reverse unnecessary changes made in r129606 and r129608. There is no change in functionality. 2011-04-15 21:51:11 +00:00
MipsSubtarget.cpp Fix coding style violations. Remove white spaces and tabs. 2012-06-14 21:10:56 +00:00
MipsSubtarget.h This patch adds a predicate to existing mips32 and mips64 so that those 2012-05-22 03:10:09 +00:00
MipsTargetMachine.cpp Add long branch expansion pass for MIPS. 2012-06-14 01:19:35 +00:00
MipsTargetMachine.h Fix coding style violations. Remove white spaces and tabs. 2012-06-14 21:10:56 +00:00
MipsTargetObjectFile.cpp remove Emacs-tag form .cpp files in Mips Backend, and fix some typo. 2012-02-17 08:55:11 +00:00
MipsTargetObjectFile.h Reverse unnecessary changes made in r129606 and r129608. There is no change in functionality. 2011-04-15 21:51:11 +00:00