aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>1995-09-13 17:29:05 +0000
committerIan Lance Taylor <ian@airs.com>1995-09-13 17:29:05 +0000
commitaa4b3dc5091e2e50726b78da3550ccc9a1e57711 (patch)
treeae58f79ef073c723d082fcbd1c810adff330d95f
parentfaa53df9cae9a03357adab2e29fd6870c62ab5dc (diff)
downloadgdb-aa4b3dc5091e2e50726b78da3550ccc9a1e57711.zip
gdb-aa4b3dc5091e2e50726b78da3550ccc9a1e57711.tar.gz
gdb-aa4b3dc5091e2e50726b78da3550ccc9a1e57711.tar.bz2
* cofflink.c (coff_link_input_bfd): Fail if a section with no
contents has relocs. PR 7979.
-rw-r--r--bfd/ChangeLog5
-rw-r--r--bfd/cofflink.c15
2 files changed, 19 insertions, 1 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 699529c..4a76d99 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,8 @@
+Wed Sep 13 13:27:53 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * cofflink.c (coff_link_input_bfd): Fail if a section with no
+ contents has relocs.
+
Thu Sep 12 12:45:34 1995 steve chamberlain <sac@slash.cygnus.com>
* coffcode.h (coff_compute_section_file_positions): Keep the
diff --git a/bfd/cofflink.c b/bfd/cofflink.c
index ea99908..10c0d68 100644
--- a/bfd/cofflink.c
+++ b/bfd/cofflink.c
@@ -1737,7 +1737,20 @@ coff_link_input_bfd (finfo, input_bfd)
bfd_byte *contents;
if ((o->flags & SEC_HAS_CONTENTS) == 0)
- continue;
+ {
+ if ((o->flags & SEC_RELOC) != 0
+ && o->reloc_count != 0)
+ {
+ ((*_bfd_error_handler)
+ ("%s: relocs in section `%s', but it has no contents",
+ bfd_get_filename (input_bfd),
+ bfd_get_section_name (input_bfd, o)));
+ bfd_set_error (bfd_error_no_contents);
+ return false;
+ }
+
+ continue;
+ }
if (coff_section_data (input_bfd, o) != NULL
&& coff_section_data (input_bfd, o)->contents != NULL)