Jia Liu | 31d157a | 2012-02-18 12:03:15 +0000 | [diff] [blame] | 1 | //===-- X86Relocations.h - X86 Code Relocations -----------------*- C++ -*-===// |
Misha Brukman | 0e0a7a45 | 2005-04-21 23:38:14 +0000 | [diff] [blame] | 2 | // |
Chris Lattner | 8dad013 | 2004-11-20 23:54:19 +0000 | [diff] [blame] | 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
Chris Lattner | 4ee451d | 2007-12-29 20:36:04 +0000 | [diff] [blame] | 5 | // This file is distributed under the University of Illinois Open Source |
| 6 | // License. See LICENSE.TXT for details. |
Misha Brukman | 0e0a7a45 | 2005-04-21 23:38:14 +0000 | [diff] [blame] | 7 | // |
Chris Lattner | 8dad013 | 2004-11-20 23:54:19 +0000 | [diff] [blame] | 8 | //===----------------------------------------------------------------------===// |
| 9 | // |
| 10 | // This file defines the X86 target-specific relocation types. |
| 11 | // |
| 12 | //===----------------------------------------------------------------------===// |
| 13 | |
| 14 | #ifndef X86RELOCATIONS_H |
| 15 | #define X86RELOCATIONS_H |
| 16 | |
| 17 | #include "llvm/CodeGen/MachineRelocation.h" |
| 18 | |
| 19 | namespace llvm { |
| 20 | namespace X86 { |
Dan Gohman | c9f3cc3 | 2008-10-24 01:57:54 +0000 | [diff] [blame] | 21 | /// RelocationType - An enum for the x86 relocation codes. Note that |
| 22 | /// the terminology here doesn't follow x86 convention - word means |
Bruno Cardoso Lopes | e55fef3 | 2009-08-05 00:11:21 +0000 | [diff] [blame] | 23 | /// 32-bit and dword means 64-bit. The relocations will be treated |
| 24 | /// by JIT or ObjectCode emitters, this is transparent to the x86 code |
| 25 | /// emitter but JIT and ObjectCode will treat them differently |
Chris Lattner | 8dad013 | 2004-11-20 23:54:19 +0000 | [diff] [blame] | 26 | enum RelocationType { |
Chris Lattner | 38c3363 | 2009-07-22 16:53:56 +0000 | [diff] [blame] | 27 | /// reloc_pcrel_word - PC relative relocation, add the relocated value to |
| 28 | /// the value already in memory, after we adjust it for where the PC is. |
Chris Lattner | 8dad013 | 2004-11-20 23:54:19 +0000 | [diff] [blame] | 29 | reloc_pcrel_word = 0, |
| 30 | |
Chris Lattner | 38c3363 | 2009-07-22 16:53:56 +0000 | [diff] [blame] | 31 | /// reloc_picrel_word - PIC base relative relocation, add the relocated |
| 32 | /// value to the value already in memory, after we adjust it for where the |
| 33 | /// PIC base is. |
Evan Cheng | aabe38b | 2007-12-22 09:40:20 +0000 | [diff] [blame] | 34 | reloc_picrel_word = 1, |
Bruno Cardoso Lopes | e55fef3 | 2009-08-05 00:11:21 +0000 | [diff] [blame] | 35 | |
| 36 | /// reloc_absolute_word - absolute relocation, just add the relocated |
| 37 | /// value to the value already in memory. |
Evan Cheng | aabe38b | 2007-12-22 09:40:20 +0000 | [diff] [blame] | 38 | reloc_absolute_word = 2, |
Bruno Cardoso Lopes | e55fef3 | 2009-08-05 00:11:21 +0000 | [diff] [blame] | 39 | |
| 40 | /// reloc_absolute_word_sext - absolute relocation, just add the relocated |
| 41 | /// value to the value already in memory. In object files, it represents a |
| 42 | /// value which must be sign-extended when resolving the relocation. |
| 43 | reloc_absolute_word_sext = 3, |
| 44 | |
| 45 | /// reloc_absolute_dword - absolute relocation, just add the relocated |
| 46 | /// value to the value already in memory. |
| 47 | reloc_absolute_dword = 4 |
Chris Lattner | 8dad013 | 2004-11-20 23:54:19 +0000 | [diff] [blame] | 48 | }; |
| 49 | } |
| 50 | } |
| 51 | |
| 52 | #endif |