changeset 96732:1e0b67e40d48

* systty.h: Remove code for Aix on 386, unsupported platform. * s/ms-w32.h: Remove boilerplate comments. (fcloseall, fgetchar, flushall, fputchar, getw, putw): Remove, unused. * s/gnu-linux.h (TERM): Remove support. (HAVE_SYSVIPC): Remove, unused. (A_TEXT_OFFSET, A_TEXT_SEEK, ADJUST_EXEC_HEADER): Remove, not used for this system. * process.c: Remove support for IRIS, unused. Remove support for TERM, not relevant anymore. * unexalpha.c (DEFAULT_ENTRY_ADDRESS): Remove, replace the only used with the definition. * s/aix4-2.h (static): Do not undef. * m/ibmrs6000.h: Remove code depending on USG5_4, this file is only used on Aix. (HAVE_SYSVIPC): Remove, unused. * m/hp800.h (CANNOT_DUMP): Do not undef. * m/alpha.h: Fix comment. * s/usg5-4.h (HAVE_SYSVIPC): Remove, unused. (USG_SHARED_LIBRARIES): Remove, only used in unexec.c which is not used by this configuration. * emacs.c: Remove code depending on USG_SHARED_LIBRARIES. * unexec.c: Remove code depending on HPUX and USG_SHARED_LIBRARIES, not used with this file. Remove code depending on IRIS, unused. Remove if 0-ed code.
author Dan Nicolaescu <dann@ics.uci.edu>
date Wed, 16 Jul 2008 08:06:18 +0000
parents 79339db0a32f
children c1059cece4e3
files src/ChangeLog src/m/alpha.h src/m/hp800.h src/m/ibmrs6000.h src/process.c src/s/aix4-2.h src/s/gnu-linux.h src/s/ms-w32.h src/systty.h src/unexalpha.c src/unexec.c
diffstat 11 files changed, 37 insertions(+), 398 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog	Wed Jul 16 07:55:50 2008 +0000
+++ b/src/ChangeLog	Wed Jul 16 08:06:18 2008 +0000
@@ -1,5 +1,31 @@
 2008-07-16  Dan Nicolaescu  <dann@ics.uci.edu>
 
+	* systty.h: Remove code for Aix on 386, unsupported platform.
+
+	* s/ms-w32.h: Remove boilerplate comments.
+	(fcloseall, fgetchar, flushall, fputchar, getw, putw): Remove, unused.
+
+	* s/gnu-linux.h (TERM): Remove support.
+	(HAVE_SYSVIPC): Remove, unused.
+	(A_TEXT_OFFSET, A_TEXT_SEEK, ADJUST_EXEC_HEADER): Remove, not used
+	for this system.
+
+	* process.c: Remove support for IRIS, unused.
+	Remove support for TERM, not relevant anymore.
+
+	* unexalpha.c (DEFAULT_ENTRY_ADDRESS): Remove, replace the only
+	used with the definition.
+
+	* s/aix4-2.h (static): Do not undef.
+
+	* m/ibmrs6000.h: Remove code depending on USG5_4, this file is
+	only used on Aix.
+	(HAVE_SYSVIPC): Remove, unused.
+
+	* m/hp800.h (CANNOT_DUMP): Do not undef.
+
+	* m/alpha.h: Fix comment.
+
 	* s/usg5-4.h (HAVE_SYSVIPC): Remove, unused.
 	(USG_SHARED_LIBRARIES): Remove, only used in unexec.c which is not
 	used by this configuration.
--- a/src/m/alpha.h	Wed Jul 16 07:55:50 2008 +0000
+++ b/src/m/alpha.h	Wed Jul 16 08:06:18 2008 +0000
@@ -44,9 +44,7 @@
 #define NO_ARG_ARRAY
 
 /* Now define a symbol for the cpu type, if your compiler
-   does not define it automatically:
-   Ones defined so far include vax, m68000, ns16000, pyramid,
-   orion, tahoe, APOLLO and many others */
+   does not define it automatically.  */
 
 /* __alpha defined automatically */
 
