summaryrefslogtreecommitdiff
path: root/bfd/coff-arm.c
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>1999-07-27 14:45:44 +0000
committerNick Clifton <nickc@redhat.com>1999-07-27 14:45:44 +0000
commitccf715549c5cb7449a6830ce74bbee243e07eb78 (patch)
treedeb7b7d54bc71024d814670fe16fa4c827033119 /bfd/coff-arm.c
parentbe170cbf88b052693dddcab708178bf17e3586c8 (diff)
downloadbinutils-redhat-ccf715549c5cb7449a6830ce74bbee243e07eb78.tar.gz
Change to strip out only symbols that start with LOCAL_LABEL_PREFIX followed
by 'L'.
Diffstat (limited to 'bfd/coff-arm.c')
-rw-r--r--bfd/coff-arm.c39
1 files changed, 20 insertions, 19 deletions
diff --git a/bfd/coff-arm.c b/bfd/coff-arm.c
index 2af1a94fe3..f50cf8cc02 100644
--- a/bfd/coff-arm.c
+++ b/bfd/coff-arm.c
@@ -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