summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bfd/ChangeLog5
-rw-r--r--bfd/elf32-spu.c69
-rw-r--r--include/ChangeLog4
-rw-r--r--include/bfdlink.h3
4 files changed, 43 insertions, 38 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 470e3a2d65a..b725c3c356c 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,8 @@
+2008-06-06 Alan Modra <amodra@bigpond.net.au>
+
+ * elf32-spu.c (spu_elf_auto_overlay): Relax requirement that
+ file names be unique. Specify archive:path in overlay script.
+
2008-06-05 Alan Modra <amodra@bigpond.net.au>
PR ld/6590
diff --git a/bfd/elf32-spu.c b/bfd/elf32-spu.c
index e6e00934da1..e11e1d7663f 100644
--- a/bfd/elf32-spu.c
+++ b/bfd/elf32-spu.c
@@ -3544,37 +3544,20 @@ spu_elf_auto_overlay (struct bfd_link_info *info,
for (i = 1; i < bfd_count; ++i)
if (strcmp (bfd_arr[i - 1]->filename, bfd_arr[i]->filename) == 0)
{
- if (bfd_arr[i - 1]->my_archive && bfd_arr[i]->my_archive)
+ if (bfd_arr[i - 1]->my_archive == bfd_arr[i]->my_archive)
{
- if (bfd_arr[i - 1]->my_archive == bfd_arr[i]->my_archive)
+ if (bfd_arr[i - 1]->my_archive && bfd_arr[i]->my_archive)
info->callbacks->einfo (_("%s duplicated in %s\n"),
- bfd_arr[i - 1]->filename,
- bfd_arr[i - 1]->my_archive->filename);
- else
- info->callbacks->einfo (_("%s in both %s and %s\n"),
- bfd_arr[i - 1]->filename,
- bfd_arr[i - 1]->my_archive->filename,
+ bfd_arr[i]->filename,
bfd_arr[i]->my_archive->filename);
+ else
+ info->callbacks->einfo (_("%s duplicated\n"),
+ bfd_arr[i]->filename);
+ ok = FALSE;
}
- else if (bfd_arr[i - 1]->my_archive)
- info->callbacks->einfo (_("%s in %s and as an object\n"),
- bfd_arr[i - 1]->filename,
- bfd_arr[i - 1]->my_archive->filename);
- else if (bfd_arr[i]->my_archive)
- info->callbacks->einfo (_("%s in %s and as an object\n"),
- bfd_arr[i]->filename,
- bfd_arr[i]->my_archive->filename);
- else
- info->callbacks->einfo (_("%s duplicated\n"),
- bfd_arr[i]->filename);
- ok = FALSE;
}
if (!ok)
{
- /* FIXME: modify plain object files from foo.o to ./foo.o
- and emit EXCLUDE_FILE to handle the duplicates in
- archives. There is a pathological case we can't handle:
- We may have duplicate file names within a single archive. */
info->callbacks->einfo (_("sorry, no support for duplicate "
"object files in auto-overlay script\n"));
bfd_set_error (bfd_error_bad_value);
@@ -3750,9 +3733,11 @@ spu_elf_auto_overlay (struct bfd_link_info *info,
{
asection *sec = ovly_sections[2 * j];
- if (fprintf (script, " [%c]%s (%s)\n",
- sec->owner->filename[0],
- sec->owner->filename + 1,
+ if (fprintf (script, " %s%c%s (%s)\n",
+ (sec->owner->my_archive != NULL
+ ? sec->owner->my_archive->filename : ""),
+ info->path_separator,
+ sec->owner->filename,
sec->name) <= 0)
goto file_err;
if (sec->segment_mark)
@@ -3762,9 +3747,11 @@ spu_elf_auto_overlay (struct bfd_link_info *info,
{
struct function_info *call_fun = call->fun;
sec = call_fun->sec;
- if (fprintf (script, " [%c]%s (%s)\n",
- sec->owner->filename[0],
- sec->owner->filename + 1,
+ if (fprintf (script, " %s%c%s (%s)\n",
+ (sec->owner->my_archive != NULL
+ ? sec->owner->my_archive->filename : ""),
+ info->path_separator,
+ sec->owner->filename,
sec->name) <= 0)
goto file_err;
for (call = call_fun->call_list; call; call = call->next)
@@ -3777,10 +3764,13 @@ spu_elf_auto_overlay (struct bfd_link_info *info,
for (j = base; j < i; j++)
{
asection *sec = ovly_sections[2 * j + 1];
- if (sec != NULL && fprintf (script, " [%c]%s (%s)\n",
- sec->owner->filename[0],
- sec->owner->filename + 1,
- sec->name) <= 0)
+ if (sec != NULL
+ && fprintf (script, " %s%c%s (%s)\n",
+ (sec->owner->my_archive != NULL
+ ? sec->owner->my_archive->filename : ""),
+ info->path_separator,
+ sec->owner->filename,
+ sec->name) <= 0)
goto file_err;
sec = ovly_sections[2 * j];
@@ -3791,10 +3781,13 @@ spu_elf_auto_overlay (struct bfd_link_info *info,
{
struct function_info *call_fun = call->fun;
sec = call_fun->rodata;
- if (sec != NULL && fprintf (script, " [%c]%s (%s)\n",
- sec->owner->filename[0],
- sec->owner->filename + 1,
- sec->name) <= 0)
+ if (sec != NULL
+ && fprintf (script, " %s%c%s (%s)\n",
+ (sec->owner->my_archive != NULL
+ ? sec->owner->my_archive->filename : ""),
+ info->path_separator,
+ sec->owner->filename,
+ sec->name) <= 0)
goto file_err;
for (call = call_fun->call_list; call; call = call->next)
if (call->is_pasted)
diff --git a/include/ChangeLog b/include/ChangeLog
index 9b0140cffda..4e399f39e58 100644
--- a/include/ChangeLog
+++ b/include/ChangeLog
@@ -1,3 +1,7 @@
+2008-06-06 Alan Modra <amodra@bigpond.net.au>
+
+ * bfdlink.h (struct bfd_link_info): Add "path_separator".
+
2008-04-10 Andreas Krebbel <krebbel1@de.ibm.com>
* dis-asm.h (print_s390_disassembler_options):
diff --git a/include/bfdlink.h b/include/bfdlink.h
index bcd4b4fc3e6..e6833102839 100644
--- a/include/bfdlink.h
+++ b/include/bfdlink.h
@@ -372,6 +372,9 @@ struct bfd_link_info
wrap_hash. Used by PowerPC Linux for 'dot' symbols. */
char wrap_char;
+ /* Separator between archive and filename in linker script filespecs. */
+ char path_separator;
+
/* Function callbacks. */
const struct bfd_link_callbacks *callbacks;