···1-/* $Id: a.out.h,v 1.13 2000/01/09 10:46:53 anton Exp $ */2#ifndef __SPARC_A_OUT_H__3#define __SPARC_A_OUT_H__45#define SPARC_PGSIZE 0x2000 /* Thanks to the sun4 architecture... */6#define SEGMENT_SIZE SPARC_PGSIZE /* whee... */7008struct exec {9 unsigned char a_dynamic:1; /* A __DYNAMIC is in this image */10 unsigned char a_toolversion:7;11 unsigned char a_machtype;12 unsigned short a_info;13- unsigned long a_text; /* length of text, in bytes */14- unsigned long a_data; /* length of data, in bytes */15- unsigned long a_bss; /* length of bss, in bytes */16- unsigned long a_syms; /* length of symbol table, in bytes */17- unsigned long a_entry; /* where program begins */18- unsigned long a_trsize;19- unsigned long a_drsize;20};002122/* Where in the file does the text information begin? */23#define N_TXTOFF(x) (N_MAGIC(x) == ZMAGIC ? 0 : sizeof (struct exec))···31 (x).a_drsize)3233/* Where does text segment go in memory after being loaded? */34-#define N_TXTADDR(x) (((N_MAGIC(x) == ZMAGIC) && \35 ((x).a_entry < SPARC_PGSIZE)) ? \36 0 : SPARC_PGSIZE)3738/* And same for the data segment.. */39#define N_DATADDR(x) (N_MAGIC(x)==OMAGIC ? \40 (N_TXTADDR(x) + (x).a_text) \41- : (_N_SEGMENT_ROUND (_N_TXTENDADDR(x))))4243#define N_TRSIZE(a) ((a).a_trsize)44#define N_DRSIZE(a) ((a).a_drsize)45#define N_SYMSIZE(a) ((a).a_syms)004647/*48 * Sparc relocation types···82 */83struct relocation_info /* used when header.a_machtype == M_SPARC */84{85- unsigned long r_address; /* relocation addr */86 unsigned int r_index:24; /* segment index or symbol index */87 unsigned int r_extern:1; /* if F, r_index==SEG#; if T, SYM idx */88 unsigned int r_pad:2; /* <unused> */89 enum reloc_type r_type:5; /* type of relocation to perform */90- long r_addend; /* addend for relocation value */91};9293#define N_RELOCATION_INFO_DECLARED 1009495#endif /* __SPARC_A_OUT_H__ */
···01#ifndef __SPARC_A_OUT_H__2#define __SPARC_A_OUT_H__34#define SPARC_PGSIZE 0x2000 /* Thanks to the sun4 architecture... */5#define SEGMENT_SIZE SPARC_PGSIZE /* whee... */67+#ifndef __ASSEMBLY__8+9struct exec {10 unsigned char a_dynamic:1; /* A __DYNAMIC is in this image */11 unsigned char a_toolversion:7;12 unsigned char a_machtype;13 unsigned short a_info;14+ unsigned int a_text; /* length of text, in bytes */15+ unsigned int a_data; /* length of data, in bytes */16+ unsigned int a_bss; /* length of bss, in bytes */17+ unsigned int a_syms; /* length of symbol table, in bytes */18+ unsigned int a_entry; /* where program begins */19+ unsigned int a_trsize;20+ unsigned int a_drsize;21};22+23+#endif /* !__ASSEMBLY__ */2425/* Where in the file does the text information begin? */26#define N_TXTOFF(x) (N_MAGIC(x) == ZMAGIC ? 0 : sizeof (struct exec))···28 (x).a_drsize)2930/* Where does text segment go in memory after being loaded? */31+#define N_TXTADDR(x) (unsigned long)(((N_MAGIC(x) == ZMAGIC) && \32 ((x).a_entry < SPARC_PGSIZE)) ? \33 0 : SPARC_PGSIZE)3435/* And same for the data segment.. */36#define N_DATADDR(x) (N_MAGIC(x)==OMAGIC ? \37 (N_TXTADDR(x) + (x).a_text) \38+ : (unsigned long) (_N_SEGMENT_ROUND (_N_TXTENDADDR(x))))3940#define N_TRSIZE(a) ((a).a_trsize)41#define N_DRSIZE(a) ((a).a_drsize)42#define N_SYMSIZE(a) ((a).a_syms)43+44+#ifndef __ASSEMBLY__4546/*47 * Sparc relocation types···77 */78struct relocation_info /* used when header.a_machtype == M_SPARC */79{80+ unsigned int r_address; /* relocation addr */81 unsigned int r_index:24; /* segment index or symbol index */82 unsigned int r_extern:1; /* if F, r_index==SEG#; if T, SYM idx */83 unsigned int r_pad:2; /* <unused> */84 enum reloc_type r_type:5; /* type of relocation to perform */85+ int r_addend; /* addend for relocation value */86};8788#define N_RELOCATION_INFO_DECLARED 189+90+#endif /* !(__ASSEMBLY__) */9192#endif /* __SPARC_A_OUT_H__ */
+1-98
include/asm-sparc64/a.out.h
···1-/* $Id: a.out.h,v 1.8 2002/02/09 19:49:31 davem Exp $ */2-#ifndef __SPARC64_A_OUT_H__3-#define __SPARC64_A_OUT_H__4-5-#define SPARC_PGSIZE 0x2000 /* Thanks to the sun4 architecture... */6-#define SEGMENT_SIZE SPARC_PGSIZE /* whee... */7-8-#ifndef __ASSEMBLY__9-10-struct exec {11- unsigned char a_dynamic:1; /* A __DYNAMIC is in this image */12- unsigned char a_toolversion:7;13- unsigned char a_machtype;14- unsigned short a_info;15- unsigned int a_text; /* length of text, in bytes */16- unsigned int a_data; /* length of data, in bytes */17- unsigned int a_bss; /* length of bss, in bytes */18- unsigned int a_syms; /* length of symbol table, in bytes */19- unsigned int a_entry; /* where program begins */20- unsigned int a_trsize;21- unsigned int a_drsize;22-};23-24-#endif /* !__ASSEMBLY__ */25-26-/* Where in the file does the text information begin? */27-#define N_TXTOFF(x) (N_MAGIC(x) == ZMAGIC ? 0 : sizeof (struct exec))28-29-/* Where do the Symbols start? */30-#define N_SYMOFF(x) (N_TXTOFF(x) + (x).a_text + \31- (x).a_data + (x).a_trsize + \32- (x).a_drsize)33-34-/* Where does text segment go in memory after being loaded? */35-#define N_TXTADDR(x) (unsigned long)(((N_MAGIC(x) == ZMAGIC) && \36- ((x).a_entry < SPARC_PGSIZE)) ? \37- 0 : SPARC_PGSIZE)38-39-/* And same for the data segment.. */40-#define N_DATADDR(x) (N_MAGIC(x)==OMAGIC ? \41- (N_TXTADDR(x) + (x).a_text) \42- : (unsigned long)(_N_SEGMENT_ROUND (_N_TXTENDADDR(x))))43-44-#define N_TRSIZE(a) ((a).a_trsize)45-#define N_DRSIZE(a) ((a).a_drsize)46-#define N_SYMSIZE(a) ((a).a_syms)47-48-#ifndef __ASSEMBLY__49-50-/*51- * Sparc relocation types52- */53-enum reloc_type54-{55- RELOC_8,56- RELOC_16,57- RELOC_32, /* simplest relocs */58- RELOC_DISP8,59- RELOC_DISP16,60- RELOC_DISP32, /* Disp's (pc-rel) */61- RELOC_WDISP30,62- RELOC_WDISP22, /* SR word disp's */63- RELOC_HI22,64- RELOC_22, /* SR 22-bit relocs */65- RELOC_13,66- RELOC_LO10, /* SR 13&10-bit relocs */67- RELOC_SFA_BASE,68- RELOC_SFA_OFF13, /* SR S.F.A. relocs */69- RELOC_BASE10,70- RELOC_BASE13,71- RELOC_BASE22, /* base_relative pic */72- RELOC_PC10,73- RELOC_PC22, /* special pc-rel pic */74- RELOC_JMP_TBL, /* jmp_tbl_rel in pic */75- RELOC_SEGOFF16, /* ShLib offset-in-seg */76- RELOC_GLOB_DAT,77- RELOC_JMP_SLOT,78- RELOC_RELATIVE /* rtld relocs */79-};80-81-/*82- * Format of a relocation datum.83- */84-struct relocation_info /* used when header.a_machtype == M_SPARC */85-{86- unsigned int r_address; /* relocation addr */87- unsigned int r_index:24; /* segment index or symbol index */88- unsigned int r_extern:1; /* if F, r_index==SEG#; if T, SYM idx */89- unsigned int r_pad:2; /* <unused> */90- enum reloc_type r_type:5; /* type of relocation to perform */91- int r_addend; /* addend for relocation value */92-};93-94-#define N_RELOCATION_INFO_DECLARED 195-96-#endif /* !(__ASSEMBLY__) */97-98-#endif /* !(__SPARC64_A_OUT_H__) */