summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordanglin <danglin@138bc75d-0d04-0410-961f-82ee72b054a4>2006-01-16 02:26:42 +0000
committerdanglin <danglin@138bc75d-0d04-0410-961f-82ee72b054a4>2006-01-16 02:26:42 +0000
commita0028b3db29f2c7c8e55fe9d4efcf9f65038e7db (patch)
tree44be17e1f07ee6b6b75d920f34f20d927d8a0ac8
parente748be093d5c7ed9416b8122adbdc317829db94e (diff)
downloadppe42-gcc-a0028b3db29f2c7c8e55fe9d4efcf9f65038e7db.tar.gz
ppe42-gcc-a0028b3db29f2c7c8e55fe9d4efcf9f65038e7db.zip
PR target/25168
* tree.c (get_file_function_name_long): Concatenate the first global object name with a string derived from the input filename of the object for type "F". git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@109740 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/tree.c21
2 files changed, 27 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 9ffd7307473..9d337327be7 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,10 @@
+2006-01-15 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
+
+ PR target/25168
+ * tree.c (get_file_function_name_long): Concatenate the first global
+ object name with a string derived from the input filename of the object
+ for type "F".
+
2006-01-16 Ben Elliston <bje@au.ibm.com>
* config/i386/winnt-stubs.c: Update FSF address.
diff --git a/gcc/tree.c b/gcc/tree.c
index 0cca7579ee1..9aaba7e4c26 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -5867,7 +5867,26 @@ get_file_function_name_long (const char *type)
char *q;
if (first_global_object_name)
- p = first_global_object_name;
+ {
+ p = first_global_object_name;
+
+ /* For type 'F', the generated name must be unique not only to this
+ translation unit but also to any given link. Since global names
+ can be overloaded, we concatenate the first global object name
+ with a string derived from the file name of this object. */
+ if (!strcmp (type, "F"))
+ {
+ const char *file = main_input_filename;
+
+ if (! file)
+ file = input_filename;
+
+ q = alloca (strlen (p) + 10);
+ sprintf (q, "%s_%08X", p, crc32_string (0, file));
+
+ p = q;
+ }
+ }
else
{
/* We don't have anything that we know to be unique to this translation
OpenPOWER on IntegriCloud