--- a/src/m/hp800.h	Wed Jul 16 07:55:50 2008 +0000
+++ b/src/m/hp800.h	Wed Jul 16 08:06:18 2008 +0000
@@ -45,12 +45,6 @@
 
 #if defined (__hpux) || defined (GNU_LINUX)
 
-/* Define CANNOT_DUMP on machines where unexec does not work.
-   Then the function dump-emacs will not be defined
-   and temacs will do (load "loadup") automatically unless told otherwise.  */
-
-#undef CANNOT_DUMP
-
 /* Define NO_REMAP if memory segmentation makes it not work well
    to change the boundary between the text section and data section
    when Emacs is dumped.  If you define this, the preloaded Lisp
--- a/src/m/ibmrs6000.h	Wed Jul 16 07:55:50 2008 +0000
+++ b/src/m/ibmrs6000.h	Wed Jul 16 08:06:18 2008 +0000
@@ -41,13 +41,6 @@
 
 #define IBMR2AIX
 
-/* Define CANNOT_DUMP on machines where unexec does not work.
-   Then the function dump-emacs will not be defined
-   and temacs will do (load "loadup") automatically unless told otherwise.  */
-#ifdef USG5_4
-#define CANNOT_DUMP
-#endif
-
 #ifndef UNEXEC
 #define UNEXEC unexaix.o
 #endif
@@ -73,24 +66,6 @@
 #define DATA_SEG_BITS 0
 #endif
 
-#ifdef CANNOT_DUMP
-/* Define shared memory segment symbols */
-
-#define PURE_SEG_BITS 0x30000000
-
-/* Use shared memory.  */
-/* This is turned off because it does not always work.  See etc/AIX.DUMP.  */
-/* #define HAVE_SHM */
-#endif /* CANNOT_DUMP */
-
-#define N_BADMAG(x) BADMAG(x)
-#define N_TXTOFF(x) A_TEXTPOS(x)
-#define N_SYMOFF(x) A_SYMPOS(x)
-#define A_TEXT_OFFSET(HDR) sizeof(HDR)
-/* #define ADJUST_EXEC_HEADER \
-    unexec_text_start += sizeof(hdr); \
-    unexec_data_start = ohdr.a_dbase
-*/
 #undef ADDR_CORRECT
 #define ADDR_CORRECT(x) ((int)(x))
 
@@ -118,7 +93,6 @@
 #endif
 
 #define START_FILES
-#define HAVE_SYSVIPC
 /*** BUILD 9008 - FIONREAD problem still exists in X-Windows. ***/
 #define BROKEN_FIONREAD
 /* As we define BROKEN_FIONREAD, SIGIO will be undefined in systty.h.
@@ -130,9 +104,6 @@
 #define BROKEN_SIGPTY
 #define BROKEN_SIGPOLL
 
-/* Don't try to include ptem.h.  */
-#undef NEED_PTEM_H
-
 #define ORDINARY_LINK
 
 #ifndef USG5_4
--- a/src/process.c	Wed Jul 16 07:55:50 2008 +0000
+++ b/src/process.c	Wed Jul 16 08:06:18 2008 +0000
@@ -68,11 +68,6 @@
 #endif
 #endif /* HAVE_SOCKETS */
 
-/* TERM is a poor-man's SLIP, used on GNU/Linux.  */
-#ifdef TERM
-#include <client.h>
-#endif
-
 #if defined(BSD_SYSTEM)
 #include <sys/ioctl.h>
 #if !defined (O_NDELAY) && defined (HAVE_PTYS) && !defined(USG5)
@@ -95,10 +90,6 @@
 #endif
 #endif
 
-#ifdef IRIS
-#include <sys/sysmacros.h>	/* for "minor" */
-#endif /* not IRIS */
-
 #ifdef HAVE_SYS_WAIT
 #include <sys/wait.h>
 #endif
@@ -259,11 +250,6 @@
 #endif /* DATAGRAM_SOCKETS */
 #endif /* BROKEN_DATAGRAM_SOCKETS */
 
