2007-01-24 03:36:05 +00:00
|
|
|
//===-- PPCMachOWriterInfo.h - Mach-O Writer Info for PowerPC ---*- C++ -*-===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file was developed by Bill Wendling and is distributed under the
|
|
|
|
// University of Illinois Open Source License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
// This file implements Mach-O writer information for the PowerPC backend.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#ifndef PPC_MACHO_WRITER_INFO_H
|
|
|
|
#define PPC_MACHO_WRITER_INFO_H
|
|
|
|
|
|
|
|
#include "llvm/Target/TargetMachOWriterInfo.h"
|
|
|
|
|
|
|
|
namespace llvm {
|
|
|
|
|
|
|
|
// Forward declarations
|
2007-02-03 02:41:58 +00:00
|
|
|
class MachineRelocation;
|
|
|
|
class OutputBuffer;
|
2007-01-24 03:36:05 +00:00
|
|
|
class PPCTargetMachine;
|
|
|
|
|
2007-01-24 07:13:56 +00:00
|
|
|
class PPCMachOWriterInfo : public TargetMachOWriterInfo {
|
|
|
|
public:
|
2007-01-24 03:36:05 +00:00
|
|
|
PPCMachOWriterInfo(const PPCTargetMachine &TM);
|
2007-02-03 02:41:58 +00:00
|
|
|
virtual ~PPCMachOWriterInfo();
|
|
|
|
|
|
|
|
virtual unsigned GetTargetRelocation(MachineRelocation &MR,
|
|
|
|
unsigned FromIdx,
|
|
|
|
unsigned ToAddr,
|
|
|
|
unsigned ToIdx,
|
|
|
|
OutputBuffer &RelocOut,
|
|
|
|
OutputBuffer &SecOut,
|
2007-02-28 07:40:50 +00:00
|
|
|
bool Scattered, bool Extern) const;
|
2007-02-03 02:41:58 +00:00
|
|
|
|
|
|
|
// Constants for the relocation r_type field.
|
|
|
|
// See <mach-o/ppc/reloc.h>
|
|
|
|
enum {
|
|
|
|
PPC_RELOC_VANILLA, // generic relocation
|
|
|
|
PPC_RELOC_PAIR, // the second relocation entry of a pair
|
|
|
|
PPC_RELOC_BR14, // 14 bit branch displacement to word address
|
|
|
|
PPC_RELOC_BR24, // 24 bit branch displacement to word address
|
|
|
|
PPC_RELOC_HI16, // a PAIR follows with the low 16 bits
|
|
|
|
PPC_RELOC_LO16, // a PAIR follows with the high 16 bits
|
|
|
|
PPC_RELOC_HA16, // a PAIR follows, which is sign extended to 32b
|
|
|
|
PPC_RELOC_LO14 // LO16 with low 2 bits implicitly zero
|
|
|
|
};
|
2007-01-24 03:36:05 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
} // end llvm namespace
|
|
|
|
|
|
|
|
#endif // PPC_MACHO_WRITER_INFO_H
|