1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-24 21:42:54 +02:00
llvm-mirror/lib/Target/Mips/MCTargetDesc
Jack Carter dc0ebcb076 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

llvm-svn: 159299
2012-06-27 22:28:30 +00:00
..
CMakeLists.txt Move the Mips only bits of the ELF writer to lib/Target/Mips. 2011-12-22 03:03:17 +00:00
LLVMBuild.txt LLVMBuild: Remove trailing newline, which irked me. 2011-12-12 19:48:00 +00:00
Makefile Test commit 2012-06-09 00:27:55 +00:00
MipsAsmBackend.cpp Fix coding style violations. Remove white spaces and tabs. 2012-06-14 21:10:56 +00:00
MipsBaseInfo.h Define function MipsGetSymAndOffset which returns a fixup's symbol and the 2012-03-27 02:04:18 +00:00
MipsELFObjectWriter.cpp The ELF relocation record format is different for N64 2012-06-27 22:28:30 +00:00
MipsFixupKinds.h comment fix 2012-02-24 02:17:26 +00:00
MipsMCAsmInfo.cpp remove Emacs-tag form .cpp files in Mips Backend, and fix some typo. 2012-02-17 08:55:11 +00:00
MipsMCAsmInfo.h Prune some includes 2012-03-27 07:54:11 +00:00
MipsMCCodeEmitter.cpp Fix coding style violations. Remove white spaces and tabs. 2012-06-14 21:10:56 +00:00
MipsMCTargetDesc.cpp Add disassembler to MIPS. 2012-04-17 18:03:21 +00:00
MipsMCTargetDesc.h Allow MCCodeEmitter access to the target MCRegisterInfo. 2012-05-15 17:35:52 +00:00