aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2007-05-07 14:47:28 +0000
committerAlan Modra <amodra@gmail.com>2007-05-07 14:47:28 +0000
commit1182cb939773001f430e98baf146340e27f98f59 (patch)
tree828726f6b7e7868b4bd6389cffbce8f02effe8e3
parentb16f296eba191d610b853415fb55f1fa58432797 (diff)
downloadgdb-1182cb939773001f430e98baf146340e27f98f59.zip
gdb-1182cb939773001f430e98baf146340e27f98f59.tar.gz
gdb-1182cb939773001f430e98baf146340e27f98f59.tar.bz2
* elflink.c (bfd_elf_final_link): Correct reloc handling for
elf_backend_count_relocs. (bfd_elf_discard_info): Print an error if we can't read syms.
-rw-r--r--bfd/ChangeLog6
-rw-r--r--bfd/elflink.c18
2 files changed, 19 insertions, 5 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index c14b55d..4b7c79e 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,5 +1,11 @@
2007-05-07 Alan Modra <amodra@bigpond.net.au>
+ * elflink.c (bfd_elf_final_link): Correct reloc handling for
+ elf_backend_count_relocs.
+ (bfd_elf_discard_info): Print an error if we can't read syms.
+
+2007-05-07 Alan Modra <amodra@bigpond.net.au>
+
* elf32-spu.c (spu_elf_reloc_type_lookup): Return NULL on
invalid reloc code.
(spu_elf_gc_mark_hook, spu_elf_section_processing): Delete functions.
diff --git a/bfd/elflink.c b/bfd/elflink.c
index b58cfa6..e64819e 100644
--- a/bfd/elflink.c
+++ b/bfd/elflink.c
@@ -9312,13 +9312,18 @@ bfd_elf_final_link (bfd *abfd, struct bfd_link_info *info)
{
Elf_Internal_Rela * relocs;
- relocs = _bfd_elf_link_read_relocs (abfd, sec, NULL, NULL,
+ relocs = _bfd_elf_link_read_relocs (sec->owner, sec,
+ NULL, NULL,
info->keep_memory);
- reloc_count = (*bed->elf_backend_count_relocs) (sec, relocs);
+ if (relocs != NULL)
+ {
+ reloc_count
+ = (*bed->elf_backend_count_relocs) (sec, relocs);
- if (elf_section_data (o)->relocs != relocs)
- free (relocs);
+ if (elf_section_data (sec)->relocs != relocs)
+ free (relocs);
+ }
}
if (sec->rawsize > max_contents_size)
@@ -11147,7 +11152,10 @@ bfd_elf_discard_info (bfd *output_bfd, struct bfd_link_info *info)
cookie.locsymcount, 0,
NULL, NULL, NULL);
if (cookie.locsyms == NULL)
- return FALSE;
+ {
+ info->callbacks->einfo (_("%P%X: can not read symbols: %E\n"));
+ return FALSE;
+ }
}
if (stab != NULL)