* ldmain.c (lprefix): Change default from a char to a string
authorJeff Law <law@redhat.com>
Fri, 17 Dec 1993 05:21:33 +0000 (05:21 +0000)
committerJeff Law <law@redhat.com>
Fri, 17 Dec 1993 05:21:33 +0000 (05:21 +0000)
        with only one character.
        (lprefix_len): Set default to one.

        * ldmain.h (lprefix_len): Declare.

        * ldsym.c (write_file_locals): Use strncmp rather than a character
        comparison for lprefix.

        * emultmpl/m88kbcs.em (before_parse): Set lprefix and lprefix_len
        correctly.

        * emultmpl/hppaosf.em: Include ldexp.h.
        (before_parse): Set lprefix and lprefix_len correctly.

ld/emultempl/hppaosf.em
ld/emultempl/m88kbcs.em
ld/ldsym.c

index 3bbb9452b7e98f145b988279b03ca1abb011ae3f..0bd2318449e577256e44b7e9946f799b3e18f803 100644 (file)
@@ -29,6 +29,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
 #include "config.h"
 #include "ldemul.h"
 #include "ldfile.h"
+#include "ldexp.h"
 #include "ldlang.h"
 #include "ldmisc.h"
 
@@ -43,6 +44,11 @@ extern bfd *output_bfd;
 
 static void hppaosf_before_parse()
 {
+  extern char *lprefix;
+  extern unsigned int lprefix_len;
+  lprefix = "L$";
+  lprefix_len = 2;
+
   ldfile_output_architecture = bfd_arch_hppa;
 }
 
index a1add23b589cb9cd8a2d9f41055a473c0849d261..77b726fb13ff3a612b29eb635f0788b3327dde75 100644 (file)
@@ -42,8 +42,9 @@ extern char *ldfile_output_machine_name;
 static void
 gld${EMULATION_NAME}_before_parse()
 {
-  extern char lprefix;
-  lprefix = '@';
+  extern char *lprefix;
+  lprefix = "@";
+  lprefix_len = 1;
 
   ldfile_output_architecture = bfd_arch_${ARCH};
 }
index 74f7956733f843625fa473004ca83494733ab07a..6de790d95fdce522995d4b56961caded66043775 100644 (file)
@@ -512,7 +512,7 @@ write_file_locals (output_buffer)
                  {
                  }
                else if (discard_locals == DISCARD_L &&
-                        (p->name[0] == lprefix))
+                       !strncmp (lprefix, p->name, lprefix_len))
                  {
                  }
                else if (p->flags == BSF_WARNING)