/* *********************************************************** * * * Copyright, (C) Honeywell Information Systems Inc., 1982 * * * * Copyright (c) 1972 by Massachusetts Institute of * * Technology and Honeywell Information Systems, Inc. * * * *********************************************************** */ print_relocation_info: procedure; pri: entry; /* originally coded before 1971 */ /* modified 1972 by M. Weaver for standard object segments */ /* last modified 10/75 by M. Weaver general cleaning up */ dcl (i, last_word, half, bits_behind_runner, code(2), section, section_lng, abs_block_to_go, cacnt, format, comp_length, comp_bits, code_printed(2), length_path, length_arg) fixed bin; dcl error_code fixed bin(35); dcl (relbitcnt based, total_bits) fixed bin(24) aligned; dcl (first_word, nwords) fixed bin(18); dcl (section_ptr, seg_ptr, pathname_ptr, arg_ptr, oip) ptr; dcl code_name(0:17) int static aligned char(16) initial("text", "neg text", "link ptr 18", "neg link ptr 18", "link ptr 15", "def ptr", "symbol", "neg symbol", "int static 18", "int static 15", "self relative", "(11011)", "(11100)", "(11101)", "expanded abs", "escape", "absolute", "off the end"); dcl section_name(4) char(10) char(10) aligned init("text", "definition", "linkage", "symbol"); %include relocation_header; dcl 1 old_relinfo aligned based, /* header for old format object segs */ 2 n_bits fixed bin, 2 relbits bit (0 refer(old_relinfo.n_bits)) aligned; dcl 1 rel_section aligned based(section_ptr), 2 (bits_behind bit(bits_behind_runner), lead bit(1), four_bits bit(4), abs_block bit(10)) unaligned; dcl (error_table_$badopt, error_table_$noarg, error_table_$wrong_no_of_args, error_table_$segknown) external fixed bin(35); dcl null builtin; dcl dir_name char(168); dcl ent_name char(32); dcl me char(21) aligned int static init("print_relocation_info"); dcl bit_count fixed bin(24); dcl no_copy int static fixed bin(2) initial(1); dcl arg_xx aligned char(2); dcl pathname char(length_path) based(pathname_ptr); dcl arg char(length_arg) based(arg_ptr); dcl (need_path, need_first_word, first_repeat, fatal_error, endsw) aligned bit(1); dcl (com_err_, ioa_) ext entry options(variable); dcl cu_$arg_ptr ext entry(fixed bin, ptr, fixed bin, fixed bin(35)); dcl cu_$arg_count ext entry() returns(fixed bin); dcl cv_oct_check_ ext entry(char(*), fixed bin(35)) returns(fixed bin(18)); dcl object_info_$long ext entry(ptr, fixed bin(24), ptr, fixed bin(35)); dcl expand_path_ ext entry(ptr, fixed bin, ptr, ptr, fixed bin(35)); dcl hcs_$initiate_count ext entry(char(*), char(*), char(*), fixed bin(24), fixed bin(2), ptr, fixed bin(35)); /* */ dcl 1 oi aligned like object_info; %include object_info; /* */ need_path, need_first_word = "1"b /* Neither of these seen yet */; first_repeat, fatal_error = "0"b; /* Niether of these seen yet */ section = 1; /* default = text */ nwords = 260000 /* Default */; first_word = 0 /* Default */; cacnt = 0; i = cu_$arg_count(); if (i > 4) | (i = 0) then do; call com_err_(error_table_$wrong_no_of_args, me, "need: path -section- -offset- -length-"); return; end; do i = 1 to 4 /* collect arguments */; call cu_$arg_ptr(i, arg_ptr, length_arg, error_code); if error_code ^= 0 then /* Assume args exhausted. maybe OK */ go to no_more_args; if substr(arg, 1, 1) = "-" then /* option */ if arg = "-text" then do; section = 1; cacnt = cacnt + 1; end; else if (arg = "-definition" | arg = "-def") then do; section = 2; cacnt = cacnt + 1; end; else if (arg = "-link" | arg = "-lk") then do; section = 3; cacnt = cacnt + 1; end; else if (arg = "-symbol" | arg = "-sb") then do; section = 4; cacnt = cacnt + 1; end; else do; call com_err_(error_table_$badopt, me, arg); fatal_error = "1"b; end; else if need_path then do; need_path = "0"b; length_path = length_arg; pathname_ptr = arg_ptr; end; else if need_first_word then do; need_first_word = "0"b; first_word = cv_oct_check_(arg, error_code); if error_code ^= 0 then do; call com_err_(0, me, "offset ^a is not an octal number", arg); fatal_error = "1"b; end; end; else do; nwords = cv_oct_check_(arg, error_code); if error_code ^= 0 then do; call com_err_(0, me, "length ^a is not an octal number",arg); fatal_error = "1"b; end; end; end /* Fall through after 4 args or after attempt to read arg after the last one given */; no_more_args: if need_path then do; call com_err_(error_table_$wrong_no_of_args, me, "pathname missing"); return; end; if fatal_error then return; /* message already printed */ if cacnt > 1 then call ioa_("^a: More than one section was specified; only last one will be used.", me); call expand_path_(pathname_ptr, length_path, addr(dir_name), addr(ent_name), error_code); if error_code ^= 0 then do; call com_err_(error_code, me, pathname); return; end; call hcs_$initiate_count(dir_name, ent_name, "", bit_count, no_copy, seg_ptr, error_code); if seg_ptr = null then do; call com_err_(error_code, me, pathname); return; end; oip = addr(oi); oi.version_number = object_info_version_2; call object_info_$long(seg_ptr, bit_count, oip, error_code); if error_code ^= 0 then do; call com_err_(error_code, me, "^a>^a", dir_name, ent_name); return; end; if section = 1 then do; section_ptr = oi.rel_text; section_lng = oi.tlng - 1; end; else if section = 2 then do; section_ptr = oi.rel_def; section_lng = oi.dlng - 1; end; else if section = 3 then do; section_ptr = oi.rel_link; section_lng = oi.llng - 1; end; else if section = 4 then do; section_ptr = oi.rel_symbol; section_lng = oi.slng - 1; end; if section_ptr = null then do; /* no point in going on */ call com_err_(0, me, "Specified section has no relocation bits."); return; end; /* be sure specified range is within section */ if first_word > section_lng then do; call ioa_("^a section is only ^o(8) words long", section_name(section), section_lng); return; end; last_word = first_word + nwords - 1; /* this is what was asked for */ if last_word > section_lng then do; /* set up to print more meaningful message */ last_word = section_lng; /* last word we're interested in */ endsw = "1"b; /* so won't imply that section is longer */ end; else endsw = "0"b; if oi.format.standard then do; total_bits = section_ptr -> relinfo.n_bits; section_ptr = addr(section_ptr -> relinfo.relbits); end; else do; total_bits = section_ptr -> old_relinfo.n_bits; section_ptr = addr(section_ptr -> old_relinfo.relbits); end; abs_block_to_go, bits_behind_runner = 0; code_printed(1), code_printed(2) = 999 /* That is, the first line is NOT like the imaginary pre-first one */; do i = 0 to last_word; do half = 1 to 2; GET_BITS: if abs_block_to_go > 0 then do; code(half) = 16 /* absolute */; abs_block_to_go = abs_block_to_go-1; end; else if bits_behind_runner >= total_bits then code(half) = 17 /* off the end */; else if lead = "0"b then do; code(half) = 16 /* absolute */; bits_behind_runner = bits_behind_runner+1; end; else if four_bits = "1110"b then do; /* expanded absolute */ abs_block_to_go = bin(abs_block,10); bits_behind_runner = bits_behind_runner+15; go to GET_BITS; end; else do; code(half) = bin(four_bits, 4); bits_behind_runner = bits_behind_runner+5; end; end; if i >= first_word then /* user is interested in this word */ if code(1) ^= code_printed(1) | code(2) ^= code_printed(2) /* but only if ^= prev word */ then do; call ioa_("^6o ^16a ^16a", i, code_name(code(1)), code_name(code(2))); code_printed(1) = code(1); code_printed(2) = code(2); first_repeat = "1"b; end; else if first_repeat /* If not first repeat, nothing gets printed at all */ then do; first_repeat = "0"b; call ioa_("(repeats)"); end; if code(1) = 17 then do; /* no sense continuing */ call ioa_("Relocation bits are not provided for words after ^o", i-1); return; end; end; if endsw then call ioa_("end of ^a section", section_name(section)); return; end print_relocation_info; */ ----------------------------------------------------------- Historical Background This edition of the Multics software materials and documentation is provided and donated to Massachusetts Institute of Technology by Group Bull including Bull HN Information Systems Inc. as a contribution to computer science knowledge. This donation is made also to give evidence of the common contributions of Massachusetts Institute of Technology, Bell Laboratories, General Electric, Honeywell Information Systems Inc., Honeywell Bull Inc., Groupe Bull and Bull HN Information Systems Inc. to the development of this operating system. Multics development was initiated by Massachusetts Institute of Technology Project MAC (1963-1970), renamed the MIT Laboratory for Computer Science and Artificial Intelligence in the mid 1970s, under the leadership of Professor Fernando Jose Corbato. Users consider that Multics provided the best software architecture for managing computer hardware properly and for executing programs. Many subsequent operating systems incorporated Multics principles. Multics was distributed in 1975 to 2000 by Group Bull in Europe , and in the U.S. by Bull HN Information Systems Inc., as successor in interest by change in name only to Honeywell Bull Inc. and Honeywell Information Systems Inc. . ----------------------------------------------------------- Permission to use, copy, modify, and distribute these programs and their documentation for any purpose and without fee is hereby granted,provided that the below copyright notice and historical background appear in all copies and that both the copyright notice and historical background and this permission notice appear in supporting documentation, and that the names of MIT, HIS, Bull or Bull HN not be used in advertising or publicity pertaining to distribution of the programs without specific prior written permission. Copyright 1972 by Massachusetts Institute of Technology and Honeywell Information Systems Inc. Copyright 2006 by Bull HN Information Systems Inc. Copyright 2006 by Bull SAS All Rights Reserved */