aboutsummaryrefslogtreecommitdiff
path: root/bfd/coffcode.h
diff options
context:
space:
mode:
authorSteve Chamberlain <sac@cygnus>1992-10-23 17:34:37 +0000
committerSteve Chamberlain <sac@cygnus>1992-10-23 17:34:37 +0000
commitc26d7d179ce415260e46eba69629d220a439b79c (patch)
tree458d1284ad43e10832c91f6e6fbe452afc9532de /bfd/coffcode.h
parentb26059aa449b61de921a90e76e8efcd75dd772a6 (diff)
downloadgdb-c26d7d179ce415260e46eba69629d220a439b79c.zip
gdb-c26d7d179ce415260e46eba69629d220a439b79c.tar.gz
gdb-c26d7d179ce415260e46eba69629d220a439b79c.tar.bz2
Fri Oct 23 10:32:36 1992 Steve Chamberlain (sac@thepub.cygnus.com)
* seclet.c (rel): don't load sections without the SEC_LOAD bit. Thu Oct 15 10:16:35 1992 Steve Chamberlain (sac@thepub.cygnus.com) * coff-m68k.c (m68k_howto2type, SELECT_RELOC): new function to work out a coff relocation type from a howto's attributes rather than using the input r_type field. This fixes PR1677 and allows conversion of a.out relocs to coff relocs. * coffcode.h (coff_write_relocs): if supplied a relocation relative to an absolute symbol, use the right symbol index. * reloc.c (bfd_perform_relocation): do a partial link for coff relocs right.
Diffstat (limited to 'bfd/coffcode.h')
-rw-r--r--bfd/coffcode.h25
1 files changed, 19 insertions, 6 deletions
diff --git a/bfd/coffcode.h b/bfd/coffcode.h
index af9cef6..2277cad 100644
--- a/bfd/coffcode.h
+++ b/bfd/coffcode.h
@@ -1852,13 +1852,26 @@ DEFUN(coff_write_relocs,(abfd),
else
#endif
- if (q->sym_ptr_ptr) {
- n.r_symndx = get_index((*(q->sym_ptr_ptr)));
- /* Take notice if the symbol reloc points to a symbol we don't have
- in our symbol table. What should we do for this?? */
- if (n.r_symndx > obj_conv_table_size (abfd))
- abort ();
+
+ if (q->sym_ptr_ptr)
+ {
+ if (q->sym_ptr_ptr == bfd_abs_section.symbol_ptr_ptr)
+ {
+ /* This is a relocation relative to the absolute symbol */
+ n.r_symndx = -1;
+ }
+ else
+ {
+ n.r_symndx = get_index((*(q->sym_ptr_ptr)));
+ /* Take notice if the symbol reloc points to a symbol we don't have
+ in our symbol table. What should we do for this?? */
+ if (n.r_symndx > obj_conv_table_size (abfd))
+ abort ();
+ }
+
+
}
+
#ifdef SELECT_RELOC
/* Work out reloc type from what is required */
SELECT_RELOC(n.r_type, q->howto);