Make this buildable on alpha.

Codes are taken from emacs and its pkgsrc patch.
This commit is contained in:
toshii 2000-09-28 11:28:24 +00:00
parent 821a2385e4
commit 5cb2f53a83
2 changed files with 41 additions and 17 deletions

View file

@ -1,4 +1,4 @@
$NetBSD: patch-sum,v 1.6 1999/12/08 08:18:24 rh Exp $
$NetBSD: patch-sum,v 1.7 2000/09/28 11:28:24 toshii Exp $
MD5 (patch-aa) = c5d92bd8fd195c22694f38ee2fb9f6bb
MD5 (patch-ab) = 5a2d1fb672b4e76fe93583022d967936
@ -6,7 +6,7 @@ MD5 (patch-ac) = d4b9aaaf02a01e77949dc456b2f13519
MD5 (patch-ad) = c9ff11d00130b14e1cdd29e85ebad5ab
MD5 (patch-af) = b1e83f33763647b9498d454e54888824
MD5 (patch-ag) = 504f7f2faabecc5b3c9d56f915bd8ca0
MD5 (patch-ah) = 3aff089ff0c45df8e99614f257e2bd82
MD5 (patch-ah) = 4292edfaf17d1a718c2dc07c7db3294a
MD5 (patch-ai) = 76c200f59a51fd7e5c8dc9333ffc0e7e
MD5 (patch-ak) = 30f473fa474bc7d48bb7fe6afd66aeb1
MD5 (patch-al) = 46cb11814be5fa3f01c7d2fca56fd450

View file

@ -1,17 +1,41 @@
$NetBSD: patch-ah,v 1.3 1999/10/29 13:27:32 fvdl Exp $
$NetBSD: patch-ah,v 1.4 2000/09/28 11:28:24 toshii Exp $
--- src/unexelf.c.orig Sun Aug 15 03:29:56 1999
+++ src/unexelf.c Fri Oct 29 07:10:13 1999
@@ -426,3 +426,3 @@
#include <fcntl.h>
-#if !defined (__NetBSD__) && !defined (__OpenBSD__)
+#if !defined (__OpenBSD__) && (!defined(__NetBSD__) || (__NetBSD_Version__ >= 104130000))
#include <elf.h>
@@ -473,3 +473,6 @@
--- src/unexelf.c.orig Sat Dec 4 13:13:06 1999
+++ src/unexelf.c
@@ -482,6 +482,7 @@
# endif
# include <sys/exec_elf.h>
-#ifdef __NetBSD__
+/*
+ * NetBSD has <elf.h> since 1.4M
+ */
+#if defined(__NetBSD__) && (__NetBSD_Version__ < 104130000)
/*
+# ifndef PT_LOAD
# define PT_LOAD Elf_pt_load
# define SHT_SYMTAB Elf_sht_symtab
# define SHT_DYNSYM Elf_sht_dynsym
@@ -493,6 +494,7 @@
# define SHN_UNDEF Elf_eshn_undefined
# define SHN_ABS Elf_eshn_absolute
# define SHN_COMMON Elf_eshn_common
+# endif
# ifdef __alpha__
# include <sys/exec_ecoff.h>
@@ -511,10 +513,18 @@
#ifndef ElfW
# ifdef __STDC__
-# define ElfW(type) Elf32_##type
+# define ElfBitsW(bits, type) Elf##bits##_##type
+# else
+# define ElfBitsW(bits, type) Elf/**/bits/**/_/**/type
+# endif
+# if defined (_LP64) || defined(__alpha__)
+# define ELFSIZE 64
# else
-# define ElfW(type) Elf32_/**/type
+# define ELFSIZE 32
# endif
+ /* This macro expands `bits' before invoking ElfBitsW. */
+# define ElfExpandBitsW(bits, type) ElfBitsW (bits, type)
+# define ElfW(type) ElfExpandBitsW (ELFSIZE, type)
#endif
#ifndef ELF_BSS_SECTION_NAME