1 /* $Id: a.out.h,v 1.1 2006/07/05 06:20:25 gerg Exp $ */
3 * Copyright (C) 2004 Microtronix Datacom Ltd.
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
15 * NON INFRINGEMENT. See the GNU General Public License for more
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23 #ifndef __NIOS2NOMMU_A_OUT_H__
24 #define __NIOS2NOMMU_A_OUT_H__
26 #define SPARC_PGSIZE 0x1000 /* Thanks to the sun4 architecture... */
27 #define SEGMENT_SIZE SPARC_PGSIZE /* whee... */
30 unsigned char a_dynamic
:1; /* A __DYNAMIC is in this image */
31 unsigned char a_toolversion
:7;
32 unsigned char a_machtype
;
33 unsigned short a_info
;
34 unsigned long a_text
; /* length of text, in bytes */
35 unsigned long a_data
; /* length of data, in bytes */
36 unsigned long a_bss
; /* length of bss, in bytes */
37 unsigned long a_syms
; /* length of symbol table, in bytes */
38 unsigned long a_entry
; /* where program begins */
39 unsigned long a_trsize
;
40 unsigned long a_drsize
;
57 /* Where in the file does the text information begin? */
58 #define N_TXTOFF(x) (N_MAGIC(x) == ZMAGIC ? 0 : sizeof (struct exec))
60 /* Where do the Symbols start? */
61 #define N_SYMOFF(x) (N_TXTOFF(x) + (x).a_text + \
62 (x).a_data + (x).a_trsize + \
65 /* Where does text segment go in memory after being loaded? */
66 #define N_TXTADDR(x) (((N_MAGIC(x) == ZMAGIC) && \
67 ((x).a_entry < SPARC_PGSIZE)) ? \
70 /* And same for the data segment.. */
71 #define N_DATADDR(x) (N_MAGIC(x)==OMAGIC ? \
72 (N_TXTADDR(x) + (x).a_text) \
73 : (_N_SEGMENT_ROUND (_N_TXTENDADDR(x))))
75 #define N_TRSIZE(a) ((a).a_trsize)
76 #define N_DRSIZE(a) ((a).a_drsize)
77 #define N_SYMSIZE(a) ((a).a_syms)
81 #define STACK_TOP TASK_SIZE
85 #endif /* __NIOS2NOMMU_A_OUT_H__ */