]> git.eshelyaron.com Git - emacs.git/commitdiff
Undo previous change.
authorKarl Heuer <kwzh@gnu.org>
Tue, 16 Jul 1996 22:39:31 +0000 (22:39 +0000)
committerKarl Heuer <kwzh@gnu.org>
Tue, 16 Jul 1996 22:39:31 +0000 (22:39 +0000)
configure.in
lib-src/cvtmail.c
lib-src/emacsserver.c
lib-src/sorted-doc.c
lib-src/yow.c
src/cm.h
src/config.in
src/m/alpha.h
src/unexelf.c

index e6b183b7e9638e99aa646b9b0f1c23c3d7c748d3..8540c70f9ff8ae2cde02ca09325263236e992c5e 100644 (file)
@@ -979,7 +979,7 @@ dnl checks for Unix variants
 AC_AIX
 
 dnl checks for header files
-AC_CHECK_HEADERS(sys/select.h sys/timeb.h sys/time.h unistd.h utime.h linux/version.h termios.h)
+AC_CHECK_HEADERS(sys/select.h sys/timeb.h sys/time.h unistd.h utime.h linux/version.h)
 AC_HEADER_STDC
 AC_HEADER_TIME
 AC_DECL_SYS_SIGLIST
index 83242a988a9dc2ef1a15ad602e27166e98dae866..20ef3412439d0525cd0cef0de07bca80b6729a11 100644 (file)
@@ -36,10 +36,6 @@ Boston, MA 02111-1307, USA.  */
 
 #include <stdio.h>
 
-#ifdef __GNU_LIBRARY__
-# include <string.h>
-#endif
-
 char *malloc ();
 char *realloc ();
 char *getenv ();
