summaryrefslogtreecommitdiff
path: root/bfd/coff-i386.c
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>2001-05-08 17:44:00 +0000
committerIan Lance Taylor <ian@airs.com>2001-05-08 17:44:00 +0000
commite9a5c9d7e3ef3519b8bc4be8ef04d973b69682bc (patch)
tree6242de5b5dc91887d61f51ca85001da1c37ea6eb /bfd/coff-i386.c
parent39a23d9ed4cd98a50a2ebd9969d70b152e29772f (diff)
downloadgdb-e9a5c9d7e3ef3519b8bc4be8ef04d973b69682bc.tar.gz
* coff-i386.c (coff_i386_reloc): Don't dump core if output_bfd is
NULL or is not COFF. (coff_i386_rtype_to_howto): Don't dump core if output section owner is not COFF.
Diffstat (limited to 'bfd/coff-i386.c')
-rw-r--r--bfd/coff-i386.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/bfd/coff-i386.c b/bfd/coff-i386.c
index d35e2cad40a..7d4ab5ae398 100644
--- a/bfd/coff-i386.c
+++ b/bfd/coff-i386.c
@@ -129,7 +129,9 @@ coff_i386_reloc (abfd, reloc_entry, symbol, data, input_section, output_bfd,
#ifdef COFF_WITH_PE
/* FIXME: How should this case be handled? */
- if (reloc_entry->howto->type == R_IMAGEBASE)
+ if (reloc_entry->howto->type == R_IMAGEBASE
+ && output_bfd != NULL
+ && bfd_get_flavour(output_bfd) == bfd_target_coff_flavour)
diff -= pe_data (output_bfd)->pe_opthdr.ImageBase;
#endif
@@ -489,7 +491,9 @@ coff_i386_rtype_to_howto (abfd, sec, rel, h, sym, addendp)
*addendp -= sym->n_value;
}
- if (rel->r_type == R_IMAGEBASE)
+ if (rel->r_type == R_IMAGEBASE
+ && (bfd_get_flavour(sec->output_section->owner)
+ == bfd_target_coff_flavour))
{
*addendp -= pe_data(sec->output_section->owner)->pe_opthdr.ImageBase;
}