aboutsummaryrefslogtreecommitdiff
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
commitf81112823f68bcfb92e3a132d405cd2c8c13322a (patch)
treeb0085d4f038940c12e61556c411c4f26a532cbc0 /bfd/coff-arm.c
parent6812da59f2d852cc00566e010f409d1f7e104400 (diff)
downloadgdb-f81112823f68bcfb92e3a132d405cd2c8c13322a.zip
gdb-f81112823f68bcfb92e3a132d405cd2c8c13322a.tar.gz
gdb-f81112823f68bcfb92e3a132d405cd2c8c13322a.tar.bz2
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 2af1a94..f50cf8c 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