-#ifdef TERM
-#undef NON_BLOCKING_CONNECT
-#undef DATAGRAM_SOCKETS
-#endif
-
 #if !defined (ADAPTIVE_READ_BUFFERING) && !defined (NO_ADAPTIVE_READ_BUFFERING)
 #ifdef EMACS_HAS_USECS
 #define ADAPTIVE_READ_BUFFERING
@@ -542,14 +528,6 @@
 	PTY_OPEN;
 #else /* no PTY_OPEN */
 	{
-# ifdef IRIS
-	  /* Unusual IRIS code */
-	  *ptyv = emacs_open ("/dev/ptc", O_RDWR | O_NDELAY, 0);
-	  if (fd < 0)
-	    return -1;
-	  if (fstat (fd, &stb) < 0)
-	    return -1;
-# else /* not IRIS */
 	  { /* Some systems name their pseudoterminals so that there are gaps in
 	       the usual sequence - for example, on HP9000/S700 systems, there
 	       are no pseudoterminals with names ending in 'f'.  So we wait for
@@ -571,7 +549,6 @@
 #  else
 	  fd = emacs_open (pty_name, O_RDWR | O_NDELAY, 0);
 #  endif
-# endif /* not IRIS */
 	}
 #endif /* no PTY_OPEN */
 
@@ -587,11 +564,11 @@
 	    if (access (pty_name, 6) != 0)
 	      {
 		emacs_close (fd);
-# if !defined(IRIS) && !defined(__sgi)
+# ifndef __sgi
 		continue;
 # else
 		return -1;
-# endif /* IRIS */
+# endif /* __sgi */
 	      }
 	    setup_pty (fd);
 	    return fd;
@@ -3208,7 +3185,7 @@
     {
       /* Don't support network sockets when non-blocking mode is
 	 not available, since a blocked Emacs is not useful.  */
-#if defined(TERM) || (!defined(O_NONBLOCK) && !defined(O_NDELAY))
+#if !defined(O_NONBLOCK) && !defined(O_NDELAY)
       error ("Network servers not supported");
 #else
       is_server = 1;
@@ -3238,32 +3215,6 @@
 
   CHECK_STRING (name);
 
-#ifdef TERM
-  /* Let's handle TERM before things get complicated ...   */
-  host = Fplist_get (contact, QChost);
-  CHECK_STRING (host);
-
-  service = Fplist_get (contact, QCservice);
-  if (INTEGERP (service))
-    port = htons ((unsigned short) XINT (service));
-  else
-    {
-      struct servent *svc_info;
-      CHECK_STRING (service);
-      svc_info = getservbyname (SDATA (service), "tcp");
-      if (svc_info == 0)
-	error ("Unknown service: %s", SDATA (service));
-      port = svc_info->s_port;
-    }
-
-  s = connect_server (0);
-  if (s < 0)
-    report_file_error ("error creating socket", Fcons (name, Qnil));
-  send_command (s, C_PORT, 0, "%s:%d", SDATA (host), ntohs (port));
-  send_command (s, C_DUMB, 1, 0);
-
-#else  /* not TERM */
-
   /* Initialize addrinfo structure in case we don't use getaddrinfo.  */
   ai.ai_socktype = socktype;
   ai.ai_protocol = 0;
@@ -3674,8 +3625,6 @@
 	report_file_error ("make client process failed", contact);
     }
 
-#endif /* not TERM */
-
   inch = s;
   outch = s;
 
@@ -7295,7 +7244,7 @@
 #ifdef HAVE_GETSOCKNAME
    ADD_SUBFEATURE (QCservice, Qt);
 #endif
-#if !defined(TERM) && (defined(O_NONBLOCK) || defined(O_NDELAY))
+#if defined(O_NONBLOCK) || defined(O_NDELAY)
    ADD_SUBFEATURE (QCserver, Qt);
 #endif
 
--- a/src/s/aix4-2.h	Wed Jul 16 07:55:50 2008 +0000
+++ b/src/s/aix4-2.h	Wed Jul 16 08:06:18 2008 +0000
@@ -59,12 +59,6 @@
 
 #define HAVE_SOCKETS
 
-/*
- *	Define NONSYSTEM_DIR_LIBRARY to make Emacs emulate
- *      The 4.2 opendir, etc., library functions.
- */
-
-/* #define NONSYSTEM_DIR_LIBRARY */
 
 /*
  * 	Define SYSV_SYSTEM_DIR to use the V.3 getdents/readir
@@ -96,18 +90,6 @@
 
 /* Special itemss needed to make Emacs run on this system.  */
 
-
-
-/* USG systems tend to put everything declared static
-   into the initialized data area, which becomes pure after dumping Emacs.
-   Foil this.  Emacs carefully avoids static vars inside functions.  */
-
-#undef static
-
-/* Compiler bug bites on many systems when default ADDR_CORRECT is used.  */
-
-/* #define ADDR_CORRECT(x) (x) */
-
 #ifndef __GNUC__
 #define LINKER cc
 #endif
--- a/src/s/gnu-linux.h	Wed Jul 16 07:55:50 2008 +0000
+++ b/src/s/gnu-linux.h	Wed Jul 16 08:06:18 2008 +0000
@@ -90,7 +90,7 @@
 
 #define FIRST_PTY_LETTER 'p'
 
-#endif  /* not HAVE_GRANDPT */
+#endif  /* not HAVE_GRANTPT */
 
 /*  Define HAVE_TERMIOS if the system provides POSIX-style
     functions and macros for terminal control.  */
@@ -153,12 +153,6 @@
    your system and must be used only through an encapsulation
    (Which you should place, by convention, in sysdep.c).  */
 
-/* If you mount the proc file system somewhere other than /proc
-   you will have to uncomment the following and make the proper
-   changes */
-
-/* #define LINUX_LDAV_FILE "/proc/loadavg" */
-
 /* This is needed for dispnew.c:update_frame */
 
 #ifdef emacs
@@ -220,14 +214,6 @@
 #define C_DEBUG_SWITCH
 #endif
 
-/* Rob Malouf <malouf@csli.stanford.edu> says:
-   SYSV IPC is standard a standard part of Linux since version 0.99pl10,
-   and is a very common addition to previous versions.  */
-
-#ifdef TERM
-#define LIBS_SYSTEM -lclient
-#define C_SWITCH_SYSTEM -D_BSD_SOURCE -I/usr/src/term
-#else
 /* alane@wozzle.linet.org says that -lipc is not a separate library,
    since libc-4.4.1.  So -lipc was deleted.  */
 #define LIBS_SYSTEM
@@ -235,7 +221,6 @@
    _GNU_SOURCE.  Left in in case it's relevant to libc5 systems and
    anyone's still using Emacs on those.  --fx 2002-12-14  */
 #define C_SWITCH_SYSTEM -D_BSD_SOURCE
-#endif
 
 /* Paul Abrahams <abrahams@equinox.shaysnet.com> says this is needed.  */
 #define LIB_MOTIF -lXm -lXpm
@@ -245,15 +230,8 @@
 #define LIBS_TERMCAP -lncurses
 #endif
 
-#define HAVE_SYSVIPC
-
 #define UNEXEC unexelf.o
 
-#define A_TEXT_OFFSET(hdr) (N_MAGIC(hdr) == QMAGIC ? sizeof (struct exec) : 0)
-#define A_TEXT_SEEK(hdr) (N_TXTOFF(hdr) + A_TEXT_OFFSET(hdr))
-#define ADJUST_EXEC_HEADER \
-  unexec_text_start = N_TXTADDR(ohdr) + A_TEXT_OFFSET(ohdr)
-
 /* This is to work around mysterious gcc failures in some system versions.
    It is unlikely that Emacs changes will work around this problem;
    therefore, this should remain permanently.  */
--- a/src/s/ms-w32.h	Wed Jul 16 07:55:50 2008 +0000
+++ b/src/s/ms-w32.h	Wed Jul 16 08:06:18 2008 +0000
@@ -46,81 +46,18 @@
 
 #define NO_MATHERR 1
 
-/* NOMULTIPLEJOBS should be defined if your system's shell
- does not have "job control" (the ability to stop a program,
- run some other program, then continue the first one).  */
-
-/* #define NOMULTIPLEJOBS 1 */
-
-/* Emacs can read input using SIGIO and buffering characters itself,
-   or using CBREAK mode and making C-g cause SIGINT.
-   The choice is controlled by the variable interrupt_input.
-
-   Define INTERRUPT_INPUT to make interrupt_input = 1 the default (use SIGIO)
-
-   Emacs uses the presence or absence of the SIGIO macro to indicate
-   whether or not signal-driven I/O is possible.  It uses
-   INTERRUPT_INPUT to decide whether to use it by default.
-
-   SIGIO can be used only on systems that implement it (4.2 and 4.3).
-   CBREAK mode has two disadvantages
-     1) At least in 4.2, it is impossible to handle the Meta key properly.
-	I hear that in system V this problem does not exist.
-     2) Control-G causes output to be discarded.
-	I do not know whether this can be fixed in system V.
-
-   Another method of doing input is planned but not implemented.
-   It would have Emacs fork off a separate process
-   to read the input and send it to the true Emacs process
-   through a pipe. */
-
-/* #define INTERRUPT_INPUT 1 */
-
 /* Letter to use in finding device name of first pty,
   if system supports pty's.  'a' means it is /dev/ptya0  */
 
 #define FIRST_PTY_LETTER 'a'
 
 /*
- *      Define HAVE_TERMIOS if the system provides POSIX-style
- *      functions and macros for terminal control.
- *
- *      Define HAVE_TERMIO if the system provides sysV-style ioctls
- *      for terminal control.
- *
- *      Do not define both.  HAVE_TERMIOS is preferred, if it is
- *      supported on your system.
- */
-
-/* #define HAVE_TERMIOS 1 */
-/* #define HAVE_TERMIO 1 */
-
-/*
  *      Define HAVE_TIMEVAL if the system supports the BSD style clock values.
  *      Look in <sys/time.h> for a timeval structure.
  */
 
 #define HAVE_TIMEVAL 1
 
-/*
- *      Define HAVE_SELECT if the system supports the `select' system call.
- */
-
-/* #define HAVE_SELECT 1 */
-
-/*
- *      Define HAVE_PTYS if the system supports pty devices.
- */
-
-/* #define HAVE_PTYS 1 */
-
-/*
- *      Define NONSYSTEM_DIR_LIBRARY to make Emacs emulate
- *      The 4.2 opendir, etc., library functions.
- */
-
-/* #define NONSYSTEM_DIR_LIBRARY */
-
 /* NT supports Winsock which is close enough (with some hacks) */
 
 #define HAVE_SOCKETS 1
@@ -169,21 +106,6 @@
 #define MAIL_USE_POP 1
 #define MAIL_USE_SYSTEM_LOCK 1
 
-/* Define CLASH_DETECTION if you want lock files to be written
-   so that Emacs can tell instantly when you try to modify
-   a file that someone else has modified in his Emacs.  */
-
-/* #define CLASH_DETECTION 1 */
-
-/* Define this if your operating system declares signal handlers to
-   have a type other than the usual.  `The usual' is `void' for ANSI C
-   systems (i.e. when the __STDC__ macro is defined), and `int' for
-   pre-ANSI systems.  If you're using GCC on an older system, __STDC__
-   will be defined, but the system's include files will still say that
-   signal returns int or whatever; in situations like that, define
-   this to be what the system's include files want.  */
-/* #define SIGTYPE int */
-
 /* If the character used to separate elements of the executable path
    is not ':', #define this to be the appropriate character constant.  */
 #define SEPCHAR ';'
@@ -353,17 +275,12 @@
 /* map to MSVC names */
 #define execlp    _execlp
 #define execvp    _execvp
-#define fcloseall _fcloseall
 #define fdopen	  _fdopen
-#define fgetchar  _fgetchar
 #ifndef fileno
 #define fileno	  _fileno
 #endif
-#define flushall  _flushall
-#define fputchar  _fputchar
 #define fsync	  _commit
 #define ftruncate _chsize
-#define getw	  _getw
 #define getpid    _getpid
 #ifdef _MSC_VER
 typedef int pid_t;
@@ -374,7 +291,6 @@
 #define lseek     _lseek
 #define popen     _popen
 #define pclose    _pclose
-#define putw	  _putw
 #define umask	  _umask
 #define utimbuf	  _utimbuf
 #define index     strchr
--- a/src/systty.h	Wed Jul 16 07:55:50 2008 +0000
+++ b/src/systty.h	Wed Jul 16 08:06:18 2008 +0000
@@ -33,15 +33,10 @@
 #endif
 #else /* not HAVE_TERMIO */
 #ifdef HAVE_TERMIOS
-#if defined(_AIX) && defined(_I386)
-#include <termios.h>		/* termios.h needs to be before termio.h */
-#include <termio.h>
-#else /* not (_AIX && _I386) */
 #ifndef NO_TERMIO
 #include <termio.h>
 #endif
 #include <termios.h>
-#endif /* not (_AIX && _I386) */
 #define INCLUDED_FCNTL
 #include <fcntl.h>
 #else /* neither HAVE_TERMIO nor HAVE_TERMIOS */
--- a/src/unexalpha.c	Wed Jul 16 07:55:50 2008 +0000
+++ b/src/unexalpha.c	Wed Jul 16 08:06:18 2008 +0000
@@ -134,13 +134,6 @@
     struct scnhdr section[_MIPS_NSCNS_MAX];
 };
 
