aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2005-05-17 10:22:40 +0000
committerNick Clifton <nickc@redhat.com>2005-05-17 10:22:40 +0000
commit641bd09305df4cd893788b2b10b3aa5bced813ac (patch)
tree2c12536d24ca4080f48455a401e9b9f17c4b77f2 /bfd
parent952e1aa5e8b6da86c0687c5cf46e835da2422505 (diff)
downloadgdb-641bd09305df4cd893788b2b10b3aa5bced813ac.zip
gdb-641bd09305df4cd893788b2b10b3aa5bced813ac.tar.gz
gdb-641bd09305df4cd893788b2b10b3aa5bced813ac.tar.bz2
(v850_elf_relocate_section): Move code to test for the presence of a symbol
table to just before the symbol table is actually used.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog6
-rw-r--r--bfd/elf32-v850.c21
2 files changed, 18 insertions, 9 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 91e4ecc..aefdd42 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,9 @@
+2005-05-17 Nick Clifton <nickc@redhat.com>
+
+ * elf32-v850.c (v850_elf_relocate_section): Move code to test for
+ the presence of a symbol table to just before the symbol table is
+ actually used.
+
2005-05-16 H.J. Lu <hongjiu.lu@intel.com>
PR 834
diff --git a/bfd/elf32-v850.c b/bfd/elf32-v850.c
index 00affbb..98db745 100644
--- a/bfd/elf32-v850.c
+++ b/bfd/elf32-v850.c
@@ -1649,15 +1649,6 @@ v850_elf_relocate_section (output_bfd, info, input_bfd, input_section,
symtab_hdr = & elf_tdata (input_bfd)->symtab_hdr;
sym_hashes = elf_sym_hashes (input_bfd);
- if (sym_hashes == NULL)
- {
- info->callbacks->warning
- (info, "no hash table available",
- NULL, input_bfd, input_section, (bfd_vma) 0);
-
- return FALSE;
- }
-
/* Reset the list of remembered HI16S relocs to empty. */
free_hi16s = previous_hi16s;
previous_hi16s = NULL;
@@ -1698,6 +1689,18 @@ v850_elf_relocate_section (output_bfd, info, input_bfd, input_section,
{
bfd_boolean unresolved_reloc, warned;
+ /* Note - this check is delayed until now as it is possible and valid
+ to have a file without any symbols but with relocs that can be
+ processed. */
+ if (sym_hashes == NULL)
+ {
+ info->callbacks->warning
+ (info, "no hash table available",
+ NULL, input_bfd, input_section, (bfd_vma) 0);
+
+ return FALSE;
+ }
+
RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
r_symndx, symtab_hdr, sym_hashes,
h, sec, relocation,