| 1 | /* |
| 2 | * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. |
| 3 | * |
| 4 | * @APPLE_LICENSE_HEADER_START@ |
| 5 | * |
| 6 | * This file contains Original Code and/or Modifications of Original Code |
| 7 | * as defined in and that are subject to the Apple Public Source License |
| 8 | * Version 2.0 (the 'License'). You may not use this file except in |
| 9 | * compliance with the License. Please obtain a copy of the License at |
| 10 | * http://www.opensource.apple.com/apsl/ and read it before using this |
| 11 | * file. |
| 12 | * |
| 13 | * The Original Code and all software distributed under the License are |
| 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER |
| 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, |
| 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, |
| 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. |
| 18 | * Please see the License for the specific language governing rights and |
| 19 | * limitations under the License. |
| 20 | * |
| 21 | * @APPLE_LICENSE_HEADER_END@ |
| 22 | */ |
| 23 | |
| 24 | #ifndef _MACHO_ARM_RELOC_H_ |
| 25 | #define _MACHO_ARM_RELOC_H_ |
| 26 | |
| 27 | /* |
| 28 | * Relocation types used in the arm implementation. Relocation entries for |
| 29 | * things other than instructions use the same generic relocation as discribed |
| 30 | * in <mach-o/reloc.h> and their r_type is ARM_RELOC_VANILLA, one of the |
| 31 | * *_SECTDIFF or the *_PB_LA_PTR types. The rest of the relocation types are |
| 32 | * for instructions. Since they are for instructions the r_address field |
| 33 | * indicates the 32 bit instruction that the relocation is to be preformed on. |
| 34 | */ |
| 35 | |
| 36 | enum reloc_type_arm |
| 37 | { |
| 38 | ARM_RELOC_VANILLA,	/* generic relocation as discribed above */ |
| 39 | ARM_RELOC_PAIR,	/* the second relocation entry of a pair */ |
| 40 | ARM_RELOC_SECTDIFF,	/* a PAIR follows with subtract symbol value */ |
| 41 | ARM_RELOC_LOCAL_SECTDIFF, /* like ARM_RELOC_SECTDIFF, but the symbol |
| 42 | 				 referenced was local. */ |
| 43 | ARM_RELOC_PB_LA_PTR,/* prebound lazy pointer */ |
| 44 | ARM_RELOC_BR24,	/* 24 bit branch displacement (to a word address) */ |
| 45 | ARM_THUMB_RELOC_BR22, /* 22 bit branch displacement (to a half-word |
| 46 | 			 address) */ |
| 47 | ARM_THUMB_32BIT_BRANCH, /* obsolete - a thumb 32-bit branch instruction |
| 48 | 			 possibly needing page-spanning branch workaround */ |
| 49 | |
| 50 | /* |
| 51 | * For these two r_type relocations they always have a pair following them |
| 52 | * and the r_length bits are used differently. The encoding of the |
| 53 | * r_length is as follows: |
| 54 | * low bit of r_length: |
| 55 | * 0 - :lower16: for movw instructions |
| 56 | * 1 - :upper16: for movt instructions |
| 57 | * high bit of r_length: |
| 58 | * 0 - arm instructions |
| 59 | * 1 - thumb instructions |
| 60 | * the other half of the relocated expression is in the following pair |
| 61 | * relocation entry in the the low 16 bits of r_address field. |
| 62 | */ |
| 63 | ARM_RELOC_HALF, |
| 64 | ARM_RELOC_HALF_SECTDIFF |
| 65 | }; |
| 66 | |
| 67 | #endif /* #ifndef _MACHO_ARM_RELOC_H_ */ |