1 /* ***********************************************************
  2    *                                                         *
  3    * Copyright, (C) Honeywell Information Systems Inc., 1982 *
  4    *                                                         *
  5    *********************************************************** */
  6 
  7 /* HISTORY COMMENTS:
  8   1) change(85-09-24,Elhard), approve(85-09-24,MCR7198),
  9      audit(86-06-30,Weaver), install(86-07-16,MR12.0-1094):
 10      Changed version number to 12, added bx_$caller and bx_$temp_bsegp
 11                                                    END HISTORY COMMENTS */
 12 
 13 /* BX_ - Static Segment for the Multics Binder.
 14    Rewritten in CDS 12/16/76 by Noel I. Morris    */
 15 /* Modified 8/16/77 by Melanie Weaver to add perprocess_static switch */
 16 /* Modified Oct 78 by David Spector to delete temp pointers and count */
 17 /* Modified Dec 78 by David Spector to make repatch table extensible */
 18 /* Version 10.2: 01/15/81, W. Olin Sibert: -force_order, -force_update, bind command warnings */
 19 /* Modified 5/25/82 by Melanie Weaver to increase addname limit */
 20 /* Modified 06/16/83 by Melanie Weaver to handle list template external variable initialization */
 21 /* Modified 11/03/83 by Melanie Weaver to change version for changes made by JMAthane in 1982 */
 22 /* Modified 11/15/84 by M. Sharpe to change version number */
 23 
 24 /* ******************************************************
 25    *                                                    *
 26    *                                                    *
 27    * Copyright (c) 1972 by Massachusetts Institute of   *
 28    * Technology and Honeywell Information Systems, Inc. *
 29    *                                                    *
 30    *                                                    *
 31    ****************************************************** */
 32 
 33 
 34 /* format: style3,^indnoniterdo */
 35 bx_:
 36      proc;
 37 
 38 dcl       1 cdsa              like cds_args auto aligned;
 39 
 40 
 41 dcl       Binder_Version_Name char (167) static options (constant)
 42                               init ("Multics Binder, Version 12 of Tuesday, March 26, 1985");
 43 dcl       Binder_Version_Number
 44                               fixed bin static options (constant) init (12);
 45 
 46 
 47 dcl       1 bx_text           aligned auto,                 /* pure portion of bx_ */
 48             2 vers_name,                                    /* ASCII version name, in ACC form */
 49               3 lth           fixed bin (8) unal,
 50               3 chr           char (167) unal,
 51             2 vers_number     fixed bin,                    /* integer part of version number */
 52             2 size            fixed bin,                    /* size of main data base, for resetting */
 53             2 snt_limit       fixed bin,                    /* preset limit for segname table */
 54             2 oddname_limit   fixed bin,                    /* preset limit for oddname table */
 55             2 stringmap_limit fixed bin,                    /* preset limit for stringmap table */
 56             2 addname_limit   fixed bin;                    /* preset limit for addname table */
 57 
 58 
 59 dcl       1 bx_link           aligned auto,                 /* internal static portion of bx_ */
 60             2 area_begin      bit (0) unal,                 /* beginning of main data base */
 61             2 ctp             pointer,                      /* pointer to component table */
 62             2 freep           pointer,                      /* pointer to beginning of free area */
 63             2 isp             pointer,                      /* pointer to first insym table */
 64             2 inpp            pointer,                      /* pointer to binder's input structure */
 65             2 bsegp           pointer,                      /* pointer to base of new object segment */
 66             2 temp_bsegp      ptr,                          /* pointer to temporary bound seg (in [pd]) */
 67             2 temp            pointer,                      /* pointer to threaded temp segments */
 68             2 optp            pointer,                      /* pointer to options table */
 69             2 odnp            pointer,                      /* pointer to oddname table */
 70             2 first_rptp      pointer,                      /* pointer to first chunk of repatch table */
 71             2 last_rptp       pointer,                      /* pointer to current chunk of repatch table */
 72             2 adnp            pointer,                      /* pointer to addname table */
 73             2 bindmap_def     pointer,                      /* pointer to new object's "bind_map" definition */
 74             2 bdefp           pointer,                      /* pointer to new object's definition section */
 75             2 bstatp          pointer,                      /* pointer to new object's static section */
 76             2 blnkp           pointer,                      /* pointer to new object's linkage section */
 77             2 bsymp           pointer,                      /* pointer to new object's symbol section */
 78             2 sntp            pointer,                      /* pointer to segname table */
 79             2 tdefp           pointer,                      /* pointer to temporary new definition section */
 80             2 tintp           pointer,                      /* pointer to temporary new internal static */
 81             2 tlinkp          pointer,                      /* pointer to temporary new linkage section */
 82             2 strmp           pointer,                      /*  pointer to stringmap table */
 83             2 n_firstrefs     fixed bin,                    /* ptr to comp tbl for seg with frt */
 84             2 bound_segname   char (32) aligned,            /* name of new bound object */
 85             2 caller          char (32) aligned,            /* name of calling program */
 86             2 fatal_error     fixed bin,                    /* 1 -> fatal error was detected */
 87             2 bseg_acinfop    pointer,                      /* new object's acinfop for "tssi_" */
 88             2 bseg_bitcount   fixed bin (24),               /* new object's bitcount */
 89             2 o_lng           fixed bin (19),               /* length of new bound object */
 90             2 t_lng           fixed bin (18),               /* length of new text section */
 91             2 d_lng           fixed bin (18),               /* length of new definition section */
 92             2 i_lng           fixed bin,                    /* length of new static section */
 93             2 l_lng           fixed bin,                    /* length of new linkage section */
 94             2 s_lng           fixed bin (18),               /* length of new symbol section */
 95             2 addname         fixed bin,                    /* 1 -> addname option specified */
 96             2 debug           fixed bin,                    /* 1 -> debug option was specified */
 97             2 brief           fixed bin,                    /* 1 -> brief option was specified */
 98             2 force_order     fixed bin,                    /* 1 -> -force_order specified on command line */
 99             2 has_sep_stat    fixed bin,                    /* 1 -> a comp has nonzero sep static */
