Initial import of w3m-990902 by SUNAGAWA Keiki <kei_sun@ba2.so-net.ne.jp>.
[pkgsrc.git] / www / w3m / patches / patch-ab
1 $NetBSD$
2
3 Index: gc/dyn_load.c
4 ===================================================================
5 RCS file: /cvsroot/w3m/gc/dyn_load.c,v
6 retrieving revision 1.1.1.2
7 retrieving revision 1.2
8 diff -u -u -r1.1.1.2 -r1.2
9 --- dyn_load.c  1999/06/02 19:29:13     1.1.1.2
10 +++ dyn_load.c  1999/06/03 12:44:49     1.2
11 @@ -48,7 +48,8 @@
12  #if !defined(SUNOS4) && !defined(SUNOS5DL) && !defined(IRIX5) && \
13      !defined(MSWIN32) && !(defined(ALPHA) && defined(OSF1)) && \
14      !defined(HP_PA) && !(defined(LINUX) && defined(__ELF__)) && \
15 -    !defined(RS6000) && !defined(SCO_ELF)
16 +    !defined(RS6000) && !defined(SCO_ELF) && \
17 +    !(defined(NETBSD) && defined(__ELF__))
18   --> We only know how to find data segments of dynamic libraries for the
19   --> above.  Additional SVR4 variants might not be too
20   --> hard to add.
21 @@ -260,14 +261,22 @@
22  # endif /* !USE_PROC ... */
23  # endif /* SUNOS */
24  
25 -#if defined(LINUX) && defined(__ELF__) || defined(SCO_ELF)
26 +#if defined(LINUX) && defined(__ELF__) || defined(SCO_ELF) || \
27 +    (defined(NETBSD) && defined(__ELF__))
28  
29  /* Dynamic loading code for Linux running ELF. Somewhat tested on
30   * Linux/x86, untested but hopefully should work on Linux/Alpha. 
31   * This code was derived from the Solaris/ELF support. Thanks to
32   * whatever kind soul wrote that.  - Patrick Bridges */
33  
34 +#if defined(NETBSD)
35 +#include <sys/exec_elf.h>
36 +#define DT_DEBUG       21
37 +#define PT_LOAD                1
38 +#define PF_W           0x2
39 +#else
40  #include <elf.h>
41 +#endif
42  #include <link.h>
43  
44  /* Newer versions of Linux/Alpha and Linux/x86 define this macro.  We