aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2002-09-12 14:01:20 +0000
committerJakub Jelinek <jakub@redhat.com>2002-09-12 14:01:20 +0000
commit6a30718d0e90a1a7aa62b56663eeb1fea2227e38 (patch)
tree651b3464fa222e37eb7083681c9bb267465a7ecc
parent6cf9e9fe1d2a60ce238bc98a21aeb00393bd948d (diff)
downloadgdb-6a30718d0e90a1a7aa62b56663eeb1fea2227e38.zip
gdb-6a30718d0e90a1a7aa62b56663eeb1fea2227e38.tar.gz
gdb-6a30718d0e90a1a7aa62b56663eeb1fea2227e38.tar.bz2
* elf32-i386.c (dtpoff_base, tpoff): Don't crash if tls_segment is
NULL. (elf_i386_relocate_section): Return false after printing error about unresolvable relocation.
-rw-r--r--bfd/ChangeLog7
-rw-r--r--bfd/elf32-i386.c23
2 files changed, 22 insertions, 8 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 5b825a2..959c7c2 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,10 @@
+2002-09-12 Jakub Jelinek <jakub@redhat.com>
+
+ * elf32-i386.c (dtpoff_base, tpoff): Don't crash if tls_segment is
+ NULL.
+ (elf_i386_relocate_section): Return false after printing error about
+ unresolvable relocation.
+
2002-09-12 Nick Clifton <nickc@redhat.com>
* elf32-arm.h (elf32_arm_final_link_relocate): Fix handling of
diff --git a/bfd/elf32-i386.c b/bfd/elf32-i386.c
index edf06de..492f0e0 100644
--- a/bfd/elf32-i386.c
+++ b/bfd/elf32-i386.c
@@ -1962,7 +1962,9 @@ static bfd_vma
dtpoff_base (info)
struct bfd_link_info *info;
{
- BFD_ASSERT (elf_hash_table (info)->tls_segment != NULL);
+ /* If tls_segment is NULL, we should have signalled an error already. */
+ if (elf_hash_table (info)->tls_segment == NULL)
+ return 0;
return elf_hash_table (info)->tls_segment->start;
}
@@ -1977,7 +1979,9 @@ tpoff (info, address)
struct elf_link_tls_segment *tls_segment
= elf_hash_table (info)->tls_segment;
- BFD_ASSERT (tls_segment != NULL);
+ /* If tls_segment is NULL, we should have signalled an error already. */
+ if (tls_segment == NULL)
+ return 0;
return (align_power (tls_segment->size, tls_segment->align)
+ tls_segment->start - address);
}
@@ -2756,12 +2760,15 @@ elf_i386_relocate_section (output_bfd, info, input_bfd, input_section,
if (unresolved_reloc
&& !((input_section->flags & SEC_DEBUGGING) != 0
&& (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0))
- (*_bfd_error_handler)
- (_("%s(%s+0x%lx): unresolvable relocation against symbol `%s'"),
- bfd_archive_filename (input_bfd),
- bfd_get_section_name (input_bfd, input_section),
- (long) rel->r_offset,
- h->root.root.string);
+ {
+ (*_bfd_error_handler)
+ (_("%s(%s+0x%lx): unresolvable relocation against symbol `%s'"),
+ bfd_archive_filename (input_bfd),
+ bfd_get_section_name (input_bfd, input_section),
+ (long) rel->r_offset,
+ h->root.root.string);
+ return false;
+ }
r = _bfd_final_link_relocate (howto, input_bfd, input_section,
contents, rel->r_offset,