OSDN Git Service

Change to strip out only symbols that start with LOCAL_LABEL_PREFIX followed
authorNick Clifton <nickc@redhat.com>
Tue, 27 Jul 1999 14:45:44 +0000 (14:45 +0000)
committerNick Clifton <nickc@redhat.com>
Tue, 27 Jul 1999 14:45:44 +0000 (14:45 +0000)
by 'L'.

bfd/ChangeLog
bfd/coff-arm.c

index e013fb5..27c3702 100644 (file)
@@ -1,3 +1,10 @@
+1999-07-27  Nick Clifton  <nickc@cygnus.com>
+
+       Patch generated by Bernd Schmidt. <bernds@cygnus.co.uk>
+       
+       * coff-arm.c (coff_arm_is_local_label_name): Change to strip
+       out only symbols that start with LOCAL_LABEL_PREFIX followed by 'L'.
+
 1999-07-23  Donn Terry  <donn@interix.com>
 
        * libcoff-in.h (coff_link_hash_entry): Add coff_link_hash_flags
index 2af1a94..f50cf8c 100644 (file)
@@ -2287,21 +2287,16 @@ coff_arm_copy_private_bfd_data (src, dest)
 #define USER_LABEL_PREFIX "_"
 #endif
 
+/* Like _bfd_coff_is_local_label_name, but
+   a) test against USER_LABEL_PREFIX, to avoid stripping labels known to be
+      non-local.
+   b) Allow other prefixes than ".", e.g. an empty prefix would cause all
+      labels of the form Lxxx to be stripped.  */
 static boolean
 coff_arm_is_local_label_name (abfd, name)
      bfd *        abfd ATTRIBUTE_UNUSED;
      const char * name;
 {
-#ifdef LOCAL_LABEL_PREFIX
-  /* If there is a prefix for local labels then look for this.
-     If the prefix exists, but it is empty, then ignore the test. */
-  
-  if (LOCAL_LABEL_PREFIX[0] != 0)
-    {
-      if (strncmp (name, LOCAL_LABEL_PREFIX, strlen (LOCAL_LABEL_PREFIX)) == 0)
-       return true;
-    }
-#endif
 #ifdef USER_LABEL_PREFIX
   if (USER_LABEL_PREFIX[0] != 0)
     {
@@ -2309,18 +2304,24 @@ coff_arm_is_local_label_name (abfd, name)
        return false;
     }
 #endif
+
+#ifdef LOCAL_LABEL_PREFIX
+  /* If there is a prefix for local labels then look for this.
+     If the prefix exists, but it is empty, then ignore the test. */
   
-  /* devo/gcc/config/dbxcoff.h defines ASM_OUTPUT_SOURCE_LINE to generate
-     local line numbers as .LM<number>, so treat these as local.  */
-  
-  switch (name[0])
+  if (LOCAL_LABEL_PREFIX[0] != 0)
     {
-    case 'L': return true;
-    case '.': return (name[1] == 'L' && name[2] == 'M') ? true : false;
-    default:  return false;     /* Cannot make our minds up - default to
-                                  false so that it will not be stripped
-                                  by accident.  */ 
+      int len = strlen (LOCAL_LABEL_PREFIX);
+      
+      if (strncmp (name, LOCAL_LABEL_PREFIX, len) != 0)
+       return false;
+      
+      /* Perform the checks below for the rest of the name.  */
+      name += len;
     }
+#endif
+  
+  return name[0] == 'L';
 }
 
 /* This piece of machinery exists only to guarantee that the bfd that holds