-
-
-/* Define name of label for entry point for the dumped executable.  */
-
-#ifndef DEFAULT_ENTRY_ADDRESS
-#define DEFAULT_ENTRY_ADDRESS __start
-#endif
 
 void
 unexec (new_name, a_name, data_start, bss_start, entry_address)
@@ -271,8 +264,8 @@
   nhdr.aout.bsize = 0;
   if (entry_address == 0)
     {
-      extern DEFAULT_ENTRY_ADDRESS ();
-      nhdr.aout.entry = (unsigned long)DEFAULT_ENTRY_ADDRESS;
+      extern __start ();
+      nhdr.aout.entry = (unsigned long)__start;
     }
   else
     nhdr.aout.entry = entry_address;
--- a/src/unexec.c	Wed Jul 16 07:55:50 2008 +0000
+++ b/src/unexec.c	Wed Jul 16 08:06:18 2008 +0000
@@ -229,41 +229,11 @@
 
 #else /* not COFF */
 
-#ifdef HPUX
-extern void *sbrk ();
-#else
-#if 0
-/* Some systems with __STDC__ compilers still declare this `char *' in some
-   header file, and our declaration conflicts.  The return value is always
-   cast, so it should be harmless to leave it undefined.  Hopefully
-   machines with different size pointers and ints declare sbrk in a header
-   file.  */
-#ifdef __STDC__
-extern void *sbrk ();
-#else
 extern char *sbrk ();
