From 789a4ea32a5d73f65f75f61c5c846f5b9fc67461 Mon Sep 17 00:00:00 2001 From: Mike Stump Date: Thu, 8 Jul 2004 00:12:27 +0000 Subject: [PATCH] darwin.h (ASM_OUTPUT_LABELREF): Fix -fno-leading-underscore. * darwin.h (ASM_OUTPUT_LABELREF): Fix -fno-leading-underscore. * darwin.c (machopic_non_lazy_ptr_name, machopic_stub_name) (machopic_finish): Likewise. From-SVN: r84245 --- gcc/ChangeLog | 6 ++++++ gcc/config/darwin.c | 18 ++++++++++-------- gcc/config/darwin.h | 2 +- 3 files changed, 17 insertions(+), 9 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 11e1eb01bf1..224e26a27c4 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2004-07-07 Mike Stump + + * darwin.h (ASM_OUTPUT_LABELREF): Fix -fno-leading-underscore. + * darwin.c (machopic_non_lazy_ptr_name, machopic_stub_name) + (machopic_finish): Likewise. + 2004-07-07 Richard Henderson * tree-ssa-dom.c (simplify_switch_and_lookup_avail_expr): Look diff --git a/gcc/config/darwin.c b/gcc/config/darwin.c index 63c75df7c8e..17d7fb77f03 100644 --- a/gcc/config/darwin.c +++ b/gcc/config/darwin.c @@ -308,9 +308,10 @@ machopic_non_lazy_ptr_name (const char *name) } else { - buffer[bufferlen] = '_'; - memcpy (buffer + bufferlen +1, name, namelen+1); - bufferlen += namelen +1; + strcpy (buffer + bufferlen, user_label_prefix); + bufferlen += strlen (user_label_prefix); + memcpy (buffer + bufferlen, name, namelen+1); + bufferlen += namelen; } memcpy (buffer + bufferlen, "$non_lazy_ptr", strlen("$non_lazy_ptr")+1); @@ -383,9 +384,10 @@ machopic_stub_name (const char *name) } else { - buffer[bufferlen] = '_'; - memcpy (buffer + bufferlen +1, name, namelen+1); - bufferlen += namelen +1; + strcpy (buffer + bufferlen, user_label_prefix); + bufferlen += strlen (user_label_prefix); + memcpy (buffer + bufferlen, name, namelen+1); + bufferlen += namelen; } if (needs_quotes) @@ -909,13 +911,13 @@ machopic_finish (FILE *asm_out_file) else if (sym_name[0] == '-' || sym_name[0] == '+') strcpy (sym, sym_name); else - sym[0] = '_', strcpy (sym + 1, sym_name); + sprintf (sym, "%s%s", user_label_prefix, sym_name); stub = alloca (strlen (stub_name) + 2); if (stub_name[0] == '*' || stub_name[0] == '&') strcpy (stub, stub_name + 1); else - stub[0] = '_', strcpy (stub + 1, stub_name); + sprintf (stub, "%s%s", user_label_prefix, stub_name); machopic_output_stub (asm_out_file, sym, stub); } diff --git a/gcc/config/darwin.h b/gcc/config/darwin.h index 582e707aae9..7f6e8dcf8b8 100644 --- a/gcc/config/darwin.h +++ b/gcc/config/darwin.h @@ -493,7 +493,7 @@ do { text_section (); \ else if (!strncmp (xname, ".objc_class_name_", 17)) \ fprintf (FILE, "%s", xname); \ else \ - fprintf (FILE, "_%s", xname); \ + asm_fprintf (FILE, "%U%s", xname); \ } while (0) /* Output before executable code. */ -- 2.30.2