Commit ee830309 by Jason Merrill Committed by Jeff Law

varasm.c (assemble_start_function): Add weak_global_object_name.

        * varasm.c (assemble_start_function): Add weak_global_object_name.
        * tree.c (get_file_function_name): Use it.

From-SVN: r20612
parent 0d091530
Fri Jun 19 23:06:33 1998 Jason Merrill <jason@yorick.cygnus.com>
* varasm.c (assemble_start_function): Add weak_global_object_name.
* tree.c (get_file_function_name): Use it.
Fri Jun 19 22:55:14 1998 Jeffrey A Law (law@cygnus.com) Fri Jun 19 22:55:14 1998 Jeffrey A Law (law@cygnus.com)
* c-lang.c (GNU_xref_begin, GNU_xref_end): Deleted. * c-lang.c (GNU_xref_begin, GNU_xref_end): Deleted.
......
...@@ -4793,6 +4793,7 @@ dump_tree_statistics () ...@@ -4793,6 +4793,7 @@ dump_tree_statistics ()
#endif /* NO_DOLLAR_IN_LABEL */ #endif /* NO_DOLLAR_IN_LABEL */
extern char * first_global_object_name; extern char * first_global_object_name;
extern char * weak_global_object_name;
/* If KIND=='I', return a suitable global initializer (constructor) name. /* If KIND=='I', return a suitable global initializer (constructor) name.
If KIND=='D', return a suitable global clean-up (destructor) name. */ If KIND=='D', return a suitable global clean-up (destructor) name. */
...@@ -4806,6 +4807,8 @@ get_file_function_name (kind) ...@@ -4806,6 +4807,8 @@ get_file_function_name (kind)
if (first_global_object_name) if (first_global_object_name)
p = first_global_object_name; p = first_global_object_name;
else if (weak_global_object_name)
p = weak_global_object_name;
else if (main_input_filename) else if (main_input_filename)
p = main_input_filename; p = main_input_filename;
else else
......
...@@ -85,6 +85,7 @@ extern FILE *asm_out_file; ...@@ -85,6 +85,7 @@ extern FILE *asm_out_file;
/* The (assembler) name of the first globally-visible object output. */ /* The (assembler) name of the first globally-visible object output. */
char *first_global_object_name; char *first_global_object_name;
char *weak_global_object_name;
extern struct obstack *current_obstack; extern struct obstack *current_obstack;
extern struct obstack *saveable_obstack; extern struct obstack *saveable_obstack;
...@@ -1003,14 +1004,19 @@ assemble_start_function (decl, fnname) ...@@ -1003,14 +1004,19 @@ assemble_start_function (decl, fnname)
if (TREE_PUBLIC (decl)) if (TREE_PUBLIC (decl))
{ {
if (!first_global_object_name && ! DECL_WEAK (decl) if (! first_global_object_name)
&& ! DECL_ONE_ONLY (decl))
{ {
char *p; char *p;
char **name;
if (! DECL_WEAK (decl) && ! DECL_ONE_ONLY (decl))
name = &first_global_object_name;
else
name = &weak_global_object_name;
STRIP_NAME_ENCODING (p, fnname); STRIP_NAME_ENCODING (p, fnname);
first_global_object_name = permalloc (strlen (p) + 1); *name = permalloc (strlen (p) + 1);
strcpy (first_global_object_name, p); strcpy (*name, p);
} }
#ifdef ASM_WEAKEN_LABEL #ifdef ASM_WEAKEN_LABEL
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment