Subject: Object file symbols limited to 8 characters [+FIX] (#158 - #1 of 19) Index: cc,as,ld,ar,ranlib,nm,nlist,adb,... (2.11BSD) Description: For some time now (seem like eons;-)) the object file format used by Unix for the PDP-11 has restricted symbols to 8 significant characters (actually 7 due to the C compiler prefixing symbols with a leading tilde (~) or underscore (_)). Aside from the "creative constraints" this imposes on the programmer there was the continuing problem of 'name collisions', especially when porting applications from machines whose object file format permitted longer symbol names. Numerous workarounds have been employed in the past. The most common one relied on a combination of a name collision detection program ('shortc') and the flexname capability of the C preprocessor ('cpp'). This served to mask the problem while making debugging difficult due to mangled/synthetic symbol names. Repeat-By: Attempt to compile the following program: int this_is_a_long_name; int this_is_a_long_name_too; main() { exit(0)}; Fix: This section is repeated in each of the 19 parts which make up the update kit. You should read it perhaps once or twice, but then skip over it (how to do that is mentioned below). Taking a "hint" from the a.out(5) man page: "The compiler will note name collisions when they occur within a single file... There is really little that can be done about this. Some thought is being given to modifying the loader to flag detectable collisions, but the real solution would be to change over to the 4BSD a.out format. This would involve modifying the compiler, assembler and adb and then simply porting the 4.3BSD ld, nm, ranlib, strip and nlist. Or perhaps simply porting the entire 4.3BSD suite might be best ... Anyone interested in a project?" This I have done. No more volunteers for the project need apply ;-) The new limit on symbol length is 32 characters! There is still a limit (but it is _much_ more reasonable now) simply because of address space constraints - it needs to be possible to hold at least one of the 'symbol' or 'string' tables in memory in many cases (nice to hold both, but - i know, get a 486;-)). It must be noted though that it is almost trivial now to raise the limit if that is desired - the programs which need to know the maximum length of a symbol string all have an easily changed #define statement now (usually MAXSYMLEN but there are a couple exceptions). The 'string table' format itself doesn't care how long the strings are. The actual a.out format won't have to change again to accomodate a higher limit on symbol name length! The "string table" object file format has been ported and all the necessary changes made throughout the entire system. The changes were *massive* and widespread. Programs affected of course included the assembler and compiler. Other programs affected were anything which accessed a symbol table entry either via nlist(3) [ps, pstat, fstat, vmstat, etc] or by reading object files [ld, ranlib, nm, adb, strip, etc]. The actual changes to the compiler and assembler were minor because those programs had already been modified earlier (updates #142, 143, 152, 153). The compiler only needed to have the maximum size of a symbol name raised. The assembler already knew how to generate 'string table' object files - all that needed to be done in 'as' was to flip a bit telling it to generate the new object format instead of the old style. +++++++++++++++ And now for a bit of a narrative about what was done. The detailed instructions for applying this part (#1 of 19) of the update kit follow the 'story' below. This started out as a semi-organized accounting of what was done but then devolved into a semi-rambling tale due to the sheer bulk of the changes. You can skip to the details for applying #158 by searching for the string "=======" below - this header is replicated in all parts of this kit. +++++++++++++++ Alas, the remaining changes were not so simple. Complete replacements for ranlib(1), ar(1), nlist(3) were ported from the Net-2 release. Other programs such as symorder(1) and two new programs 'symcompact' and 'strcompact' (used to compress/compact symbol and string tables) were written from scratch. Perhaps the two hardest parts of the whole effort were rewriting the linker 'ld' and making *large* modifications to the debugger 'adb'. This was a very difficult job. 'ld needed to scan new style ranlib archives, as well as using the "virtual memory" facility (the 'libvmf' routines posted earlier) for symbol table management and so on. 'adb' was a MESS (having been written in a pseudo block structured macro language). Since the new symbol table entry could be so much larger than the old it was no longer possible for adb to hold as much of the symbol table in memory - an alternate method took a while to develope and implement, more on that in the patch which deals with adb (actually the changes to adb are so large there are two substantial parts of this update kit just for adb!). After the basic programs (ar, ld, ranlib, etc) were running the system had to be completely recompiled from sources, beginning with the object libraries. After those were done the process of recompiling the rest of the system could proceed. Guess what happens when you recreate libc.a with a buggy linker? Yep - the system is rendered useless until backup copies of everything can be reloaded. Don't let this happen to you - be sure (and i'll repeat the point later) to back up the system (or at least key executables and .a files) before installing this upgrade. In all there were about 330 files modified during the change of object file format. Some of these were not directly related to the new object file format. There were a number of (obsolete) references to "BSD2_10" lingering in the system. Those have been replaced with "pdp11" and the 'BSD2_10' define has been removed from the C preprocessor (cpp). DO NOT use 'BSD2_10' to #ifdef pdp-11 sensitive code, use "pdp11" instead. During the recompile of the libraries a fairly large number of "shortened" names were lengthened - these included syscall routines such as "gethostname" which no longer had to be munged into "gethname". Also a surprising number of typographical errors were uncovered (mainly in the Fortran libraries) where an extra character (beyond the 7th character) was left off or accidentally added. These were all fixed and eventually, after a couple evenings, the libraries were built and installed. After the libraries were done it was the application programs' turn to be recompiled. This took the better part of a couple weeks to finally make it thru due to (as it turned out) the iterative nature of the task. A symbol would come up undefined and have to be tracked down exactly where the wrong definition/use was coming from. Finally, however, the task was done and it was time to move on to the kernel. The kernel proved to be suprisingly easy - no real complications arose except when it came time to reboot, a bug had been introduced into 'autoconfig' (who uses 'nlist' to scan the kernel symbol table). Ouch! That was another couple late nights. Since the compiler supports unsigned longs now a number of small changes which ifdef'd 'u_long' to 'long' were removed. REMEMBER - you need to recompile 'autoconfig' and install it before rebooting the new kernel ;-) The performance of 'ps' though (and anything else which used nlist(3), 'fstat', 'w' are good examples) was unacceptably slow. So, amidst other delays (real work, the earthquake - which almost tossed the disc drive to the floor, etc) the "symorder" program was written (with ideas borrowed from the Net-2 version). The symorder(1) program rather insists on holding both the symbol and string tables in memory - this was a problem (or could be if the kernel symbol table grows much more) so two new and original programs were written: 'symcompact' and 'strcompact'. The first program compacts the symbol table by removing 'register' local variables (they're of no use to anyone - the debugger doesn't/can't do anything with them) and redundant global text symbols (symbols in an overlaid program which are in the root segment do not need both the '~' and '_' symbols present). The second program 'strcompact' is one that any 'string table' based object file system can use. It implements "shared strings" for symbols - if a program has many references to 'error' as a local symbol, why store the string 'error' more than once? Simply store one instance and then update the symbol table entries to all point to the same string! Using both 'strcompact' and 'symcompact' on the /unix image resulted in a file that was 15kb smaller. Running 'symorder' then puts the most frequently used symbols at the front of the symbol table, the performance of 'w', 'pstat', and other programs which nlist(3) the kernel was now acceptable. Some of the parts of this kit are large. The large patch files have been split into pieces which the 'patch' will handle, other parts (the replacement 'ar' sources) were left as a single 'shar' file rather than split them up. Each part of this kit consists of: a 'patchfile' - this is used with the "patch" program to update files. an optional 'script' - this is run ("sh script") to perform initialization, remove files, create directories and so on. an optional 'new.sources' - this is a "shar" file containing complete sources for a program. ALL pathnames are _absolute_ - this way you do not have to "cd" around the system, you should be able to apply all the patches while you are in /tmp (or /usr/tmp - wherever you have the most free space). Be sure that you have at least 40mb free on /usr before rebuilding the system - if you do not then building in stages will be necessary. Part 19 contains the detailed instructions for rebuilding the system _after_ the previous 18 patches have been applied. The patches (#158 thru #175) should be applied in order following the directions in each part. DO NOT recompile anything once the patching has begun until requested to do so in part 19. Many of the system include files are modified and the object file format is being changed - recompilation will not be possible until the transformation of the system and object libraries is complete. AT A MINIMUM you will want to back up the following files (unless you have a known good backup already made) in case you need to recompile something before part 19 is done: /bin/ar /bin/ld /bin/nm /bin/as /usr/bin/ranlib /lib/c0 /lib/crt0.o /lib/mcrt0.o /lib/libc.a /bin/nm /usr/include/*.h /usr/include/sys/*.h In part 19 there is a *complete* list of all files affected (all 336 of them) - you may wish to back those up also. And now the common header ('boilerplate') is over (at last ;-)), let the installation guide begin. As always, the complete 2.11BSD updates are available via anonymous FTP to 'ftp.iipo.gtegsc.com' in the directory /pub/2.11BSD ========== #158 (Part #1 of 19) This part updates the following files. BACK THESE UP if you have any worries about the proceedure or do not have a bootable backup already at hand. /usr/include/arpa/inet.h /usr/include/arpa/nameser.h /usr/include/netdb.h /usr/include/a.out.h /usr/include/nlist.h /usr/include/ar.h /usr/include/ranlib.h /usr/include/short_names.h /usr/include/ndbm.h /usr/include/setjmp.h /usr/include/syscall.h /usr/include/Makefile /usr/lib/lint/llib-lc 0) Be in a temp directory ("cd /tmp" or "cd /usr/tmp") 1) Save the following shar archive to a file (/tmp/158 for example) 2) Unpack the archive: sh 158 3) Run the script: ./script 4) Patch the files: patch -p0 < patchfile 5) Unpack the new source replacements: sh new.sources 6) rm 158 script patchfile new.sources Part 1 of 19 is done. DO NOT rebuild or compile _anything_ at this point! %%%%%%%%%%%%%%%cut here%%%%%%%%%%%%%%% #! /bin/sh # This is a shell archive, meaning: # 1. Remove everything above the #! /bin/sh line. # 2. Save the resulting text in a file. # 3. Execute the file with /bin/sh (not csh) to create: # script # patchfile # new.sources # This archive created: Sat Jan 29 00:43:58 1994 export PATH; PATH=/bin:/usr/bin:$PATH if test -f 'script' then echo shar: "will not over-write existing file 'script'" else sed 's/^X//' << \SHAR_EOF > 'script' X#! /bin/sh X Xrm -f /usr/include/a.out.h Xrm -f /usr/include/nlist.h Xrm -f /usr/include/ar.h Xrm -f /usr/include/ranlib.h Xrm -f /usr/include/short_names.h SHAR_EOF chmod 755 'script' fi if test -f 'patchfile' then echo shar: "will not over-write existing file 'patchfile'" else sed 's/^X//' << \SHAR_EOF > 'patchfile' X*** /usr/include/arpa/inet.h.old Sun Jun 13 22:50:39 1993 X--- /usr/include/arpa/inet.h Fri Dec 31 21:53:27 1993 X*************** X*** 14,20 **** X * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED X * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. X * X! * @(#)inet.h 5.2.1 (2.11BSD GTE) 6/12/93 X */ X X /* X--- 14,20 ---- X * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED X * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. X * X! * @(#)inet.h 5.2.2 (2.11BSD GTE) 12/31/93 X */ X X /* X*************** X*** 21,30 **** X * External definitions for X * functions in inet(3N) X */ X- #ifdef BSD2_10 X- #include /* Hopefully this will go away soon */ X- #endif X- X unsigned long inet_addr(); X char *inet_ntoa(); X struct in_addr inet_makeaddr(); X--- 21,26 ---- X*** /usr/include/arpa/nameser.h.old Mon Apr 26 19:52:58 1993 X--- /usr/include/arpa/nameser.h Mon Jan 10 21:25:21 1994 X*************** X*** 14,21 **** X * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED X * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. X * X! * @(#)nameser.h 5.20 (Berkeley) 10/7/88 X! */ X X /* X * Define constants based on rfc883 X--- 14,21 ---- X * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED X * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. X * X! * @(#)nameser.h 5.20.1 (2.11BSD GTE) 12/31/93 X! */ X X /* X * Define constants based on rfc883 X*************** X*** 127,133 **** X #define BYTE_ORDER BIG_ENDIAN X #endif X #endif /* BYTE_ORDER */ X! #if defined(pdp11) || defined(BSD2_10) X #define BYTE_ORDER PDP_ENDIAN X #endif X X--- 127,133 ---- X #define BYTE_ORDER BIG_ENDIAN X #endif X #endif /* BYTE_ORDER */ X! #if defined(pdp11) X #define BYTE_ORDER PDP_ENDIAN X #endif X X*** /usr/include/netdb.h.old Thu Jan 5 21:56:27 1989 X--- /usr/include/netdb.h Mon Jan 10 21:25:47 1994 X*************** X*** 9,21 **** X * software without specific prior written permission. This software X * is provided ``as is'' without express or implied warranty. X * X! * @(#)netdb.h 5.9 (Berkeley) 4/5/88 X */ X X- #ifdef BSD2_10 X- #include X- #endif X- X /* X * Structures returned by network X * data base library. All addresses X--- 9,17 ---- X * software without specific prior written permission. This software X * is provided ``as is'' without express or implied warranty. X * X! * @(#)netdb.h 5.9.1 (2.11BSD GTE) 12/31/93 X */ X X /* X * Structures returned by network X * data base library. All addresses X*************** X*** 40,50 **** X char *n_name; /* official name of net */ X char **n_aliases; /* alias list */ X int n_addrtype; /* net address type */ X- #ifdef BSD2_10 X- long n_net; /* network # */ X- #else X unsigned long n_net; /* network # */ X- #endif X }; X X struct servent { X--- 36,42 ---- X*************** X*** 76,83 **** X #define NO_DATA 4 /* Valid name, no data record of requested type */ X #define NO_ADDRESS NO_DATA /* no address, look for MX record */ X X- #ifdef BSD2_10 X- long gethostid(); X- #else X unsigned long gethostid(); X- #endif X--- 68,71 ---- X*** /usr/include/ndbm.h.old Thu Jan 5 21:55:54 1989 X--- /usr/include/ndbm.h Mon Jan 10 21:26:31 1994 X*************** X*** 3,9 **** X * All rights reserved. The Berkeley software License Agreement X * specifies the terms and conditions for redistribution. X * X! * @(#)ndbm.h 5.1 (Berkeley) 5/30/85 X */ X X /* X--- 3,9 ---- X * All rights reserved. The Berkeley software License Agreement X * specifies the terms and conditions for redistribution. X * X! * @(#)ndbm.h 5.1.1 (2.11BSD GTE) 12/31/93 X */ X X /* X*************** X*** 10,24 **** X * Hashed key data base library. X */ X #define PBLKSIZ 1024 X! #ifdef BSD2_10 X #define DBLKSIZ 512 X #else X #define DBLKSIZ 4096 X- #endif X- X- #ifdef BSD2_10 X- #define dbm_pagbno dbm_bno /* 8 char limit */ X- #define dbm_dirbno dbm_dno X #endif X X typedef struct { X--- 10,19 ---- X * Hashed key data base library. X */ X #define PBLKSIZ 1024 X! #ifdef pdp11 X #define DBLKSIZ 512 X #else X #define DBLKSIZ 4096 X #endif X X typedef struct { X*** /usr/include/setjmp.h.old Tue Jan 6 01:36:13 1987 X--- /usr/include/setjmp.h Fri Dec 31 23:25:52 1993 X*************** X*** 1,7 **** X! /* setjmp.h 4.1 83/05/03 */ X X typedef int jmp_buf[10]; X- X- #ifdef BSD2_10 X- #define longjmperror _ljerr X- #endif BSD2_10 X--- 1,3 ---- X! /* setjmp.h 4.1 93/12/31 */ X X typedef int jmp_buf[10]; X*** /usr/include/syscall.h.old Mon Mar 15 18:20:43 1993 X--- /usr/include/syscall.h Mon Jan 10 21:26:51 1994 X*************** X*** 3,9 **** X * All rights reserved. The Berkeley software License Agreement X * specifies the terms and conditions for redistribution. X * X! * @(#)syscall.h 5.4 (Berkeley) 4/3/86 X */ X X #define SYS_exit 1 X--- 3,9 ---- X * All rights reserved. The Berkeley software License Agreement X * specifies the terms and conditions for redistribution. X * X! * @(#)syscall.h 5.4.1 (2.11BSD GTE) 12/31/93 X */ X X #define SYS_exit 1 X*************** X*** 158,164 **** X #define SYS_getsockname 150 X X /* X! * BSD2.11 special calls X */ X /* 151 is unused */ X #define SYS_nostk 152 X--- 158,164 ---- X #define SYS_getsockname 150 X X /* X! * 2BSD special calls X */ X /* 151 is unused */ X #define SYS_nostk 152 X*** /usr/include/Makefile.old Sun May 27 00:45:47 1990 X--- /usr/include/Makefile Thu Oct 21 21:08:59 1993 X*************** X*** 3,9 **** X # All rights reserved. The Berkeley software License Agreement X # specifies the terms and conditions for redistribution. X # X! # @(#)Makefile 5.15 (Berkeley) 86/10/13 X # X # Doing a make install builds /usr/include X # X--- 3,9 ---- X # All rights reserved. The Berkeley software License Agreement X # specifies the terms and conditions for redistribution. X # X! # @(#)Makefile 5.16 (2.11BSD GTE) 10/21/93 X # X # Doing a make install builds /usr/include X # X*************** X*** 24,30 **** X netdb.h nlist.h pcc.h pwd.h ranlib.h resolv.h setjmp.h \ X sgtty.h short_names.h stab.h stdio.h string.h strings.h \ X struct.h syscall.h sysexits.h time.h ttyent.h tzfile.h utmp.h \ X! varargs.h vfont.h X LINKS= errno.h signal.h syslog.h X MACHINE=pdp X MACHDEP=${MACHINE} pdpif pdpuba pdpmba vaxuba X--- 24,30 ---- X netdb.h nlist.h pcc.h pwd.h ranlib.h resolv.h setjmp.h \ X sgtty.h short_names.h stab.h stdio.h string.h strings.h \ X struct.h syscall.h sysexits.h time.h ttyent.h tzfile.h utmp.h \ X! varargs.h vfont.h vmf.h X LINKS= errno.h signal.h syslog.h X MACHINE=pdp X MACHDEP=${MACHINE} pdpif pdpuba pdpmba vaxuba X*** /usr/lib/lint/llib-lc.old Sat Mar 13 18:11:24 1993 X--- /usr/lib/lint/llib-lc Sun Jan 16 00:42:08 1994 X*************** X*** 70,76 **** X uid_t geteuid() { return((uid_t)1); } X gid_t getgid() { return((gid_t)1); } X int getgroups( n, g ) int n, *g; { return 0; } X! long gethostid() { return 1L; } X int gethostname( n, l ) char *n; int l; { return 0 ;} X int getitimer( w, v ) struct itimerval *v; { return 0; } X int getpagesize() { return 1; } X--- 70,76 ---- X uid_t geteuid() { return((uid_t)1); } X gid_t getgid() { return((gid_t)1); } X int getgroups( n, g ) int n, *g; { return 0; } X! u_long gethostid() { return 1L; } X int gethostname( n, l ) char *n; int l; { return 0 ;} X int getitimer( w, v ) struct itimerval *v; { return 0; } X int getpagesize() { return 1; } X*************** X*** 221,228 **** X endhostent() { ; } X endnetent() { ; } X endprotoent() { ; } X! endpwent() {} X! endservent() { ; } X endttyent() { ; } X endusershell() { ; } X char ** environ; X--- 221,228 ---- X endhostent() { ; } X endnetent() { ; } X endprotoent() { ; } X! void endpwent() {} X! int endservent() { ; } X endttyent() { ; } X endusershell() { ; } X char ** environ; X*************** X*** 283,290 **** X #endif htons X char * index(s, c) char *s, c; { return s; } X u_long inet_addr(cp) char *cp; { return 0L; } X! long inet_lnaof(in) struct in_addr in; { return 0; } X! long inet_netof(in) struct in_addr in; { return 0; } X struct in_addr inet_makeaddr(net, host) long net, host; { struct in_addr in; return in; } X u_long inet_network(cp) char *cp; { return 0L; } X char * inet_ntoa(in) struct in_addr in; { return (char *) 0; } X--- 283,290 ---- X #endif htons X char * index(s, c) char *s, c; { return s; } X u_long inet_addr(cp) char *cp; { return 0L; } X! u_long inet_lnaof(in) struct in_addr in; { return 0; } X! u_long inet_netof(in) struct in_addr in; { return 0; } X struct in_addr inet_makeaddr(net, host) long net, host; { struct in_addr in; return in; } X u_long inet_network(cp) char *cp; { return 0L; } X char * inet_ntoa(in) struct in_addr in; { return (char *) 0; } X*************** X*** 358,365 **** X int setlogmask(m) { return(0); } X setnetent(stayopen) { ; } X setprotoent(stayopen) { ; } X! setpwent() {} X! setpwfile(file) char *file; {} X int setrgid(rgid) gid_t rgid; { return 0; } X int setruid(ruid) uid_t ruid; { return 0; } X setservent(stayopen) { ; } X--- 358,365 ---- X int setlogmask(m) { return(0); } X setnetent(stayopen) { ; } X setprotoent(stayopen) { ; } X! int setpwent() {} X! void setpwfile(file) char *file; {} X int setrgid(rgid) gid_t rgid; { return 0; } X int setruid(ruid) uid_t ruid; { return 0; } X setservent(stayopen) { ; } SHAR_EOF chmod 640 'patchfile' fi if test -f 'new.sources' then echo shar: "will not over-write existing file 'new.sources'" else sed 's/^X//' << \SHAR_EOF > 'new.sources' X#! /bin/sh X# This is a shell archive, meaning: X# 1. Remove everything above the #! /bin/sh line. X# 2. Save the resulting text in a file. X# 3. Execute the file with /bin/sh (not csh) to create: X# /usr/include/a.out.h X# /usr/include/nlist.h X# /usr/include/ar.h X# /usr/include/ranlib.h X# This archive created: Fri Jan 28 20:56:53 1994 Xexport PATH; PATH=/bin:/usr/bin:$PATH Xif test -f '/usr/include/a.out.h' Xthen X echo shar: "will not over-write existing file '/usr/include/a.out.h'" Xelse Xsed 's/^X//' << \SHAR_EOF > '/usr/include/a.out.h' XX/*- XX * Copyright (c) 1991 The Regents of the University of California. XX * All rights reserved. XX * XX * Redistribution and use in source and binary forms, with or without XX * modification, are permitted provided that the following conditions XX * are met: XX * 1. Redistributions of source code must retain the above copyright XX * notice, this list of conditions and the following disclaimer. XX * 2. Redistributions in binary form must reproduce the above copyright XX * notice, this list of conditions and the following disclaimer in the XX * documentation and/or other materials provided with the distribution. XX * 3. All advertising materials mentioning features or use of this software XX * must display the following acknowledgement: XX * This product includes software developed by the University of XX * California, Berkeley and its contributors. XX * 4. Neither the name of the University nor the names of its contributors XX * may be used to endorse or promote products derived from this software XX * without specific prior written permission. XX * XX * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND XX * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE XX * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE XX * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE XX * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL XX * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS XX * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) XX * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT XX * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY XX * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF XX * SUCH DAMAGE. XX * XX * @(#)a.out.h 5.6.1 (2.11BSD GTE) 1/6/94 XX */ XX XX#ifndef _AOUT_H_ XX#define _AOUT_H_ XX XX#include XX XX#define N_BADMAG(x) \ XX (((x).a_magic)!=A_MAGIC1 && ((x).a_magic)!=A_MAGIC2 && \ XX ((x).a_magic)!=A_MAGIC3 && ((x).a_magic)!=A_MAGIC4 && \ XX ((x).a_magic)!=A_MAGIC5 && ((x).a_magic)!=A_MAGIC6) XX XX#define N_TXTOFF(x) \ XX ((x).a_magic==A_MAGIC5 || (x).a_magic==A_MAGIC6 ? \ XX sizeof(struct ovlhdr) + sizeof(struct exec) : sizeof(struct exec)) XX XX/* XX * The following were added as part of the new object file format. They XX * call functions because calculating the sums of overlay sizes was too XX * messy (and verbose) to do 'inline'. XX * XX * NOTE: if the magic number is that of an overlaid object the program XX * must pass an extended header ('xexec') as the argument. XX*/ XX XX#include XX XXoff_t n_stroff(), n_symoff(), n_datoff(), n_dreloc(), n_treloc(); XX XX#define N_STROFF(e) (n_stroff(&e)) XX#define N_SYMOFF(e) (n_symoff(&e)) XX#define N_DATOFF(e) (n_datoff(&e)) XX#define N_DRELOC(e) (n_dreloc(&e)) XX#define N_TRELOC(e) (n_treloc(&e)) XX XX#define _AOUT_INCLUDE_ XX#include XX XX#endif /* !_AOUT_H_ */ XSHAR_EOF Xchmod 444 '/usr/include/a.out.h' Xfi Xif test -f '/usr/include/nlist.h' Xthen X echo shar: "will not over-write existing file '/usr/include/nlist.h'" Xelse Xsed 's/^X//' << \SHAR_EOF > '/usr/include/nlist.h' XX/*- XX * Copyright (c) 1991 The Regents of the University of California. XX * All rights reserved. XX * XX * Redistribution and use in source and binary forms, with or without XX * modification, are permitted provided that the following conditions XX * are met: XX * 1. Redistributions of source code must retain the above copyright XX * notice, this list of conditions and the following disclaimer. XX * 2. Redistributions in binary form must reproduce the above copyright XX * notice, this list of conditions and the following disclaimer in the XX * documentation and/or other materials provided with the distribution. XX * 3. All advertising materials mentioning features or use of this software XX * must display the following acknowledgement: XX * This product includes software developed by the University of XX * California, Berkeley and its contributors. XX * 4. Neither the name of the University nor the names of its contributors XX * may be used to endorse or promote products derived from this software XX * without specific prior written permission. XX * XX * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND XX * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE XX * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE XX * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE XX * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL XX * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS XX * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) XX * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT XX * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY XX * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF XX * SUCH DAMAGE. XX * XX * @(#)nlist.h 5.6.1 (2.11BSD GTE) 1/15/94 XX */ XX XX#ifndef _NLIST_H_ XX#define _NLIST_H_ XX#include XX XX/* XX * Symbol table entry format. The #ifdef's are so that programs including XX * nlist.h can initialize nlist structures statically. XX */ XX XXstruct oldnlist { /* XXX - compatibility/conversion aid */ XX char n_name[8]; /* symbol name */ XX int n_type; /* type flag */ XXunsigned int n_value; /* value */ XX}; XX XXstruct nlist { XX#ifdef _AOUT_INCLUDE_ XX union { XX char *n_name; /* In memory address of symbol name */ XX off_t n_strx; /* String table offset (file) */ XX } n_un; XX#else XX char *n_name; /* symbol name (in memory) */ XX char *n_filler; /* need to pad out to the union's size */ XX#endif XX u_char n_type; /* Type of symbol - see below */ XX char n_ovly; /* Overlay number */ XX u_int n_value; /* Symbol value */ XX}; XX XX/* XX * Simple values for n_type. XX */ XX#define N_UNDF 0x00 /* undefined */ XX#define N_ABS 0x01 /* absolute */ XX#define N_TEXT 0x02 /* text segment */ XX#define N_DATA 0x03 /* data segment */ XX#define N_BSS 0x04 /* bss segment */ XX#define N_REG 0x14 /* register symbol */ XX#define N_FN 0x1f /* file name */ XX XX#define N_EXT 0x20 /* external (global) bit, OR'ed in */ XX#define N_TYPE 0x1f /* mask for all the type bits */ XX XX#define N_FORMAT "%06o" /* namelist value format; XXX */ XX#endif /* !_NLIST_H_ */ XSHAR_EOF Xchmod 444 '/usr/include/nlist.h' Xfi Xif test -f '/usr/include/ar.h' Xthen X echo shar: "will not over-write existing file '/usr/include/ar.h'" Xelse Xsed 's/^X//' << \SHAR_EOF > '/usr/include/ar.h' XX/*- XX * Copyright (c) 1991 The Regents of the University of California. XX * All rights reserved. XX * XX * This code is derived from software contributed to Berkeley by XX * Hugh Smith at The University of Guelph. XX * XX * Redistribution and use in source and binary forms, with or without XX * modification, are permitted provided that the following conditions XX * are met: XX * 1. Redistributions of source code must retain the above copyright XX * notice, this list of conditions and the following disclaimer. XX * 2. Redistributions in binary form must reproduce the above copyright XX * notice, this list of conditions and the following disclaimer in the XX * documentation and/or other materials provided with the distribution. XX * 3. All advertising materials mentioning features or use of this software XX * must display the following acknowledgement: XX * This product includes software developed by the University of XX * California, Berkeley and its contributors. XX * 4. Neither the name of the University nor the names of its contributors XX * may be used to endorse or promote products derived from this software XX * without specific prior written permission. XX * XX * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND XX * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE XX * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE XX * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE XX * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL XX * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS XX * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) XX * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT XX * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY XX * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF XX * SUCH DAMAGE. XX * XX * @(#)ar.h 5.4 (Berkeley) 4/3/91 XX */ XX XX#ifndef _AR_H_ XX#define _AR_H_ XX XX/* Pre-4BSD archives had these magic numbers in them. */ XX#define OARMAG1 0177555 XX#define OARMAG2 0177545 XX XX#define ARMAG "!\n" /* ar "magic number" */ XX#define SARMAG 8 /* strlen(ARMAG); */ XX XX#define AR_EFMT1 "#1/" /* extended format #1 */ XX XXstruct ar_hdr { XX char ar_name[16]; /* name */ XX char ar_date[12]; /* modification time */ XX char ar_uid[6]; /* user id */ XX char ar_gid[6]; /* group id */ XX char ar_mode[8]; /* octal file permissions */ XX char ar_size[10]; /* size in bytes */ XX#define ARFMAG "`\n" XX char ar_fmag[2]; /* consistency check */ XX}; XX XX#endif /* !_AR_H_ */ XSHAR_EOF Xchmod 444 '/usr/include/ar.h' Xfi Xif test -f '/usr/include/ranlib.h' Xthen X echo shar: "will not over-write existing file '/usr/include/ranlib.h'" Xelse Xsed 's/^X//' << \SHAR_EOF > '/usr/include/ranlib.h' XX/*- XX * Copyright (c) 1990 The Regents of the University of California. XX * All rights reserved. XX * XX * Redistribution and use in source and binary forms, with or without XX * modification, are permitted provided that the following conditions XX * are met: XX * 1. Redistributions of source code must retain the above copyright XX * notice, this list of conditions and the following disclaimer. XX * 2. Redistributions in binary form must reproduce the above copyright XX * notice, this list of conditions and the following disclaimer in the XX * documentation and/or other materials provided with the distribution. XX * 3. All advertising materials mentioning features or use of this software XX * must display the following acknowledgement: XX * This product includes software developed by the University of XX * California, Berkeley and its contributors. XX * 4. Neither the name of the University nor the names of its contributors XX * may be used to endorse or promote products derived from this software XX * without specific prior written permission. XX * XX * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND XX * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE XX * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE XX * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE XX * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL XX * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS XX * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) XX * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT XX * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY XX * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF XX * SUCH DAMAGE. XX * XX * @(#)ranlib.h 5.2 (Berkeley) 4/3/91 XX */ XX XX#ifndef _RANLIB_H_ XX#define _RANLIB_H_ XX XX#define RANLIBMAG "__.SYMDEF" /* archive file name */ XX#define RANLIBSKEW 3 /* creation time offset */ XX XXstruct ranlib { XX union { XX off_t ran_strx; /* string table index */ XX char *ran_name; /* in memory symbol name */ XX } ran_un; XX off_t ran_off; /* archive file offset */ XX}; XX XX#endif /* !_RANLIB_H_ */ XSHAR_EOF Xchmod 444 '/usr/include/ranlib.h' Xfi Xexit 0 X# End of shell archive SHAR_EOF chmod 640 'new.sources' fi exit 0 # End of shell archive