New file.
[deliverable/binutils-gdb.git] / include / coff / internal.h
1 /* Internal format of COFF object file data structures, for GNU BFD.
2 This file is part of BFD, the Binary File Descriptor library. */
3
4 /* First, make "signed char" work, even on old compilers. */
5 #ifndef signed
6 #ifndef __STDC__
7 #define signed /**/
8 #endif
9 #endif
10
11 /********************** FILE HEADER **********************/
12
13 struct internal_filehdr
14 {
15 /* DOS header data follows for PE stuff */
16 unsigned short e_magic; /* Magic number, 0x5a4d */
17 unsigned short e_cblp; /* Bytes on last page of file, 0x90 */
18 unsigned short e_cp; /* Pages in file, 0x3 */
19 unsigned short e_crlc; /* Relocations, 0x0 */
20 unsigned short e_cparhdr; /* Size of header in paragraphs, 0x4 */
21 unsigned short e_minalloc; /* Minimum extra paragraphs needed, 0x0 */
22 unsigned short e_maxalloc; /* Maximum extra paragraphs needed, 0xFFFF */
23 unsigned short e_ss; /* Initial (relative) SS value, 0x0 */
24 unsigned short e_sp; /* Initial SP value, 0xb8 */
25 unsigned short e_csum; /* Checksum, 0x0 */
26 unsigned short e_ip; /* Initial IP value, 0x0 */
27 unsigned short e_cs; /* Initial (relative) CS value, 0x0 */
28 unsigned short e_lfarlc; /* File address of relocation table, 0x40 */
29 unsigned short e_ovno; /* Overlay number, 0x0 */
30 unsigned short e_res[4]; /* Reserved words, all 0x0 */
31 unsigned short e_oemid; /* OEM identifier (for e_oeminfo), 0x0 */
32 unsigned short e_oeminfo; /* OEM information; e_oemid specific, 0x0 */
33 unsigned short e_res2[10]; /* Reserved words, all 0x0 */
34 bfd_vma e_lfanew; /* File address of new exe header, 0x80 */
35 unsigned long dos_message[16]; /* text which always follows dos header */
36 bfd_vma nt_signature; /* required NT signature, 0x4550 */
37
38
39 /* standard coff internal info */
40 unsigned short f_magic; /* magic number */
41 unsigned short f_nscns; /* number of sections */
42 long f_timdat; /* time & date stamp */
43 bfd_vma f_symptr; /* file pointer to symtab */
44 long f_nsyms; /* number of symtab entries */
45 unsigned short f_opthdr; /* sizeof(optional hdr) */
46 unsigned short f_flags; /* flags */
47 };
48
49
50 /* Bits for f_flags:
51 * F_RELFLG relocation info stripped from file
52 * F_EXEC file is executable (no unresolved external references)
53 * F_LNNO line numbers stripped from file
54 * F_LSYMS local symbols stripped from file
55 * F_AR16WR file is 16-bit little-endian
56 * F_AR32WR file is 32-bit little-endian
57 * F_AR32W file is 32-bit big-endian
58 * F_DYNLOAD rs/6000 aix: dynamically loadable w/imports & exports
59 * F_SHROBJ rs/6000 aix: file is a shared object
60 */
61
62 #define F_RELFLG (0x0001)
63 #define F_EXEC (0x0002)
64 #define F_LNNO (0x0004)
65 #define F_LSYMS (0x0008)
66 #define F_AR16WR (0x0080)
67 #define F_AR32WR (0x0100)
68 #define F_AR32W (0x0200)
69 #define F_DYNLOAD (0x1000)
70 #define F_SHROBJ (0x2000)
71
72 /* extra structure which is used in the optional header */
73 typedef struct _IMAGE_DATA_DIRECTORY
74 {
75 bfd_vma VirtualAddress;
76 long Size;
77 } IMAGE_DATA_DIRECTORY;
78 #define IMAGE_NUMBEROF_DIRECTORY_ENTRIES 16
79
80 /* default image base for NT */
81 #define NT_IMAGE_BASE 0x400000
82
83
84 /********************** AOUT "OPTIONAL HEADER" **********************/
85 struct internal_aouthdr
86 {
87 short magic; /* type of file */
88 short vstamp; /* version stamp */
89 bfd_vma tsize; /* text size in bytes, padded to FW bdry*/
90 bfd_vma dsize; /* initialized data " " */
91 bfd_vma bsize; /* uninitialized data " " */
92 bfd_vma entry; /* entry pt. */
93 bfd_vma text_start; /* base of text used for this file */
94 bfd_vma data_start; /* base of data used for this file */
95
96 /* i960 stuff */
97 unsigned long tagentries; /* number of tag entries to follow */
98
99 /* RS/6000 stuff */
100 unsigned long o_toc; /* address of TOC */
101 short o_snentry; /* section number for entry point */
102 short o_sntext; /* section number for text */
103 short o_sndata; /* section number for data */
104 short o_sntoc; /* section number for toc */
105 short o_snloader; /* section number for loader section */
106 short o_snbss; /* section number for bss */
107 short o_algntext; /* max alignment for text */
108 short o_algndata; /* max alignment for data */
109 short o_modtype; /* Module type field, 1R,RE,RO */
110 unsigned long o_maxstack; /* max stack size allowed. */
111
112 /* ECOFF stuff */
113 bfd_vma bss_start; /* Base of bss section. */
114 bfd_vma gp_value; /* GP register value. */
115 unsigned long gprmask; /* General registers used. */
116 unsigned long cprmask[4]; /* Coprocessor registers used. */
117 unsigned long fprmask; /* Floating pointer registers used. */
118
119 /* Apollo stuff */
120 long o_inlib; /* inlib data */
121 long o_sri; /* Static Resource Information */
122 long vid[2]; /* Version id */
123
124
125 /* PE stuff */
126 bfd_vma ImageBase; /* address of specific location in memory that
127 file is located, NT default 0x10000 */
128 bfd_vma SectionAlignment; /* section alignment default 0x1000 */
129 bfd_vma FileAlignment; /* file alignment default 0x200 */
130 short MajorOperatingSystemVersion; /* minimum version of the operating */
131 short MinorOperatingSystemVersion; /* system req'd for exe, default to 1*/
132 short MajorImageVersion; /* user defineable field to store version of */
133 short MinorImageVersion; /* exe or dll being created, default to 0 */
134 short MajorSubsystemVersion; /* minimum subsystem version required to */
135 short MinorSubsystemVersion; /* run exe; default to 3.1 */
136 long Reserved1; /* seems to be 0 */
137 long SizeOfImage; /* size of region from image base to end last section */
138 long SizeOfHeaders; /* size of PE header and section table */
139 long CheckSum; /* set to 0 */
140 short Subsystem; /* type of subsystem exe uses for user interface,
141 possible values:
142 1 - NATIVE Doesn't require a subsystem
143 2 - WINDOWS_GUI runs in Windows GUI subsystem
144 3 - WINDOWS_CUI runs in Windows char sub. (console app)
145 5 - OS2_CUI runs in OS/2 character subsystem
146 7 - POSIX_CUI runs in Posix character subsystem */
147 short DllCharacteristics; /* flags for DLL init, use 0 */
148 bfd_vma SizeOfStackReserve; /* amount of memory to reserve, def. 0x100000 */
149 bfd_vma SizeOfStackCommit; /* amount of memory initially committed for
150 initial thread's stack, default is 0x1000 */
151 bfd_vma SizeOfHeapReserve; /* amount of virtual memory to reserve and */
152 bfd_vma SizeOfHeapCommit; /* commit, don't know what to defaut it to */
153 long LoaderFlags; /* can probably set to 0 */
154 long NumberOfRvaAndSizes; /* number of entries in next entry, 16 */
155 IMAGE_DATA_DIRECTORY DataDirectory[IMAGE_NUMBEROF_DIRECTORY_ENTRIES];
156
157
158 };
159
160
161 /********************** STORAGE CLASSES **********************/
162
163 /* This used to be defined as -1, but now n_sclass is unsigned. */
164 #define C_EFCN 0xff /* physical end of function */
165 #define C_NULL 0
166 #define C_AUTO 1 /* automatic variable */
167 #define C_EXT 2 /* external symbol */
168 #define C_STAT 3 /* static */
169 #define C_REG 4 /* register variable */
170 #define C_EXTDEF 5 /* external definition */
171 #define C_LABEL 6 /* label */
172 #define C_ULABEL 7 /* undefined label */
173 #define C_MOS 8 /* member of structure */
174 #define C_ARG 9 /* function argument */
175 #define C_STRTAG 10 /* structure tag */
176 #define C_MOU 11 /* member of union */
177 #define C_UNTAG 12 /* union tag */
178 #define C_TPDEF 13 /* type definition */
179 #define C_USTATIC 14 /* undefined static */
180 #define C_ENTAG 15 /* enumeration tag */
181 #define C_MOE 16 /* member of enumeration */
182 #define C_REGPARM 17 /* register parameter */
183 #define C_FIELD 18 /* bit field */
184 #define C_AUTOARG 19 /* auto argument */
185 #define C_LASTENT 20 /* dummy entry (end of block) */
186 #define C_BLOCK 100 /* ".bb" or ".eb" */
187 #define C_FCN 101 /* ".bf" or ".ef" */
188 #define C_EOS 102 /* end of structure */
189 #define C_FILE 103 /* file name */
190 #define C_LINE 104 /* line # reformatted as symbol table entry */
191 #define C_ALIAS 105 /* duplicate tag */
192 #define C_HIDDEN 106 /* ext symbol in dmert public lib */
193
194 /* New storage classes for WINDOWS_NT */
195 #define C_SECTION 104 /* section name */
196
197 /* New storage classes for 80960 */
198
199 /* C_LEAFPROC is obsolete. Use C_LEAFEXT or C_LEAFSTAT */
200 #define C_LEAFPROC 108 /* Leaf procedure, "call" via BAL */
201
202 #define C_SCALL 107 /* Procedure reachable via system call */
203 #define C_LEAFEXT 108 /* External leaf */
204 #define C_LEAFSTAT 113 /* Static leaf */
205 #define C_OPTVAR 109 /* Optimized variable */
206 #define C_DEFINE 110 /* Preprocessor #define */
207 #define C_PRAGMA 111 /* Advice to compiler or linker */
208 #define C_SEGMENT 112 /* 80960 segment name */
209
210 /* Storage classes for m88k */
211 #define C_SHADOW 107 /* shadow symbol */
212 #define C_VERSION 108 /* coff version symbol */
213
214 /* New storage classes for RS/6000 */
215 #define C_HIDEXT 107 /* Un-named external symbol */
216 #define C_BINCL 108 /* Marks beginning of include file */
217 #define C_EINCL 109 /* Marks ending of include file */
218
219 /* storage classes for stab symbols for RS/6000 */
220 #define C_GSYM (0x80)
221 #define C_LSYM (0x81)
222 #define C_PSYM (0x82)
223 #define C_RSYM (0x83)
224 #define C_RPSYM (0x84)
225 #define C_STSYM (0x85)
226 #define C_TCSYM (0x86)
227 #define C_BCOMM (0x87)
228 #define C_ECOML (0x88)
229 #define C_ECOMM (0x89)
230 #define C_DECL (0x8c)
231 #define C_ENTRY (0x8d)
232 #define C_FUN (0x8e)
233 #define C_BSTAT (0x8f)
234 #define C_ESTAT (0x90)
235
236 /********************** SECTION HEADER **********************/
237 struct internal_scnhdr
238 {
239 char s_name[8]; /* section name */
240 bfd_vma s_paddr; /* physical address, aliased s_nlib */
241 bfd_vma s_vaddr; /* virtual address */
242 bfd_vma s_size; /* section size */
243 bfd_vma s_scnptr; /* file ptr to raw data for section */
244 bfd_vma s_relptr; /* file ptr to relocation */
245 bfd_vma s_lnnoptr; /* file ptr to line numbers */
246 unsigned long s_nreloc; /* number of relocation entries */
247 unsigned long s_nlnno; /* number of line number entries*/
248 long s_flags; /* flags */
249 long s_align; /* used on I960 */
250 };
251
252 /*
253 * s_flags "type"
254 */
255 #define STYP_REG (0x0000) /* "regular": allocated, relocated, loaded */
256 #define STYP_DSECT (0x0001) /* "dummy": relocated only*/
257 #define STYP_NOLOAD (0x0002) /* "noload": allocated, relocated, not loaded */
258 #define STYP_GROUP (0x0004) /* "grouped": formed of input sections */
259 #define STYP_PAD (0x0008) /* "padding": not allocated, not relocated, loaded */
260 #define STYP_COPY (0x0010) /* "copy": for decision function used by field update; not allocated, not relocated,
261 loaded; reloc & lineno entries processed normally */
262 #define STYP_TEXT (0x0020) /* section contains text only */
263 #define S_SHRSEG (0x0020) /* In 3b Update files (output of ogen), sections which appear in SHARED segments of the Pfile
264 will have the S_SHRSEG flag set by ogen, to inform dufr that updating 1 copy of the proc. will
265 update all process invocations. */
266 #define STYP_DATA (0x0040) /* section contains data only */
267 #define STYP_BSS (0x0080) /* section contains bss only */
268 #define S_NEWFCN (0x0100) /* In a minimal file or an update file, a new function (as compared with a replaced function) */
269 #define STYP_INFO (0x0200) /* comment: not allocated not relocated, not loaded */
270 #define STYP_OVER (0x0400) /* overlay: relocated not allocated or loaded */
271 #define STYP_LIB (0x0800) /* for .lib: same as INFO */
272 #define STYP_MERGE (0x2000) /* merge section -- combines with text, data or bss sections only */
273 #define STYP_REVERSE_PAD (0x4000) /* section will be padded with no-op instructions wherever padding is necessary and there is a
274
275 word of contiguous bytes
276 beginning on a word boundary. */
277
278 #define STYP_LIT 0x8020 /* Literal data (like STYP_TEXT) */
279
280
281
282 /********************** LINE NUMBERS **********************/
283
284 /* 1 line number entry for every "breakpointable" source line in a section.
285 * Line numbers are grouped on a per function basis; first entry in a function
286 * grouping will have l_lnno = 0 and in place of physical address will be the
287 * symbol table index of the function name.
288 */
289
290 struct internal_lineno
291 {
292 union
293 {
294 long l_symndx; /* function name symbol index, iff l_lnno == 0*/
295 long l_paddr; /* (physical) address of line number */
296 } l_addr;
297 unsigned long l_lnno; /* line number */
298 };
299
300 /********************** SYMBOLS **********************/
301
302 #define SYMNMLEN 8 /* # characters in a symbol name */
303 #define FILNMLEN 14 /* # characters in a file name */
304 #define DIMNUM 4 /* # array dimensions in auxiliary entry */
305
306 struct internal_syment
307 {
308 union
309 {
310 char _n_name[SYMNMLEN]; /* old COFF version */
311 struct
312 {
313 long _n_zeroes; /* new == 0 */
314 long _n_offset; /* offset into string table */
315 } _n_n;
316 char *_n_nptr[2]; /* allows for overlaying */
317 } _n;
318 long n_value; /* value of symbol */
319 short n_scnum; /* section number */
320 unsigned short n_flags; /* copy of flags from filhdr */
321 unsigned short n_type; /* type and derived type */
322 unsigned char n_sclass; /* storage class */
323 char n_numaux; /* number of aux. entries */
324 };
325
326 #define n_name _n._n_name
327 #define n_zeroes _n._n_n._n_zeroes
328 #define n_offset _n._n_n._n_offset
329
330
331 /* Relocatable symbols have number of the section in which they are defined,
332 or one of the following: */
333
334 #define N_UNDEF ((short)0) /* undefined symbol */
335 #define N_ABS ((short)-1) /* value of symbol is absolute */
336 #define N_DEBUG ((short)-2) /* debugging symbol -- value is meaningless */
337 #define N_TV ((short)-3) /* indicates symbol needs preload transfer vector */
338 #define P_TV ((short)-4) /* indicates symbol needs postload transfer vector*/
339
340 /*
341 * Type of a symbol, in low N bits of the word
342 */
343 #define T_NULL 0
344 #define T_VOID 1 /* function argument (only used by compiler) */
345 #define T_CHAR 2 /* character */
346 #define T_SHORT 3 /* short integer */
347 #define T_INT 4 /* integer */
348 #define T_LONG 5 /* long integer */
349 #define T_FLOAT 6 /* floating point */
350 #define T_DOUBLE 7 /* double word */
351 #define T_STRUCT 8 /* structure */
352 #define T_UNION 9 /* union */
353 #define T_ENUM 10 /* enumeration */
354 #define T_MOE 11 /* member of enumeration*/
355 #define T_UCHAR 12 /* unsigned character */
356 #define T_USHORT 13 /* unsigned short */
357 #define T_UINT 14 /* unsigned integer */
358 #define T_ULONG 15 /* unsigned long */
359 #define T_LNGDBL 16 /* long double */
360
361 /*
362 * derived types, in n_type
363 */
364 #define DT_NON (0) /* no derived type */
365 #define DT_PTR (1) /* pointer */
366 #define DT_FCN (2) /* function */
367 #define DT_ARY (3) /* array */
368
369 #define BTYPE(x) ((x) & N_BTMASK)
370
371 #define ISPTR(x) (((x) & N_TMASK) == (DT_PTR << N_BTSHFT))
372 #define ISFCN(x) (((x) & N_TMASK) == (DT_FCN << N_BTSHFT))
373 #define ISARY(x) (((x) & N_TMASK) == (DT_ARY << N_BTSHFT))
374 #define ISTAG(x) ((x)==C_STRTAG||(x)==C_UNTAG||(x)==C_ENTAG)
375 #define DECREF(x) ((((x)>>N_TSHIFT)&~N_BTMASK)|((x)&N_BTMASK))
376
377
378 union internal_auxent
379 {
380 struct
381 {
382
383 union
384 {
385 long l; /* str, un, or enum tag indx */
386 struct coff_ptr_struct *p;
387 } x_tagndx;
388
389 union
390 {
391 struct
392 {
393 unsigned short x_lnno; /* declaration line number */
394 unsigned short x_size; /* str/union/array size */
395 } x_lnsz;
396 long x_fsize; /* size of function */
397 } x_misc;
398
399 union
400 {
401 struct
402 { /* if ISFCN, tag, or .bb */
403 long x_lnnoptr; /* ptr to fcn line # */
404 union
405 { /* entry ndx past block end */
406 long l;
407 struct coff_ptr_struct *p;
408 } x_endndx;
409 } x_fcn;
410
411 struct
412 { /* if ISARY, up to 4 dimen. */
413 unsigned short x_dimen[DIMNUM];
414 } x_ary;
415 } x_fcnary;
416
417 unsigned short x_tvndx; /* tv index */
418 } x_sym;
419
420 union
421 {
422 char x_fname[FILNMLEN];
423 struct
424 {
425 long x_zeroes;
426 long x_offset;
427 } x_n;
428 } x_file;
429
430 struct
431 {
432 long x_scnlen; /* section length */
433 unsigned short x_nreloc; /* # relocation entries */
434 unsigned short x_nlinno; /* # line numbers */
435 } x_scn;
436
437 struct
438 {
439 long x_tvfill; /* tv fill value */
440 unsigned short x_tvlen; /* length of .tv */
441 unsigned short x_tvran[2]; /* tv range */
442 } x_tv; /* info about .tv section (in auxent of symbol .tv)) */
443
444 /******************************************
445 * RS/6000-specific auxent - last auxent for every external symbol
446 ******************************************/
447 struct
448 {
449 union
450 { /* csect length or enclosing csect */
451 long l;
452 struct coff_ptr_struct *p;
453 } x_scnlen;
454 long x_parmhash; /* parm type hash index */
455 unsigned short x_snhash; /* sect num with parm hash */
456 unsigned char x_smtyp; /* symbol align and type */
457 /* 0-4 - Log 2 of alignment */
458 /* 5-7 - symbol type */
459 unsigned char x_smclas; /* storage mapping class */
460 long x_stab; /* dbx stab info index */
461 unsigned short x_snstab; /* sect num with dbx stab */
462 } x_csect; /* csect definition information */
463
464 /* x_smtyp values: */
465
466 #define SMTYP_ALIGN(x) ((x) >> 3) /* log2 of alignment */
467 #define SMTYP_SMTYP(x) ((x) & 0x7) /* symbol type */
468 /* Symbol type values: */
469 #define XTY_ER 0 /* External reference */
470 #define XTY_SD 1 /* Csect definition */
471 #define XTY_LD 2 /* Label definition */
472 #define XTY_CM 3 /* .BSS */
473 #define XTY_EM 4 /* Error message */
474 #define XTY_US 5 /* "Reserved for internal use" */
475
476 /* x_smclas values: */
477
478 #define XMC_PR 0 /* Read-only program code */
479 #define XMC_RO 1 /* Read-only constant */
480 #define XMC_DB 2 /* Read-only debug dictionary table */
481 #define XMC_TC 3 /* Read-write general TOC entry */
482 #define XMC_UA 4 /* Read-write unclassified */
483 #define XMC_RW 5 /* Read-write data */
484 #define XMC_GL 6 /* Read-only global linkage */
485 #define XMC_XO 7 /* Read-only extended operation (simulated insn) */
486 #define XMC_SV 8 /* Read-only supervisor call */
487 #define XMC_BS 9 /* Read-write BSS */
488 #define XMC_DS 10 /* Read-write descriptor csect */
489 #define XMC_UC 11 /* Read-write unnamed Fortran common */
490 #define XMC_TI 12 /* Read-only traceback index csect */
491 #define XMC_TB 13 /* Read-only traceback table csect */
492 /* 14 ??? */
493 #define XMC_TC0 15 /* Read-write TOC anchor for TOC addressability */
494
495
496 /******************************************
497 * I960-specific *2nd* aux. entry formats
498 ******************************************/
499 struct
500 {
501 /* This is a very old typo that keeps getting propagated. */
502 #define x_stdindx x_stindx
503 long x_stindx; /* sys. table entry */
504 } x_sc; /* system call entry */
505
506 struct
507 {
508 unsigned long x_balntry; /* BAL entry point */
509 } x_bal; /* BAL-callable function */
510
511 struct
512 {
513 unsigned long x_timestamp; /* time stamp */
514 char x_idstring[20]; /* producer identity string */
515 } x_ident; /* Producer ident info */
516
517 };
518
519 /********************** RELOCATION DIRECTIVES **********************/
520
521 struct internal_reloc
522 {
523 bfd_vma r_vaddr; /* Virtual address of reference */
524 long r_symndx; /* Index into symbol table */
525 unsigned short r_type; /* Relocation type */
526 unsigned char r_size; /* Used by RS/6000 and ECOFF */
527 unsigned char r_extern; /* Used by ECOFF */
528 unsigned long r_offset; /* Used by Alpha ECOFF, SPARC, others */
529 };
530
531 #define R_RELBYTE 017
532 #define R_RELWORD 020
533 #define R_PCRBYTE 022
534 #define R_PCRWORD 023
535 #define R_PCRLONG 024
536
537 #define R_DIR16 01
538 #define R_DIR32 06
539 #define R_PCLONG 020
540 #define R_RELBYTE 017
541 #define R_RELWORD 020
542
543
544
545 #define R_PCR16L 128
546 #define R_PCR26L 129
547 #define R_VRT16 130
548 #define R_HVRT16 131
549 #define R_LVRT16 132
550 #define R_VRT32 133
551 #define R_RELLONG (0x11) /* Direct 32-bit relocation */
552 #define R_IPRSHORT (0x18)
553 #define R_IPRMED (0x19) /* 24-bit ip-relative relocation */
554 #define R_IPRLONG (0x1a)
555 #define R_OPTCALL (0x1b) /* 32-bit optimizable call (leafproc/sysproc) */
556 #define R_OPTCALLX (0x1c) /* 64-bit optimizable call (leafproc/sysproc) */
557 #define R_GETSEG (0x1d)
558 #define R_GETPA (0x1e)
559 #define R_TAGWORD (0x1f)
560 #define R_JUMPTARG 0x20 /* strange 29k 00xx00xx reloc */
561
562
563 #define R_MOVB1 0x41 /* Special h8 16bit or 8 bit reloc for mov.b */
564 #define R_MOVB2 0x42 /* Special h8 opcode for 8bit which could be 16 */
565 #define R_JMP1 0x43 /* Special h8 16bit jmp which could be pcrel */
566 #define R_JMP2 0x44 /* a branch which used to be a jmp */
567 #define R_RELLONG_NEG 0x45
568
569 #define R_JMPL1 0x46 /* Special h8 24bit jmp which could be pcrel */
570 #define R_JMPL_B8 0x47 /* a 8 bit pcrel which used to be a jmp */
571
572 #define R_MOVLB1 0x48 /* Special h8 24bit or 8 bit reloc for mov.b */
573 #define R_MOVLB2 0x49 /* Special h8 opcode for 8bit which could be 24 */
574
575 /* Z8k modes */
576 #define R_IMM16 0x01 /* 16 bit abs */
577 #define R_JR 0x02 /* jr 8 bit disp */
578 #define R_IMM4L 0x23 /* low nibble */
579 #define R_IMM8 0x22 /* 8 bit abs */
580 #define R_IMM32 R_RELLONG /* 32 bit abs */
581 #define R_CALL R_DA /* Absolute address which could be a callr */
582 #define R_JP R_DA /* Absolute address which could be a jp */
583 #define R_REL16 0x04 /* 16 bit PC rel */
584 #define R_CALLR 0x05 /* callr 12 bit disp */
585 #define R_SEG 0x10 /* set if in segmented mode */
586 #define R_IMM4H 0x24 /* high nibble */
587 #define R_DISP7 0x25 /* djnz displacement */
588
589 /* H8500 modes */
590
591 #define R_H8500_IMM8 1 /* 8 bit immediate */
592 #define R_H8500_IMM16 2 /* 16 bit immediate */
593 #define R_H8500_PCREL8 3 /* 8 bit pcrel */
594 #define R_H8500_PCREL16 4 /* 16 bit pcrel */
595 #define R_H8500_HIGH8 5 /* high 8 bits of 24 bit address */
596 #define R_H8500_LOW16 7 /* low 16 bits of 24 bit immediate */
597 #define R_H8500_IMM24 6 /* 24 bit immediate */
598 #define R_H8500_IMM32 8 /* 32 bit immediate */
599 #define R_H8500_HIGH16 9 /* high 16 bits of 32 bit immediate */
600
601 /* SH modes */
602
603 #define R_SH_PCREL8 3 /* 8 bit pcrel */
604 #define R_SH_PCREL16 4 /* 16 bit pcrel */
605 #define R_SH_HIGH8 5 /* high 8 bits of 24 bit address */
606 #define R_SH_LOW16 7 /* low 16 bits of 24 bit immediate */
607 #define R_SH_IMM24 6 /* 24 bit immediate */
608 #define R_SH_PCDISP8BY4 9 /* PC rel 8 bits *4 +ve */
609 #define R_SH_PCDISP8BY2 10 /* PC rel 8 bits *2 +ve */
610 #define R_SH_PCDISP8 11 /* 8 bit branch */
611 #define R_SH_PCDISP 12 /* 12 bit branch */
612 #define R_SH_IMM32 14 /* 32 bit immediate */
613 #define R_SH_IMM8 16
614 #define R_SH_IMM8BY2 17
615 #define R_SH_IMM8BY4 18
616 #define R_SH_IMM4 19
617 #define R_SH_IMM4BY2 20
618 #define R_SH_IMM4BY4 21
619 #define R_SH_PCRELIMM8BY2 22
620 #define R_SH_PCRELIMM8BY4 23
621 #define R_SH_IMM16 24 /* 16 bit immediate */
622
623
624
625 /* W65 modes */
626
627 #define R_W65_ABS8 1 /* addr & 0xff */
628 #define R_W65_ABS16 2 /* addr & 0xffff */
629 #define R_W65_ABS24 3 /* addr & 0xffffff */
630
631 #define R_W65_ABS8S8 4 /* (addr >> 8) & 0xff */
632 #define R_W65_ABS8S16 5 /* (addr >> 16) & 0xff */
633
634 #define R_W65_ABS16S8 6 /* (addr >> 8) & 0ffff */
635 #define R_W65_ABS16S16 7 /* (addr >> 16) & 0ffff */
636
637 #define R_W65_PCR8 8
638 #define R_W65_PCR16 9
639
640 #define R_W65_DP 10 /* direct page 8 bits only */
641
This page took 0.044742 seconds and 5 git commands to generate.