llvm-6502/include/llvm/MC
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
..
MCParser Make member variables of AsmToken private. Remove unnecessary forward declarations. Remove an unnecessary include. 2012-04-15 22:00:22 +00:00
EDInstInfo.h Tidy up. Trailing whitespace. 2012-05-11 01:39:13 +00:00
MachineLocation.h Tidy up. Trailing whitespace. 2012-05-11 01:39:13 +00:00
MCAsmBackend.h Prune some includes and forward declarations. 2012-03-26 06:58:25 +00:00
MCAsmInfo.h Remove another duplicated variable. We only need one to tell us if the linker 2012-06-22 13:32:49 +00:00
MCAsmInfoCOFF.h Unweaken vtables as per http://llvm.org/docs/CodingStandards.html#ll_virtual_anch 2011-12-20 02:50:00 +00:00
MCAsmInfoDarwin.h Unweaken vtables as per http://llvm.org/docs/CodingStandards.html#ll_virtual_anch 2011-12-20 02:50:00 +00:00
MCAsmLayout.h Make headers standalone. 2011-11-14 17:45:03 +00:00
MCAssembler.h Refactor data-in-code annotations. 2012-05-18 19:12:01 +00:00
MCAtom.h MCAtom extending methods need to extend the range of the atom as well. 2011-10-10 18:09:38 +00:00
MCCodeEmitter.h Prune some includes and forward declarations. 2012-03-26 06:58:25 +00:00
MCCodeGenInfo.h Fix typo in comment. 2012-02-17 16:39:47 +00:00
MCContext.h Refactor data-in-code annotations. 2012-05-18 19:12:01 +00:00
MCDirectives.h Refactor data-in-code annotations. 2012-05-18 19:12:01 +00:00
MCDisassembler.h Tidy up. Trailing whitespace. 2012-05-11 01:39:13 +00:00
MCDwarf.h Prune some includes and forward declarations. 2012-03-26 06:58:25 +00:00
MCELFObjectWriter.h The ELF relocation record format is different for N64 2012-06-27 22:28:30 +00:00
MCELFSymbolFlags.h sets bit 0 of the function address of thumb function in .symtab 2011-05-16 16:17:21 +00:00
MCExpr.h Implement local-exec TLS on PowerPC. 2012-06-04 17:36:38 +00:00
MCFixup.h Convert assert(0) to llvm_unreachable 2012-02-05 22:14:15 +00:00
MCFixupKindInfo.h Tidy up. Trailing whitespace. 2012-05-11 01:39:13 +00:00
MCInst.h Add simple support for keeping MCFixup source information. 2012-01-26 23:20:11 +00:00
MCInstPrinter.h Move getOpcodeName from the various target InstPrinters into the superclass MCInstPrinter. 2012-04-02 08:32:38 +00:00
MCInstrAnalysis.h Use the correct predicate for determining if a branch is conditional or not. 2011-10-17 21:21:44 +00:00
MCInstrDesc.h Shrink and reorder some fields in MCOperandInfo to fit it in 8 bytes to reduce size of static tables. 2012-03-11 01:57:56 +00:00
MCInstrInfo.h Revert r152202: "Use uint16_t to store InstrNameIndices in MCInstrInfo." 2012-03-15 18:05:57 +00:00
MCInstrItineraries.h Revert r158679 - use case is unclear (and it increases the memory footprint). 2012-06-22 20:27:13 +00:00
MCLabel.h
MCMachObjectWriter.h Refactor data-in-code annotations. 2012-05-18 19:12:01 +00:00
MCMachOSymbolFlags.h MC/Mach-O/Thumb: Set the thumb bit in the symbol table. 2010-12-29 14:14:06 +00:00
MCModule.h Start stubbing out MCModule and MCAtom, which provide an API for accessing the rich disassembly of a complete object or executable. 2011-09-22 22:32:22 +00:00
MCObjectFileInfo.h Tidy up. Trailing whitespace. 2012-05-11 01:39:13 +00:00
MCObjectStreamer.h Better diagnostic for malformed .org assembly directive. 2012-01-27 00:37:08 +00:00
MCObjectWriter.h Prune some includes and forward declarations. 2012-03-26 06:58:25 +00:00
MCRegisterInfo.h Remove the old register list functions from MCRegisterInfo. 2012-06-01 23:28:34 +00:00
MCSection.h Prune some includes and forward declarations. 2012-03-26 06:58:25 +00:00
MCSectionCOFF.h Prune some includes and forward declarations. 2012-03-26 06:58:25 +00:00
MCSectionELF.h Prune some includes and forward declarations. 2012-03-26 06:58:25 +00:00
MCSectionMachO.h Prune some includes and forward declarations. 2012-03-26 06:58:25 +00:00
MCStreamer.h EmitZerofill should take a 64-bit size or else it's chopping off large zero-filled global. rdar://11729134 2012-06-22 20:14:46 +00:00
MCSubtargetInfo.h - Eliminate MCCodeEmitter's dependency on TargetMachine. It now uses MCInstrInfo 2011-07-11 03:57:24 +00:00
MCSymbol.h MCExpr: Add FindAssociatedSection, which attempts to mirror the 'as' semantics 2011-04-29 18:00:03 +00:00
MCTargetAsmLexer.h Tidy up. Trailing whitespace. 2012-05-11 01:39:13 +00:00
MCTargetAsmParser.h MCTargetAsmParser target match predicate support. 2011-08-15 23:03:29 +00:00
MCValue.h Remove unimplemented method. Fixes PR10658. 2011-08-16 13:53:50 +00:00
MCWin64EH.h Add a parameter to the Win64 EH section getters to get a section with a 2011-05-27 19:09:24 +00:00
MCWinCOFFObjectWriter.h Move x86 specific bits of the COFF writer to lib/Target/X86. 2011-12-24 02:14:02 +00:00
SectionKind.h
SubtargetFeature.h Tidy up. Trailing whitespace. 2012-05-11 01:39:13 +00:00