-#endif /* __STDC__ */
-#endif
-#endif /* HPUX */
 
 #define SYMS_START ((long) N_SYMOFF (ohdr))
 
-#ifdef HPUX
-#ifdef HP9000S200_ID
-#define MY_ID HP9000S200_ID
-#else
-#include <model.h>
-#define MY_ID MYSYS
-#endif /* no HP9000S200_ID */
-static MAGIC OLDMAGIC = {MY_ID, SHARE_MAGIC};
-static MAGIC NEWMAGIC = {MY_ID, DEMAND_MAGIC};
-#define N_TXTOFF(x) TEXT_OFFSET(x)
-#define N_SYMOFF(x) LESYM_OFFSET(x)
-static struct exec hdr, ohdr;
-
-#else /* not HPUX */
-
-#if defined (USG) && !defined (IRIS) && !defined (GNU_LINUX)
+#if defined (USG)
 static struct bhdr hdr, ohdr;
 #define a_magic fmagic
 #define a_text tsize
@@ -277,11 +247,10 @@
     (((x).fmagic)!=OMAGIC && ((x).fmagic)!=NMAGIC &&\
      ((x).fmagic)!=FMAGIC && ((x).fmagic)!=IMAGIC)
 #define NEWMAGIC FMAGIC
-#else /* IRIS or not USG */
+#else /* not USG */
 static struct exec hdr, ohdr;
 #define NEWMAGIC ZMAGIC
