summaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorHans-Peter Nilsson <hp@axis.com>2002-01-21 21:57:48 +0000
committerHans-Peter Nilsson <hp@axis.com>2002-01-21 21:57:48 +0000
commitf609c83f758b3749240299b1570d658f7ee90f38 (patch)
tree8d68d67c62ef0e87e1edb60c8023c5cdd9f2e03a /bfd
parent4425775fce5bf1534150f127361fbfd05303a52d (diff)
downloadbinutils-redhat-f609c83f758b3749240299b1570d658f7ee90f38.tar.gz
* elf32-cris.c (cris_elf_relocate_section) <case R_CRIS_32_GOTREL>:
Check for and emit error if sgot is NULL at this point.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog5
-rw-r--r--bfd/elf32-cris.c14
2 files changed, 19 insertions, 0 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index bf19404d63..f6a30259c7 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,8 @@
+2002-01-21 Hans-Peter Nilsson <hp@bitrange.com>
+
+ * elf32-cris.c (cris_elf_relocate_section) <case R_CRIS_32_GOTREL>:
+ Check for and emit error if sgot is NULL at this point.
+
2002-01-21 Jason Thorpe <thorpej@wasabisystems.com>
* config.bfd (ia64*-*-netbsd*): New target.
diff --git a/bfd/elf32-cris.c b/bfd/elf32-cris.c
index 2e3add10af..6feb292c19 100644
--- a/bfd/elf32-cris.c
+++ b/bfd/elf32-cris.c
@@ -1162,6 +1162,20 @@ cris_elf_relocate_section (output_bfd, info, input_bfd, input_section,
return false;
}
+ /* This can happen if we get a link error with the input ELF
+ variant mismatching the output variant. Emit an error so
+ it's noticed if it happens elsewhere. */
+ if (sgot == NULL)
+ {
+ (*_bfd_error_handler)
+ (_("%s: relocation %s in section %s with no GOT created"),
+ bfd_archive_filename (input_bfd),
+ cris_elf_howto_table[r_type].name,
+ bfd_get_section_name (input_bfd, input_section));
+ bfd_set_error (bfd_error_bad_value);
+ return false;
+ }
+
/* This relocation is like a PC-relative one, except the
reference point is the location of GOT. Note that
sgot->output_offset is not involved in this calculation. We