LLVM API Documentation

PPCRelocations.h

Go to the documentation of this file.
00001 //===- PPCRelocations.h - PPC32 Code Relocations ----------------*- C++ -*-===//
00002 //
00003 //                     The LLVM Compiler Infrastructure
00004 //
00005 // This file was developed by the LLVM research group and is distributed under
00006 // the University of Illinois Open Source License. See LICENSE.TXT for details.
00007 //
00008 //===----------------------------------------------------------------------===//
00009 //
00010 // This file defines the PowerPC 32-bit target-specific relocation types.
00011 //
00012 //===----------------------------------------------------------------------===//
00013 
00014 #ifndef PPC32RELOCATIONS_H
00015 #define PPC32RELOCATIONS_H
00016 
00017 #include "llvm/CodeGen/MachineRelocation.h"
00018 
00019 // Hack to rid us of a PPC pre-processor symbol which is erroneously
00020 // defined in a PowerPC header file (bug in Linux/PPC)
00021 #ifdef PPC
00022 #undef PPC
00023 #endif
00024 
00025 namespace llvm {
00026   namespace PPC {
00027     enum RelocationType {
00028       // reloc_pcrel_bx - PC relative relocation, for the b or bl instructions.
00029       reloc_pcrel_bx,
00030 
00031       // reloc_absolute_high - Absolute relocation, for the loadhi instruction
00032       // (which is really addis).  Add the high 16-bits of the specified global
00033       // address into the low 16-bits of the instruction.
00034       reloc_absolute_high,
00035 
00036       // reloc_absolute_low - Absolute relocation, for the la instruction (which
00037       // is really an addi).  Add the low 16-bits of the specified global
00038       // address into the low 16-bits of the instruction.
00039       reloc_absolute_low,
00040       
00041       // reloc_absolute_low_ix - Absolute relocation for the 64-bit load/store
00042       // instruction which have two implicit zero bits.
00043       reloc_absolute_low_ix,
00044 
00045       // reloc_absolute_ptr_high - Absolute relocation for references to lazy
00046       // pointer stubs.  In this case, the relocated instruction should be
00047       // relocated to point to a POINTER to the indicated global.  The low-16
00048       // bits of the instruction are rewritten with the high 16-bits of the
00049       // address of the pointer.
00050       reloc_absolute_ptr_high,
00051 
00052       // reloc_absolute_ptr_low - Absolute relocation for references to lazy
00053       // pointer stubs.  In this case, the relocated instruction should be
00054       // relocated to point to a POINTER to the indicated global.  The low-16
00055       // bits of the instruction are rewritten with the low 16-bits of the
00056       // address of the pointer.
00057       reloc_absolute_ptr_low
00058     };
00059   }
00060 }
00061 
00062 #endif