100             2 has_comb_stat   fixed bin,                    /* 1 -> a comp has nonzero compined static */
101             2 bound_sep_stat  fixed bin,                    /* 1 -> bound segment has separate static */
102             2 perprocess_static
103                               fixed bin,                    /* 1 -> bound seg has perprocess static switch on */
104             2 standard        fixed bin,                    /* 1 -> bound seg is in standard format */
105             2 bproc           fixed bin,                    /* 1 -> at least one component is a procedure */
106             2 textlng         fixed bin (18),               /* length of new pure text portion */
107             2 curdeflng       fixed bin (18),               /* current length of new definition section */
108             2 tintlng         fixed bin,                    /* current length of new internal static */
109             2 maxlinklng      fixed bin,                    /* maximum size linkage section may attain */
110             2 maxdeflng       fixed bin (18),               /* maximum size definitions section may attain */
111             2 tlinklng        fixed bin,                    /* current size of linkage section */
112             2 ncomp           fixed bin,                    /* number of component objects to be bound */
113             2 v_lng           fixed bin,                    /* length of version name string */
114             2 n_lng           fixed bin,                    /* length of bound segment name string */
115             2 nsymdefs        fixed bin,                    /* count of non-null symbol definitions */
116             2 nsegdefs        fixed bin;                    /* count of non-null segment name definitions */
117 
118 
119 dcl       code                fixed bin (35),
120           create_data_segment_
121                               entry (ptr, fixed bin (35)),
122           com_err_            entry options (variable);
123 
124 dcl       (addr, length, null, size, string, unspec)
125                               builtin;
126 
127 %page;
128 
129           unspec (bx_text) = "0"b;                          /* Clear data bases. */
130           unspec (bx_link) = "0"b;
131 
132           vers_name.lth = length (Binder_Version_Name);
133           vers_name.chr = Binder_Version_Name;
134           vers_number = Binder_Version_Number;
135           bx_text.size = size (bx_link);
136           snt_limit = 900;
137           oddname_limit = 256;
138           stringmap_limit = 2048;
139           addname_limit = 250;
140 
141           ctp, freep, isp, inpp, bsegp, temp_bsegp, optp, odnp, first_rptp, last_rptp, adnp, bindmap_def, bdefp, bstatp,
142                blnkp, bsymp, sntp, tdefp, tintp, tlinkp, strmp, bseg_acinfop = null ();
143 
144           n_firstrefs = 0;
145 
146 
147           cdsa.sections (1).p = addr (bx_text);
148           cdsa.sections (1).len = size (bx_text);
149           cdsa.sections (1).struct_name = "bx_text";
150 
151           cdsa.sections (2).p = addr (bx_link);
152           cdsa.sections (2).len = size (bx_link);
153           cdsa.sections (2).struct_name = "bx_link";
154 
155           cdsa.seg_name = "bx_";
156 
157           cdsa.num_exclude_names = 0;
158 
159           string (cdsa.switches) = "0"b;
160           cdsa.switches.have_text = "1"b;
161           cdsa.switches.have_static = "1"b;
162 
163           call create_data_segment_ (addr (cdsa), code);
164 
165           if code ^= 0
166           then call com_err_ (code, "bx_", "");
167 
168           return;
169 
170 %page;
171 %include cds_args;
172 
173      end bx_;