Subject: Object file symbols limited to 8 characters [+FIX] (#176 - #19 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 final (part 19 of 19) part contains the sequences of steps which will convert a system to the new object file format. Do not try to do this in a hurry - the total recompilation of the system will take about 18 hours or so on a 11/73. Once the patching process has started you will not be able to recompile anything until the libraries (at a minimum) have been rebuilt and the new linker, assembler, compiler, ranlib, ar are in place. As always, the complete 2.11BSD updates are available via anonymous FTP to 'ftp.iipo.gtegsc.com' in the directory /pub/2.11BSD Be sure that you have all previous 18 parts (#158 thru 175 inclusive) before starting. Please read the complete article at least once! Each part has instructions specific to that part's installation. Thought was given to a more detailed explanation of why each file was modified but with 336 files (at last count) that idea was not practical. There were a number of files changed to replace 'BSD2_10' with pdp11 but the majority of the files were changed for these reasons: 1) They had references to 'truncated'/shortened names which could now be removed since the symbol length is greater than 7 characters. There were also a few typographical errors in variable names that did not show up until additional characters became significant. 2) There were references to the 'nlist' structure either via including a.out.h or nlist.h 3) 'adb' was almost rewritten - the diffs for adb came to around 100kb alone! 4) New replacements for programs: ar, ranlib, symorder, symcompact, strcompact and ld are totally new. 5) Files such as "shortnames.h" and "short_name.h", etc were deleted and references to them removed since these "workarounds" to the short symbol names were no longer needed. There are a number of files (kernel configuration files, kernel Makefiles, etc) where only the 'GENERIC' (or a representative example) is patched - you must then go perform a similar action on any local copies you may have on your system. Example: /sys/conf/GENERIC may be patched, you should then go and apply the same change to /sys/conf/MYKERNEL, and so on. NOTE: If you are not sure which 'SPL' script to copy (or how to modify your existing one) then it might be best to reconfigure your kernel starting over (preserving your current overlay setup). ========== #176 (Part #19 of 19) The exact proceedure for completing the update of the system is: 0) Look at the manifest of files included below. If you have a current back you may want to skip saving these files. 1) Apply each of the patches in 158 thru 175 by following the directions provided. DO NOT recompile anything just yet. 2) Using the existing assembler and compiler rebuild the following programs: c0, as, ld, ar, ranlib but DO NOT INSTALL them yet. First we _temporarily_ need to restore the unpatched version of 'stat.h', it has some long names that can't be handled yet: cp -p /sys/h/stat.h /sys/h/stat.h.new cp -p /sys/h/stat.h~ /sys/h/stat.h Then we need to put a module into libc.a that is needed by 'ld': cd /usr/src/lib/libc/pdp/gen cc -O -c nsym.c ar rv /lib/libc.a nsym.o ranlib /lib/libc.a rm nsym.o cd /usr/src/lib/ccom make cd /usr/src/lib/c2 make cd /usr/src/bin/as make cd /usr/src/bin/ld make cd /usr/src/bin/ar make cd /usr/src/usr.bin/ranlib make cd /usr/src/bin/nm make 3) Install the programs above with the commands: cd /usr/src/lib/ccom make install make clean cd /usr/src/lib/c2 make install make clean cd /usr/src/bin/as make install make clean cd /usr/src/bin/ld make install make clean cd /usr/src/bin/ar make install make clean cd /usr/src/usr.bin/ranlib make install make clean cd /usr/src/bin/nm make install make clean You now have a system that can not be used to compile application programs - the only thing that can be done now is recompile the libraries! 4) Due to a bug in the makefiles (actually 'sendmail' is misplaced, it really shouldn't be in /usr/src/usr.lib) there is one library which must be created out of sequence: cd /usr/src/usr.lib/libdbm make make install make clean The 'stat.h' file is now put back: mv /sys/h/stat.h.new /sys/h/stat.h Now it is time to do the complete recompile of the system. This will take quite a while. You will need at least 35mb of space free on /usr to hold the objects and new executables that are built. This space will be freed during the "make install" phase. 5) This assumes you are using 'csh', if you are using 'sh' then substitute the appropriate redirection syntax. cd /usr/src make build >>& /tmp/log & You can monitor the progress of the build with 'tail -f /tmp/log' if you wish. 'csh' syntax for redirecting both stderr and stdout has been used - if you use the Bourne shell then substitute the appropriate syntax. Eventually the recompile will finish. You should check the logfile for any errors - there may be a few warning errors from the compiler (these are normal) but there should be no fatal errors at all. If there are errors you will need to fix them before proceeding further. NOTE: if you do have any errors and correct them you can save some time by not including the word 'build' above. IF the libraries (/lib/libc.a, /usr/lib/*.a) have successfully been installed then you do not need to perform the extra steps that a 'make build' includes. If all has successfully been built then it is time to install things: cp -p /etc/termcap /etc/termcap.save cd /usr/src make installsrc >>& /tmp/log.install& mv /etc/termcap.save /etc/termcap Again, you can monitor the progress with 'tail -f /tmp/log.install' if you want to. The 'csh' syntax for redirecting both stderr and stdout has been used - if you use the Bourne shell then substitute the appropriate syntax. 6) Just when you thought everything was done along comes yet more lengthy recompiliation. We need to rebuild the kernel and the autoconfigure program: a) You must have updated the /sys/YOUR_KERNEL/Makefile, /sys/YOUR_KERNEL/SPLFIX and /sys/YOUR_KERNEL/NETSPLFIX (the latter only if you are building a networking system) files. b) cd /sys/autoconfig make make install make clean c) cd /sys/YOUR_KERNEL make clean make make install 7) Now reboot the system: reboot Here is the master list of all files modified by patches 158 thru 175: /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 /usr/src/sys/pdpuba/dz.c /usr/src/sys/conf/spl/:splfix.mfps /usr/src/sys/conf/spl/:splfix.movb /usr/src/sys/conf/spl/:splfix.movb+mfps /usr/src/sys/conf/spl/:splfix.mtps /usr/src/sys/conf/spl/:splfix.profil /usr/src/sys/conf/spl/:splfix.spl /usr/src/sys/conf/spl_3com/:splfix.mfps /usr/src/sys/conf/spl_3com/:splfix.movb /usr/src/sys/conf/spl_3com/:splfix.movb+mfps /usr/src/sys/conf/spl_3com/:splfix.mtps /usr/src/sys/conf/spl_3com/:splfix.profil /usr/src/sys/conf/spl_3com/:splfix.spl /usr/src/sys/conf/Make.pdp /usr/src/sys/conf/netbind.c /usr/src/sys/conf/checksys.c /usr/src/sys/conf/Make.nsunix /usr/src/sys/conf/Make.sunix /usr/src/sys/conf/Make.unix /usr/src/sys/conf/GENERIC /usr/src/sys/sys/tty.c /usr/src/sys/sys/init_sysent.c /usr/src/sys/sys/quota_sys.c /usr/src/sys/sys/kern_fork.c /usr/src/sys/sys/kern_clock.c /usr/src/sys/sys/kern_time.c /usr/src/sys/sys/ufs_inode.c /usr/src/sys/sys/sys_generic.c /usr/src/sys/sys/kern_sig.c /usr/src/sys/sys/syscalls.c /usr/src/sys/sys/uipc_usrreq.c /usr/src/sys/sys/quota_kern.c /usr/src/sys/sys/quota_ufs.c /usr/src/sys/sys/subr_log.c /usr/src/sys/sys/uipc_syscalls.c /usr/src/sys/net/if.h /usr/src/sys/h/exec.h /usr/src/sys/h/param.h /usr/src/sys/h/socket.h /usr/src/sys/h/mbuf.h /usr/src/sys/h/stat.h /usr/src/sys/h/socketvar.h /usr/src/sys/netimp/if_imp.c /usr/src/sys/autoconfig/read_dtab.c /usr/src/sys/autoconfig/read_nlist.c /usr/src/sys/autoconfig/attach.c /usr/src/sys/autoconfig/do_config.c /usr/src/sys/netns/ns.h /usr/src/sys/netns/spp_var.h /usr/src/sys/pdp/mch_xxx.s /usr/src/sys/pdp/mch_trap.s /usr/src/sys/pdp/mch_copy.s /usr/src/sys/pdp/symbols.raw /usr/src/sys/netinet/in.h /usr/src/sys/netinet/in_systm.h /usr/src/sys/netinet/ip_acct.h /usr/src/sys/netinet/ip_var.h /usr/src/sys/netinet/ip_input.c /usr/src/sys/netinet/icmp_var.h /usr/src/sys/OTHERS/bad144/bad144.c /usr/src/sys/pdpif/if_de.c /usr/src/sys/pdpif/if_de.h /usr/src/sys/pdpif/if_il.h /usr/src/sys/pdpif/if_en.c /usr/src/sys/pdpif/if_dereg.h /usr/src/sys/GENERIC/Make.pdp /usr/src/sys/GENERIC/Makefile /usr/src/sys/GENERIC/ra.h /usr/src/sys/GENERIC/SPLFIX /usr/src/include/arpa/inet.h /usr/src/include/arpa/nameser.h /usr/src/include/a.out.h /usr/src/include/short_names.h /usr/src/include/ar.h /usr/src/include/ndbm.h /usr/src/include/netdb.h /usr/src/include/nlist.h /usr/src/include/ranlib.h /usr/src/include/setjmp.h /usr/src/include/syscall.h /usr/src/bin/csh/sh.time.c /usr/src/bin/csh/sh.h /usr/src/bin/csh/shortnames.h /usr/src/bin/make/doname.c /usr/src/bin/make/files.c /usr/src/bin/make/Makefile /usr/src/bin/diff/diffreg.c /usr/src/bin/as/as0.s /usr/src/bin/login/login.c /usr/src/bin/ld.c /usr/src/bin/who.c /usr/src/bin/nm.c /usr/src/bin/adb /usr/src/bin/Makefile /usr/src/bin/ar.c /usr/src/bin/mail.c /usr/src/bin/write.c /usr/src/bin/hostname.c /usr/src/bin/wall.c /usr/src/bin/df.c /usr/src/bin/hostid.c /usr/src/bin/strip.c /usr/src/bin/size.c /usr/src/bin/ps.c /usr/src/etc/termcap/Makefile /usr/src/etc/getty/gettytab.h /usr/src/etc/routed/af.c /usr/src/etc/routed/defs.h /usr/src/etc/htable/htable.c /usr/src/etc/timed/cmds.c /usr/src/etc/timed/cmdtab.c /usr/src/etc/timed/globals.h /usr/src/etc/timed/timed.c /usr/src/etc/timed/timedc.h /usr/src/etc/named/tools/nslookup/res.h /usr/src/etc/named/tools/nslookup/shortnames.h /usr/src/etc/named/named/db_lookup.c /usr/src/etc/named/named/db_save.c /usr/src/etc/named/named/storage.c /usr/src/etc/named/named/ns.h /usr/src/etc/named/named/shortnames.h /usr/src/etc/named/named/Makefile /usr/src/etc/talkd/talkd.c /usr/src/etc/talkd/announce.c /usr/src/etc/talkd/print.c /usr/src/etc/talkd/process.c /usr/src/etc/talkd/table.c /usr/src/etc/talkd/shortnames.h /usr/src/etc/tftpd/tftpd.c /usr/src/etc/fstat.c /usr/src/etc/shutdown.c /usr/src/etc/syslogd.c /usr/src/etc/pstat.c /usr/src/etc/sa.c /usr/src/etc/route.c /usr/src/etc/dmesg.c /usr/src/etc/reboot.c /usr/src/etc/arp.c /usr/src/etc/init.c /usr/src/etc/telnetd.c /usr/src/etc/edquota.c /usr/src/etc/quotacheck.c /usr/src/etc/ifconfig.c /usr/src/etc/repquota.c /usr/src/etc/inetd.c /usr/src/etc/mkfs.c /usr/src/etc/savecore.c /usr/src/games/pdp/chess/old.h /usr/src/games/pdp/chess/data.c /usr/src/games/pdp/chess/stat.c /usr/src/games/warp/intrp.c /usr/src/games/warp/Makefile /usr/src/games/snake/busy.c /usr/src/games/hack/config.h /usr/src/games/sail/player.h /usr/src/games/canfield.c /usr/src/lib/c2/c2.h /usr/src/lib/c2/c21.c /usr/src/lib/cpp/Makefile /usr/src/lib/ccom/c0.h /usr/src/lib/libc/gen/nlist.c /usr/src/lib/libc/gen/syslog.c /usr/src/lib/libc/gen/Makefile /usr/src/lib/libc/net/named/gethnamadr.c /usr/src/lib/libc/net/named/Makefile /usr/src/lib/libc/net/Makefile /usr/src/lib/libc/pdp/gen/nsym.c /usr/src/lib/libc/pdp/gen/Makefile /usr/src/lib/libc/pdp/gen/rollback.s /usr/src/lib/libc/pdp/gen/setjmp.s /usr/src/lib/libc/pdp/csu/mcount.s /usr/src/lib/libc/pdp/sys/gethostname.s /usr/src/lib/libc/pdp/sys/getsockname.s /usr/src/lib/libc/pdp/sys/gethostid.s /usr/src/lib/libc/pdp/sys/sethostid.s /usr/src/lib/libc/pdp/sys/sethostname.s /usr/src/lib/libc/stdio/getw.c /usr/src/lib/libc/stdio/putw.c /usr/src/lib/libc/inet/inet_addr.c /usr/src/local/mkovmake/mkovmake.c /usr/src/local/welcome/welcome.c /usr/src/local/less/makefile /usr/src/man/man1/make.1 /usr/src/man/man1/symorder.1 /usr/src/man/man1/Makefile /usr/src/man/man1/strcompact.1 /usr/src/man/man1/symcompact.1 /usr/src/man/man5/a.out.5 /usr/src/new/nntp/inews/uname.c /usr/src/new/nntp/server/common.h /usr/src/new/ansi/ansitape.c /usr/src/new/jove/tune.h /usr/src/new/jove/util.c /usr/src/new/pathalias/local.c /usr/src/new/checkobj/checkobj.c /usr/src/new/rn/intrp.c /usr/src/new/bm/bm.c /usr/src/new/crash/crash.c /usr/src/new/crash/route.c /usr/src/new/rcs/src/rcssyn.c /usr/src/new/rcs/src/sccstorcs.c /usr/src/new/ntp/Makefile /usr/src/new/news/src/uname.c /usr/src/new/tcsh/sh.c /usr/src/new/kermit5.188/makefile /usr/src/ucb/Mail/Makefile /usr/src/ucb/ex/expreserve.c /usr/src/ucb/indent/indent_globs.h /usr/src/ucb/pascal/pxp/fdec.c /usr/src/ucb/ftp/ruserpass.c /usr/src/ucb/ftp/cmdtab.c /usr/src/ucb/ftp/ftp_var.h /usr/src/ucb/netstat/host.c /usr/src/ucb/netstat/main.c /usr/src/ucb/netstat/if.c /usr/src/ucb/netstat/inet.c /usr/src/ucb/netstat/mbuf.c /usr/src/ucb/netstat/ns.c /usr/src/ucb/netstat/route.c /usr/src/ucb/netstat/unix.c /usr/src/ucb/tftp/tftp.c /usr/src/ucb/window/scanner.c /usr/src/ucb/window/main.c /usr/src/ucb/window/ww.h /usr/src/ucb/window/tt.h /usr/src/ucb/window/var.c /usr/src/ucb/window/parser.h /usr/src/ucb/window/local.h /usr/src/ucb/window/shortnames.h /usr/src/ucb/window/tttermcap.c /usr/src/ucb/window/Makefile /usr/src/ucb/lock/lock.c /usr/src/ucb/tn3270/Makefile /usr/src/ucb/tn3270/tn3270.c /usr/src/ucb/tn3270/keyboard.c /usr/src/ucb/tn3270/ebctab.c /usr/src/ucb/tn3270/asctab.c /usr/src/ucb/tn3270/termin.c /usr/src/ucb/tn3270/datastream.c /usr/src/ucb/tn3270/screen.c /usr/src/ucb/tn3270/mset.c /usr/src/ucb/tn3270/map3270.c /usr/src/ucb/tn3270/options.c /usr/src/ucb/tn3270/ectype.c /usr/src/ucb/tn3270/shortnames.h /usr/src/ucb/talk/talk.h /usr/src/ucb/vmstat.c /usr/src/ucb/telnet.c /usr/src/ucb/quota.c /usr/src/ucb/lastcomm.c /usr/src/ucb/strings.c /usr/src/ucb/tail.c /usr/src/ucb/tcopy.c /usr/src/ucb/gcore.c /usr/src/ucb/w.c /usr/src/ucb/symorder.c /usr/src/ucb/Makefile /usr/src/ucb/symcompact.c /usr/src/ucb/strcompact.c /usr/src/usr.bin/diff3/diff3.c /usr/src/usr.bin/tbl/t..c /usr/src/usr.bin/refer/glue5.c /usr/src/usr.bin/refer/refer..c /usr/src/usr.bin/refer/refer5.c /usr/src/usr.bin/refer/lookbib.c /usr/src/usr.bin/uucp/aculib/bsdtcp.c /usr/src/usr.bin/uucp/uucp.h /usr/src/usr.bin/uucp/acucntrl.c /usr/src/usr.bin/uucp/condevs.h /usr/src/usr.bin/uucp/uucpd.c /usr/src/usr.bin/tip/aculib/courier.c /usr/src/usr.bin/tip/aculib/Makefile /usr/src/usr.bin/tip/tip.h /usr/src/usr.bin/f77/proc.c /usr/src/usr.bin/f77/gram.dcl /usr/src/usr.bin/prof/prof.c /usr/src/usr.bin/find/find.c /usr/src/usr.bin/ranlib.c /usr/src/usr.bin/Makefile /usr/src/usr.bin/fgrep.c /usr/src/usr.bin/install.c /usr/src/usr.bin/bc.y /usr/src/usr.lib/libcurses/Makefile /usr/src/usr.lib/libI77/dofio.c /usr/src/usr.lib/libI77/nmlio.h /usr/src/usr.lib/libI77/rsnmle.c /usr/src/usr.lib/libln/reject.c /usr/src/usr.lib/libplot/gigi/gigi.h /usr/src/usr.lib/libplot/gigi/Makefile /usr/src/usr.lib/libplot/plot/Makefile /usr/src/usr.lib/libplot/aed/Makefile /usr/src/usr.lib/libplot/t4013/Makefile /usr/src/usr.lib/libplot/tf77/Makefile /usr/src/usr.lib/libplot/t300/Makefile /usr/src/usr.lib/libplot/t300s/Makefile /usr/src/usr.lib/libplot/t4014/Makefile /usr/src/usr.lib/libplot/t450/Makefile /usr/src/usr.lib/libplot/hp2648/hp2648.h /usr/src/usr.lib/libplot/hp2648/Makefile /usr/src/usr.lib/libplot/vt0/Makefile /usr/src/usr.lib/libplot/hp7221/hp7221.h /usr/src/usr.lib/libplot/hp7221/Makefile /usr/src/usr.lib/libplot/dumb/dumb.h /usr/src/usr.lib/libplot/dumb/Makefile /usr/src/usr.lib/libplot/bitgraph/arc.c /usr/src/usr.lib/libplot/bitgraph/bg.h /usr/src/usr.lib/libplot/bitgraph/Makefile /usr/src/usr.lib/libplot/imagen/Makefile /usr/src/usr.lib/sendmail/src/daemon.c /usr/src/usr.lib/sendmail/src/conf.h /usr/src/usr.lib/sendmail/src/conf.c /usr/src/usr.lib/lpr/filters/vplotf.c /usr/src/usr.lib/lpr/lpr.c /usr/src/usr.lib/lpr/cmds.c /usr/src/usr.lib/lpr/cmdtab.c /usr/src/usr.lib/lpr/lpd.c /usr/src/usr.lib/lpr/lpc.c /usr/src/usr.lib/lpr/recvjob.c /usr/src/usr.lib/lpr/startdaemon.c /usr/src/usr.lib/libutil/Makefile /usr/src/usr.lib/sendmail.MX/src/conf.c /usr/src/usr.lib/sendmail.MX/src/conf.h /usr/src/usr.lib/sendmail.MX/src/err.c