]>
Commit | Line | Data |
---|---|---|
a07cc613 JG |
1 | /* SPARC-specific values for a.out files */ |
2 | ||
66d4e1bb | 3 | #define PAGE_SIZE 0x2000 /* 8K. aka NBPG in <sys/param.h> */ |
a07cc613 | 4 | /* Note that some SPARCs have 4K pages, some 8K, some others. */ |
d7f8f106 JG |
5 | |
6 | #define SEG_SIZE_SPARC PAGE_SIZE | |
e10f519d | 7 | #define SEG_SIZE_SUN3 0x20000 /* Resolution of r/w protection hw */ |
d7f8f106 | 8 | |
66d4e1bb | 9 | #define TEXT_START_ADDR PAGE_SIZE /* Location 0 is not accessible */ |
a07cc613 | 10 | |
66d4e1bb | 11 | /* Non-default definitions of the accessor macros... */ |
a07cc613 | 12 | |
d7f8f106 JG |
13 | /* Segment size varies on Sun-3 versus Sun-4. */ |
14 | ||
15 | #define N_SEGSIZE(x) (N_MACHTYPE(x) == M_SPARC? SEG_SIZE_SPARC: \ | |
16 | N_MACHTYPE(x) == M_68020? SEG_SIZE_SUN3: \ | |
17 | /* Guess? */ PAGE_SIZE) | |
18 | ||
66d4e1bb JG |
19 | /* Offset in a.out file of the text section. For ZMAGIC, the text section |
20 | actually includes the a.out header. */ | |
a07cc613 | 21 | |
19b03b7a | 22 | #define N_TXTOFF(x) ( (N_MAGIC((x)) == ZMAGIC) ? 0 : EXEC_BYTES_SIZE) |
a07cc613 | 23 | |
66d4e1bb JG |
24 | /* Virtual Address of text segment from the a.out file. For OMAGIC, |
25 | (almost always "unlinked .o's" these days), should be zero. | |
26 | Sun added a kludge so that shared libraries linked ZMAGIC get | |
27 | an address of zero if a_entry (!!!) is lower than the otherwise | |
28 | expected text address. These kludges have gotta go! | |
29 | For linked files, should reflect reality if we know it. */ | |
30 | ||
31 | #define N_TXTADDR(x) \ | |
32 | (N_MAGIC(x)==OMAGIC? 0 \ | |
33 | : (N_MAGIC(x) == ZMAGIC && (x).a_entry < TEXT_START_ADDR)? 0 \ | |
34 | : TEXT_START_ADDR) |