-#endif /* IRIS or not USG */
-#endif /* not HPUX */
+#endif /* not USG */
 
 static int unexec_text_start;
 static int unexec_data_start;
@@ -358,11 +327,7 @@
   auto struct scnhdr scntemp;		/* Temporary section header */
   register int scns;
 #endif /* COFF */
-#ifdef USG_SHARED_LIBRARIES
-  extern unsigned int bss_end;
-#else
   unsigned int bss_end;
-#endif
 
   pagemask = getpagesize () - 1;
 
@@ -479,17 +444,6 @@
   /* Now we alter the contents of all the f_*hdr variables
      to correspond to what we want to dump.  */
 
-#ifdef USG_SHARED_LIBRARIES
-
-  /* The amount of data we're adding to the file is distance from the
-   * end of the original .data space to the current end of the .data
-   * space.
-   */
-
-  bias = bss_start - (f_ohdr.data_start + f_dhdr.s_size);
-
-#endif
-
   f_hdr.f_flags |= (F_RELFLG | F_EXEC);
 #ifndef NO_REMAP
   f_ohdr.text_start = (long) start_of_text ();
@@ -532,9 +486,7 @@
   f_bhdr.s_vaddr = f_ohdr.data_start + f_ohdr.dsize;
   f_bhdr.s_size = f_ohdr.bsize;
   f_bhdr.s_scnptr = 0L;
