|
|
1.1 root 1: static char ID[] = "@(#) specsyms.c: 1.2 3/2/83";
2:
3: #include <stdio.h>
4:
5: #include "system.h"
6: #include "structs.h"
7: #include "sgsmacros.h"
8: #include "extrns.h"
9: set_spec_syms()
10: {
11:
12: /*
13: * For non-relocatable link edits, set up the special symbols.
14: *
15: * 1. _TORIGIN : segment register value for the REGION containing
16: * text
17: * _DORIGIN : segment register value for the REGION containing
18: * data
19: * _TVORIG : segment register value for the REGION containing
20: * the tv
21: *
22: * 2. _ETEXT : next available address after the end of the output
23: * section _TEXT
24: * _EDATA : next available address after the end of the output
25: * section _DATA
26: * _END : next available address after the end of the output
27: * section _BSS
28: *
29: * 3. _SORIGIN : first address at or following _END which is
30: * aligned to a 16-byte boundary
31: *
32: * 4. _TV : special symbol with auxiliary entry giving
33: * tvlength and tvrange.
34: */
35:
36: register OUTSECT *osptr;
37: register long base;
38: SYMTAB *sym;
39: AUXENT aux;
40:
41: if ( ! aflag )
42: return;
43:
44:
45: osptr = (OUTSECT *) outsclst.head;
46: while (osptr) {
47: if( equal(osptr->oshdr.s_name,_TEXT, 8))
48: creatsym(_ETEXT,
49: osptr->oshdr.s_paddr + osptr->oshdr.s_size);
50: else if( equal(osptr->oshdr.s_name,_DATA, 8))
51: creatsym(_EDATA,
52: osptr->oshdr.s_paddr + osptr->oshdr.s_size);
53: else if( equal(osptr->oshdr.s_name,_BSS, 8)) {
54: base = osptr->oshdr.s_paddr + osptr->oshdr.s_size;
55: creatsym(_END, base);
56: }
57: #if TRVEC
58: else if( equal(osptr->oshdr.s_name,_TV,8) ) {
59: creatsym(_TV, ((tvspec.tvbndadr == -1L) ?
60: 0L : tvspec.tvbndadr));
61: zero(&aux, AUXESZ);
62: aux.x_tv.x_tvlen = tvspec.tvlength;
63: aux.x_tv.x_tvran[0] = tvspec.tvrange[0];
64: aux.x_tv.x_tvran[1] = tvspec.tvrange[1];
65: aux.x_tv.x_tvfill = -1L;
66: sym = findsym(_TV);
67: putaux( makeaux(sym, &aux, 0), 1 );
68: putsym(sym, 1);
69: }
70: #endif
71: osptr = osptr->osnext;
72: }
73: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.