diff options
author | Ed Schouten <ed@FreeBSD.org> | 2009-06-02 17:52:33 +0000 |
---|---|---|
committer | Ed Schouten <ed@FreeBSD.org> | 2009-06-02 17:52:33 +0000 |
commit | 009b1c42aa6266385f2c37e227516b24077e6dd7 (patch) | |
tree | 64ba909838c23261cace781ece27d106134ea451 /lib/Target/PowerPC/PPCMachOWriterInfo.h |
Diffstat (limited to 'lib/Target/PowerPC/PPCMachOWriterInfo.h')
-rw-r--r-- | lib/Target/PowerPC/PPCMachOWriterInfo.h | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/lib/Target/PowerPC/PPCMachOWriterInfo.h b/lib/Target/PowerPC/PPCMachOWriterInfo.h new file mode 100644 index 0000000000000..d46334df26028 --- /dev/null +++ b/lib/Target/PowerPC/PPCMachOWriterInfo.h @@ -0,0 +1,55 @@ +//===-- PPCMachOWriterInfo.h - Mach-O Writer Info for PowerPC ---*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file 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 + class MachineRelocation; + class OutputBuffer; + class PPCTargetMachine; + + class PPCMachOWriterInfo : public TargetMachOWriterInfo { + public: + PPCMachOWriterInfo(const PPCTargetMachine &TM); + virtual ~PPCMachOWriterInfo(); + + virtual unsigned GetTargetRelocation(MachineRelocation &MR, + unsigned FromIdx, + unsigned ToAddr, + unsigned ToIdx, + OutputBuffer &RelocOut, + OutputBuffer &SecOut, + bool Scattered, bool Extern) const; + + // 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 + }; + }; + +} // end llvm namespace + +#endif // PPC_MACHO_WRITER_INFO_H |