-#ifndef USG_SHARED_LIBRARIES
   bias = f_dhdr.s_scnptr + f_dhdr.s_size - block_copy_start;
-#endif
 
   if (f_hdr.f_symptr > 0L)
     {
@@ -560,8 +512,6 @@
       PERROR (new_name);
     }
 
-#ifndef USG_SHARED_LIBRARIES
-
   if (write (new, &f_thdr, sizeof (f_thdr)) != sizeof (f_thdr))
     {
       PERROR (new_name);
@@ -577,55 +527,6 @@
       PERROR (new_name);
     }
 
-#else /* USG_SHARED_LIBRARIES */
-
-  /* The purpose of this code is to write out the new file's section
-   * header table.
-   *
-   * Scan through the original file's sections.  If the encountered
-   * section is one we know (.text, .data or .bss), write out the
-   * correct header.  If it is a section we do not know (such as
-   * .lib), adjust the address of where the section data is in the
-   * file, and write out the header.
-   *
-   * If any section precedes .text or .data in the file, this code
-   * will not adjust the file pointer for that section correctly.
-   */
-
-  /* This used to use sizeof (f_ohdr) instead of .f_opthdr.
-     .f_opthdr is said to be right when there is no optional header.  */
-  lseek (a_out, sizeof (f_hdr) + f_hdr.f_opthdr, 0);
-
-  for (scns = f_hdr.f_nscns; scns > 0; scns--)
-    {
-      if (read (a_out, &scntemp, sizeof (scntemp)) != sizeof (scntemp))
-	PERROR (a_name);
-
-      if (!strcmp (scntemp.s_name, f_thdr.s_name))	/* .text */
-	{
-	  if (write (new, &f_thdr, sizeof (f_thdr)) != sizeof (f_thdr))
-	    PERROR (new_name);
-	}
-      else if (!strcmp (scntemp.s_name, f_dhdr.s_name))	/* .data */
-	{
-	  if (write (new, &f_dhdr, sizeof (f_dhdr)) != sizeof (f_dhdr))
-	    PERROR (new_name);
-	}
-      else if (!strcmp (scntemp.s_name, f_bhdr.s_name))	/* .bss */
-	{
-	  if (write (new, &f_bhdr, sizeof (f_bhdr)) != sizeof (f_bhdr))
-	    PERROR (new_name);
-	}
-      else
-	{
-	  if (scntemp.s_scnptr)
-	    scntemp.s_scnptr += bias;
-	  if (write (new, &scntemp, sizeof (scntemp)) != sizeof (scntemp))
-	    PERROR (new_name);
-	}
-    }
-#endif /* USG_SHARED_LIBRARIES */
-
   return (0);
 
 #else /* if not COFF */