index 3d4d4cf99375e55b1094647c4c1ee9f93d4ed078..e4ebd7d8be6c789429c8937fa8cb7abd93e123c1 100644 (file)
@@ -85,12 +85,7 @@ int
 main ()
 {
   char system_name[32];
-  int s, infd;
-#ifdef __GNU_LIBRARY__
-  size_t fromlen;
-#else
-  int fromlen;
-#endif
+  int s, infd, fromlen;
   struct sockaddr_un server, fromunix;
   char *homedir;
   char *str, string[BUFSIZ], code[BUFSIZ];
index cb521866ab5e09494e1c5782a5b3dfc56ccea5dd..0ba419d490738ad0105f48c8333beca07cad73c5 100644 (file)
@@ -8,10 +8,6 @@
 #include <stdio.h>
 #include <ctype.h>
 
-#ifdef __GNU_LIBRARY__
-# include <string.h>
-#endif
-
 extern char *malloc ();
 char *xmalloc ();
 
index a37563a6f3397ebc5d1e35f5a963daad03f1f8d3..b67d2f1eeee5e7c61bc241fb76b94b3cdde22f40 100644 (file)
 #include <ctype.h>
 #include <../src/paths.h>      /* For PATH_DATA.  */
 
-#ifdef __GNU_LIBRARY__
-# include <string.h>
-#endif
-
 #define BUFSIZE  80
 #define SEP      '\0'
 
index 0b23bc9eb361df84d799a73a78ba219432ba0b74..80e945b46073adcd91a78e9ad9dd941d1893c1ed 100644 (file)
--- a/src/cm.h
+++ b/src/cm.h
@@ -100,12 +100,7 @@ struct cm
 
 extern struct cm Wcm;          /* Terminal capabilities */
 extern char PC;                        /* Pad character */
-#ifdef HAVE_TERMIOS
-# include <termios.h>
-extern speed_t ospeed;
-#else
 extern short ospeed;           /* Output speed (from sg_ospeed) */
-#endif
 
 /* Shorthand */
 #ifndef NoCMShortHand
index d20afd3258d6e28d381612b8d0654fedabca3251..9f5f0161ad2ebca61d24eaf74455d09dc2a8c1b1 100644 (file)
@@ -122,7 +122,6 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
 #undef HAVE_UNISTD_H
 #undef HAVE_UTIME_H
 #undef HAVE_LINUX_VERSION_H
-#undef HAVE_TERMIOS_H
 #undef STDC_HEADERS
 #undef TIME_WITH_SYS_TIME
 
index 7b07f6cd9b7173f263c6d9309b5b7913db3867d8..606b7aab4699cd9647a8b887e88672777cae461f 100644 (file)
@@ -139,21 +139,6 @@ NOTE-END
 /* #define NO_SOCK_SIGIO */
 
 
-#ifdef __ELF__
-/* With ELF, make sure that all common symbols get allocated to in the
-   data section.  Otherwise, the dump of temacs may miss variables in
-   the shared library that have been initialized.  For example, with
-   GNU libc, __malloc_initialized would normally be resolved to the
-   shared library's .bss section, which is fatal.  */
-# ifdef __GNUC__
-#  define C_SWITCH_MACHINE     -fno-common
-# else
-#  error What gives?  Fix me if DEC Unix supports ELF now.
-# endif
-#endif
-
-#ifndef __ELF__
-
 /* Describe layout of the address space in an executing process.  */
 
 #define TEXT_START    0x120000000
@@ -164,12 +149,6 @@ NOTE-END
 
 #define DATA_SEG_BITS 0x140000000
 
-/* The program to be used for unexec. */
-
-#define UNEXEC unexalpha.o
-
-#endif /* ! __ELF__ */
-
 #ifdef OSF1
 #define ORDINARY_LINK
 
@@ -196,11 +175,15 @@ NOTE-END
 #define START_FILES pre-crt0.o
 #endif
 
-#if defined(LINUX) && __GNU_LIBRARY__ - 0 < 6
+#ifdef LINUX
 /* This controls a conditional in main.  */
 #define LINUX_SBRK_BUG
 #endif
 
+/* The program to be used for unexec. */
+
+#define UNEXEC unexalpha.o
+
 
 #define PNTR_COMPARISON_TYPE unsigned long
 
@@ -290,14 +273,12 @@ extern void r_alloc_free ();
   while (0)
 #endif
 
-/* On the Alpha it's best to avoid including TERMIO since struct
-   termio and struct termios are mutually incompatible.  */
+#ifdef linux
+#define COFF
+/* Linux/Alpha doesn't like it if termio.h and termios.h get included
+   simultaneously.  */
 #define NO_TERMIO
 
-#ifdef LINUX
-# define TEXT_END ({ extern int _etext; &_etext; })
-# ifndef __ELF__
-#  define COFF
-#  define DATA_END ({ extern int _EDATA; &_EDATA; })
-# endif /* ! __ELF__ */
+#define TEXT_END ({ extern int _etext; &_etext; })
+#define DATA_END ({ extern int _EDATA; &_EDATA; })
 #endif
index 1575b23b51d14045e07a7da0e42bdfc3ce353b05..60e82cc6a95f1bf39c41bb0af6ed3a13a588f74f 100644 (file)
@@ -423,22 +423,6 @@ Filesz      Memsz       Flags       Align
 #include <elf.h>
 #include <sys/mman.h>
 
-#ifdef __alpha__
-# include <sym.h>      /* get COFF debugging symbol table declaration */
-#endif
-
-#ifdef __GNU_LIBRARY__
-# include <link.h>     /* get definition of ElfW */
-#endif
-
-#ifndef ElfW
-# ifdef __STDC__
-#  define ElfW(type)   Elf32_##type
-# else
-#  define ElfW(type)   Elf32_/**/type
-# endif
-#endif
-
 #ifndef emacs
 #define fatal(a, b, c) fprintf (stderr, a, b, c), exit (1)
 #else
@@ -478,13 +462,13 @@ extern void fatal (char *, ...);
    */
 
 #define OLD_SECTION_H(n) \
-     (*(ElfW(Shdr) *) ((byte *) old_section_h + old_file_h->e_shentsize * (n)))
+     (*(Elf32_Shdr *) ((byte *) old_section_h + old_file_h->e_shentsize * (n)))
 #define NEW_SECTION_H(n) \
-     (*(ElfW(Shdr) *) ((byte *) new_section_h + new_file_h->e_shentsize * (n)))
+     (*(Elf32_Shdr *) ((byte *) new_section_h + new_file_h->e_shentsize * (n)))
 #define OLD_PROGRAM_H(n) \
-     (*(ElfW(Phdr) *) ((byte *) old_program_h + old_file_h->e_phentsize * (n)))
+     (*(Elf32_Phdr *) ((byte *) old_program_h + old_file_h->e_phentsize * (n)))
 #define NEW_PROGRAM_H(n) \
-     (*(ElfW(Phdr) *) ((byte *) new_program_h + new_file_h->e_phentsize * (n)))
+     (*(Elf32_Phdr *) ((byte *) new_program_h + new_file_h->e_phentsize * (n)))
 
 #define PATCH_INDEX(n) \
   do { \
@@ -526,19 +510,19 @@ unexec (new_name, old_name, data_start, bss_start, entry_address)
   /* Pointers to the file, program and section headers for the old and new
    * files.
    */
-  ElfW(Ehdr) *old_file_h, *new_file_h;
-  ElfW(Phdr) *old_program_h, *new_program_h;
-  ElfW(Shdr) *old_section_h, *new_section_h;
+  Elf32_Ehdr *old_file_h, *new_file_h;
+  Elf32_Phdr *old_program_h, *new_program_h;
+  Elf32_Shdr *old_section_h, *new_section_h;
 
   /* Point to the section name table in the old file */
   char *old_section_names;
 
-  ElfW(Addr) old_bss_addr, new_bss_addr;
-  ElfW(Addr) old_bss_size, new_data2_size;
-  ElfW(Off)  new_data2_offset;
-  ElfW(Addr) new_data2_addr;
+  Elf32_Addr old_bss_addr, new_bss_addr;
+  Elf32_Word old_bss_size, new_data2_size;
+  Elf32_Off  new_data2_offset;
+  Elf32_Addr new_data2_addr;
 
-  int n, nn, old_bss_index, old_data_index;
+  int n, nn, old_bss_index, old_data_index, new_data2_index;
   struct stat stat_buf;
 
   /* Open the old file & map it into the address space. */
@@ -557,15 +541,15 @@ unexec (new_name, old_name, data_start, bss_start, entry_address)
     fatal ("Can't mmap (%s): errno %d\n", old_name, errno);
 
 #ifdef DEBUG
-  fprintf (stderr, "mmap (%s, %lx) -> %lx\n", old_name, stat_buf.st_size,
-          (unsigned long) old_base);
+  fprintf (stderr, "mmap (%s, %x) -> %x\n", old_name, stat_buf.st_size,
+          old_base);
 #endif
 
   /* Get pointers to headers & section names */
 
-  old_file_h = (ElfW(Ehdr) *) old_base;
-  old_program_h = (ElfW(Phdr) *) ((byte *) old_base + old_file_h->e_phoff);
-  old_section_h = (ElfW(Shdr) *) ((byte *) old_base + old_file_h->e_shoff);
+  old_file_h = (Elf32_Ehdr *) old_base;
+  old_program_h = (Elf32_Phdr *) ((byte *) old_base + old_file_h->e_phoff);
+  old_section_h = (Elf32_Shdr *) ((byte *) old_base + old_file_h->e_shoff);
   old_section_names = (char *) old_base
     + OLD_SECTION_H (old_file_h->e_shstrndx).sh_offset;
 
@@ -590,7 +574,7 @@ unexec (new_name, old_name, data_start, bss_start, entry_address)
   old_bss_addr = OLD_SECTION_H (old_bss_index).sh_addr;
   old_bss_size = OLD_SECTION_H (old_bss_index).sh_size;
 #if defined(emacs) || !defined(DEBUG)
-  new_bss_addr = (ElfW(Addr)) sbrk (0);
+  new_bss_addr = (Elf32_Addr) sbrk (0);
 #else
   new_bss_addr = old_bss_addr + old_bss_size + 0x1234;
 #endif
@@ -600,16 +584,15 @@ unexec (new_name, old_name, data_start, bss_start, entry_address)
 
 #ifdef DEBUG
   fprintf (stderr, "old_bss_index %d\n", old_bss_index);
-  fprintf (stderr, "old_bss_addr %lx\n", old_bss_addr);
-  fprintf (stderr, "old_bss_size %lx\n", old_bss_size);
-  fprintf (stderr, "new_bss_addr %lx\n", new_bss_addr);
-  fprintf (stderr, "new_data2_addr %lx\n", new_data2_addr);
-  fprintf (stderr, "new_data2_size %lx\n", new_data2_size);
-  fprintf (stderr, "new_data2_offset %lx\n", new_data2_offset);
+  fprintf (stderr, "old_bss_addr %x\n", old_bss_addr);
+  fprintf (stderr, "old_bss_size %x\n", old_bss_size);
+  fprintf (stderr, "new_bss_addr %x\n", new_bss_addr);
+  fprintf (stderr, "new_data2_addr %x\n", new_data2_addr);
+  fprintf (stderr, "new_data2_size %x\n", new_data2_size);
+  fprintf (stderr, "new_data2_offset %x\n", new_data2_offset);
 #endif
 
-  if ((unsigned long) new_bss_addr
-      < (unsigned long) old_bss_addr + old_bss_size)
+  if ((unsigned) new_bss_addr < (unsigned) old_bss_addr + old_bss_size)
     fatal (".bss shrank when undumping???\n", 0, 0);
 
   /* Set the output file to the right size and mmap it.  Set
@@ -637,9 +620,9 @@ unexec (new_name, old_name, data_start, bss_start, entry_address)
   if (new_base == (caddr_t) -1)
     fatal ("Can't mmap (%s): errno %d\n", new_name, errno);
 
-  new_file_h = (ElfW(Ehdr) *) new_base;
-  new_program_h = (ElfW(Phdr) *) ((byte *) new_base + old_file_h->e_phoff);
-  new_section_h = (ElfW(Shdr) *)
+  new_file_h = (Elf32_Ehdr *) new_base;
+  new_program_h = (Elf32_Phdr *) ((byte *) new_base + old_file_h->e_phoff);
+  new_section_h = (Elf32_Shdr *)
     ((byte *) new_base + old_file_h->e_shoff + new_data2_size);
 
   /* Make our new file, program and section headers as copies of the
@@ -661,9 +644,9 @@ unexec (new_name, old_name, data_start, bss_start, entry_address)
   new_file_h->e_shnum += 1;
 
 #ifdef DEBUG
-  fprintf (stderr, "Old section offset %lx\n", old_file_h->e_shoff);
+  fprintf (stderr, "Old section offset %x\n", old_file_h->e_shoff);
   fprintf (stderr, "Old section count %d\n", old_file_h->e_shnum);
-  fprintf (stderr, "New section offset %lx\n", new_file_h->e_shoff);
+  fprintf (stderr, "New section offset %x\n", new_file_h->e_shoff);
   fprintf (stderr, "New section count %d\n", new_file_h->e_shnum);
 #endif
 
@@ -678,7 +661,7 @@ unexec (new_name, old_name, data_start, bss_start, entry_address)
   for (n = new_file_h->e_phnum - 1; n >= 0; n--)
     {
       /* Compute maximum of all requirements for alignment of section.  */
-      unsigned int alignment = (NEW_PROGRAM_H (n)).p_align;
+      int alignment = (NEW_PROGRAM_H (n)).p_align;
       if ((OLD_SECTION_H (old_bss_index)).sh_addralign > alignment)
        alignment = OLD_SECTION_H (old_bss_index).sh_addralign;
 
@@ -825,34 +808,13 @@ unexec (new_name, old_name, data_start, bss_start, entry_address)
       memcpy (NEW_SECTION_H (nn).sh_offset + new_base, src,
              NEW_SECTION_H (nn).sh_size);
 
-#ifdef __alpha__
-      /* Update Alpha COFF symbol table: */
-      if (strcmp (old_section_names + OLD_SECTION_H (n).sh_name, ".mdebug")
-         == 0)
-       {
-         pHDRR symhdr = (pHDRR) (NEW_SECTION_H (nn).sh_offset + new_base);
-
-         symhdr->cbLineOffset += new_data2_size;
-         symhdr->cbDnOffset += new_data2_size;
-         symhdr->cbPdOffset += new_data2_size;
-         symhdr->cbSymOffset += new_data2_size;
-         symhdr->cbOptOffset += new_data2_size;
-         symhdr->cbAuxOffset += new_data2_size;
-         symhdr->cbSsOffset += new_data2_size;
-         symhdr->cbSsExtOffset += new_data2_size;
-         symhdr->cbFdOffset += new_data2_size;
-         symhdr->cbRfdOffset += new_data2_size;
-         symhdr->cbExtOffset += new_data2_size;
-       }
-#endif /* __alpha__ */
-
       /* If it is the symbol table, its st_shndx field needs to be patched.  */
       if (NEW_SECTION_H (nn).sh_type == SHT_SYMTAB
          || NEW_SECTION_H (nn).sh_type == SHT_DYNSYM)
        {
-         ElfW(Shdr) *spt = &NEW_SECTION_H (nn);
+         Elf32_Shdr *spt = &NEW_SECTION_H (nn);
          unsigned int num = spt->sh_size / spt->sh_entsize;
-         ElfW(Sym) * sym = (ElfW(Sym) *) (NEW_SECTION_H (nn).sh_offset +
+         Elf32_Sym * sym = (Elf32_Sym *) (NEW_SECTION_H (nn).sh_offset +
                                           new_base);
          for (; num--; sym++)
            {
@@ -870,7 +832,7 @@ unexec (new_name, old_name, data_start, bss_start, entry_address)
   for (n = new_file_h->e_shnum - 1; n; n--)
     {
       byte *symnames;
-      ElfW(Sym) *symp, *symendp;
+      Elf32_Sym *symp, *symendp;
 
       if (NEW_SECTION_H (n).sh_type != SHT_DYNSYM
          && NEW_SECTION_H (n).sh_type != SHT_SYMTAB)
@@ -878,8 +840,8 @@ unexec (new_name, old_name, data_start, bss_start, entry_address)
 
       symnames = ((byte *) new_base
                  + NEW_SECTION_H (NEW_SECTION_H (n).sh_link).sh_offset);
-      symp = (ElfW(Sym) *) (NEW_SECTION_H (n).sh_offset + new_base);
-      symendp = (ElfW(Sym) *) ((byte *)symp + NEW_SECTION_H (n).sh_size);
+      symp = (Elf32_Sym *) (NEW_SECTION_H (n).sh_offset + new_base);
+      symendp = (Elf32_Sym *) ((byte *)symp + NEW_SECTION_H (n).sh_size);
 
       for (; symp < symendp; symp ++)
        if (strcmp ((char *) (symnames + symp->st_name), "_end") == 0
@@ -891,7 +853,7 @@ unexec (new_name, old_name, data_start, bss_start, entry_address)
      that it can undo relocations performed by the runtime linker.  */
   for (n = new_file_h->e_shnum - 1; n; n--)
     {
-      ElfW(Shdr) section = NEW_SECTION_H (n);
+      Elf32_Shdr section = NEW_SECTION_H (n);
       switch (section.sh_type) {
       default:
        break;
@@ -905,22 +867,14 @@ unexec (new_name, old_name, data_start, bss_start, entry_address)
            || !strcmp ((old_section_names + NEW_SECTION_H (nn).sh_name),
                        ".data1"))
          {
-           ElfW(Addr) offset = NEW_SECTION_H (nn).sh_addr -
+           Elf32_Addr offset = NEW_SECTION_H (nn).sh_addr -
              NEW_SECTION_H (nn).sh_offset;
            caddr_t reloc = old_base + section.sh_offset, end;
            for (end = reloc + section.sh_size; reloc < end;
                 reloc += section.sh_entsize)
              {
-               ElfW(Addr) addr;
-#ifdef __alpha__
-               /* The Alpha ELF binutils currently have a bug that
-                  sometimes results in relocs that contain all
-                  zeroes.  Work around this for now...  */
-               if (((ElfW(Rel) *) reloc)->r_offset == 0)
-                   continue;
-#endif
-               addr = ((ElfW(Rel) *) reloc)->r_offset - offset;
-               memcpy (new_base + addr, old_base + addr, sizeof(ElfW(Addr)));
+               Elf32_Addr addr = ((Elf32_Rel *) reloc)->r_offset - offset;
+               memcpy (new_base + addr, old_base + addr, 4);
              }
          }
        break;