Subject: README: ld broken in current
To: None <current-users@netbsd.org>
From: Krister Walfridsson <cato@df.lth.se>
List: current-users
Date: 10/24/1998 21:47:55
The ld in current cannot be used with shared libraries due to a bug 
that crept into it 21 October. The change was meant to fix some weak
symbol lossage in gas.new for non bfd targets (i.e. vax) but this
should be fixed in gas.new instead.

I'll check in a fix for ld soon, so it will hopefully work after the
next sup scan. The impatient can find a patch below.

VAX users using gas.new will need to patch their gas to be able to use
weak symbols. You'll find a patch below (but it is untested, since I
don't have easy access to a vax.)

   /Krister


--- gnu/usr.bin/ld/common/ld.h.bak      Sat Oct 24 21:02:12 1998
+++ gnu/usr.bin/ld/common/ld.h  Sat Oct 24 21:33:58 1998
@@ -354,29 +354,7 @@
 #endif
 #endif /* not __GNU_STAB__ */
 
-#ifndef N_WEAKU
-#define        N_WEAKU 0x0d            /* Weak undefined symbol */
-#endif
-
-#ifndef N_WEAKA
-#define        N_WEAKA 0x0e            /* Weak absolute symbol */
-#endif
-
-#ifndef N_WEAKT
-#define        N_WEAKT 0x0f            /* Weak text symbol */
-#endif
-
-#ifndef N_WEAKD
-#define        N_WEAKD 0x10            /* Weak data symbol */
-#endif
-
-#ifndef N_WEAKB
-#define        N_WEAKB 0x11            /* Weak bss symbol */
-#endif
-
-#define N_ISWEAK(p)            ((N_BIND(p) & BIND_WEAK) \
-                                || ((p)->n_type >= N_WEAKU \
-                                    && (p)->n_type <= N_WEAKB))
+#define N_ISWEAK(p)            (N_BIND(p) & BIND_WEAK)
 
 
 typedef struct localsymbol {





The following patch is for VAX users only:

--- gnu/dist/gas/config/obj-aout.c.bak  Sun Oct 18 13:05:24 1998
+++ gnu/dist/gas/config/obj-aout.c      Sat Oct 24 21:45:22 1998
@@ -388,6 +388,9 @@
       /* Adjust the type of a weak symbol.  */
       if (S_GET_WEAK (symbolP))
        {
+#ifdef TE_NetBSD
+         S_SET_OTHER(symbolP, S_GET_OTHER(symbolP) | 0x20);
+#else
          switch (S_GET_TYPE (symbolP))
            {
            case N_UNDF: S_SET_TYPE (symbolP, N_WEAKU); break;
@@ -397,6 +400,7 @@
            case N_BSS:  S_SET_TYPE (symbolP, N_WEAKB); break;
            default: as_bad ("%s: bad type for weak symbol", temp); break;
            }
+#endif
        }
 
       obj_symbol_to_chars (where, symbolP);