@@ -684,11 +585,6 @@
       PERROR (new_name);
     }
 
-#if 0 /* This #ifndef caused a bug on GNU/Linux when using QMAGIC.  */
-  /* This adjustment was done above only #ifndef NO_REMAP,
-     so only undo it now #ifndef NO_REMAP.  */
-  /* #ifndef NO_REMAP  */
-#endif
 #ifdef A_TEXT_OFFSET
   hdr.a_text -= A_TEXT_OFFSET (ohdr);
 #endif
@@ -767,63 +663,6 @@
 
 #ifdef COFF
 
-#ifdef USG_SHARED_LIBRARIES
-
-  int scns;
-  struct scnhdr scntemp;		/* Temporary section header */
-
-  /* The purpose of this code is to write out the new file's section
-   * contents.
-   *
-   * Step through the section table.  If we know the section (.text,
-   * .data) do the appropriate thing.  Otherwise, if the section has
-   * no allocated space in the file (.bss), do nothing.  Otherwise,
-   * the section has space allocated in the file, and is not a section
-   * we know.  So just copy it.
-   */
-
-  lseek (a_out, sizeof (struct filehdr) + sizeof (struct aouthdr), 0);
-
-  for (scns = f_hdr.f_nscns; scns > 0; scns--)
-    {
-      if (read (a_out, &scntemp, sizeof (scntemp)) != sizeof (scntemp))
-	PERROR ("temacs");
-
-      if (!strcmp (scntemp.s_name, ".text"))
-	{
-	  lseek (new, (long) text_scnptr, 0);
-	  ptr = (char *) f_ohdr.text_start;
-	  end = ptr + f_ohdr.tsize;
-	  write_segment (new, ptr, end);
-	}
-      else if (!strcmp (scntemp.s_name, ".data"))
-	{
-	  lseek (new, (long) data_scnptr, 0);
-	  ptr = (char *) f_ohdr.data_start;
-	  end = ptr + f_ohdr.dsize;
-	  write_segment (new, ptr, end);
-	}
-      else if (!scntemp.s_scnptr)
-	; /* do nothing - no data for this section */
-      else
-	{
-	  char page[BUFSIZ];
-	  int size, n;
-	  long old_a_out_ptr = lseek (a_out, 0, 1);
-
-	  lseek (a_out, scntemp.s_scnptr, 0);
-	  for (size = scntemp.s_size; size > 0; size -= sizeof (page))
-	    {
-	      n = size > sizeof (page) ? sizeof (page) : size;
-	      if (read (a_out, page, n) != n || write (new, page, n) != n)
-		PERROR ("emacs");
-	    }
-	  lseek (a_out, old_a_out_ptr, 0);
-	}
-    }
-
-#else /* COFF, but not USG_SHARED_LIBRARIES */
-
 #ifdef MSDOS
 #if __DJGPP__ >= 2
   /* Dump the original table of exception handlers, not the one
@@ -857,8 +696,6 @@
 #endif
 #endif
 
-#endif /* USG_SHARED_LIBRARIES */
-
 #else /* if not COFF */
 
 /* Some machines count the header as part of the text segment.