aboutsummaryrefslogtreecommitdiff
path: root/bfd/bout.c
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>1993-02-23 20:24:06 +0000
committerIan Lance Taylor <ian@airs.com>1993-02-23 20:24:06 +0000
commit8feff7172602b84ba285d46ea1b08374d228bfe0 (patch)
tree5550764e7ade3b43f1ec5a4971d8b23056fe41a4 /bfd/bout.c
parentff7f25de27ee6ae4cdd4395843fd2b5adfa4aa4b (diff)
downloadgdb-8feff7172602b84ba285d46ea1b08374d228bfe0.zip
gdb-8feff7172602b84ba285d46ea1b08374d228bfe0.tar.gz
gdb-8feff7172602b84ba285d46ea1b08374d228bfe0.tar.bz2
* bfd-in.h (JUMP_TABLE): Added bfd_reloc_type_lookup and
bfd_make_debug_symbol; they were already in the target structure. * Adjusted all uses of JUMP_TABLE. * coffgen.c, libcoff-in.h (coff_bfd_make_debug_symbol): Renamed from coff_make_debug_symbol. * libcoff.h: Updated accordingly.
Diffstat (limited to 'bfd/bout.c')
-rw-r--r--bfd/bout.c51
1 files changed, 32 insertions, 19 deletions
diff --git a/bfd/bout.c b/bfd/bout.c
index 23687b3..3178db8 100644
--- a/bfd/bout.c
+++ b/bfd/bout.c
@@ -1,5 +1,5 @@
/* BFD back-end for Intel 960 b.out binaries.
- Copyright 1990, 1991, 1992 Free Software Foundation, Inc.
+ Copyright 1990, 1991, 1992, 1993 Free Software Foundation, Inc.
Written by Cygnus Support.
This file is part of BFD, the Binary File Descriptor library.
@@ -935,7 +935,7 @@ DEFUN(get_value,(reloc, seclet),
}
/* Add the value contained in the relocation */
- value += (short)((reloc->addend) & 0xffff);
+ value += reloc->addend;
return value;
}
@@ -1182,7 +1182,10 @@ DEFUN(b_out_get_relocated_section_contents,(in_abfd,
dst_address+=4;
break;
case ABS32:
- bfd_put_32(in_abfd, get_value(reloc, seclet), data+dst_address);
+ bfd_put_32(in_abfd,
+ (bfd_get_32 (in_abfd, data+src_address)
+ + get_value(reloc, seclet)),
+ data+dst_address);
src_address+=4;
dst_address+=4;
break;
@@ -1213,13 +1216,18 @@ DEFUN(b_out_get_relocated_section_contents,(in_abfd,
{
bfd_error_vector.undefined_symbol(reloc, seclet);
}
- word = (word & ~BAL_MASK) |
- (((word & BAL_MASK) +
- symbol->section->output_offset +
- symbol->section->output_section->vma+
- symbol->value + reloc->addend - dst_address -
- ( input_section->output_section->vma + input_section->output_offset))
- & BAL_MASK);
+ word = ((word & ~BAL_MASK)
+ | (((word & BAL_MASK)
+ /* value of symbol */
+ + symbol->value
+ /* how far it's moving in this relocation */
+ + (symbol->section->output_offset
+ + symbol->section->output_section->vma)
+ - (input_section->output_section->vma
+ + input_section->output_offset)
+ /* addend, of course */
+ + reloc->addend)
+ & BAL_MASK));
bfd_put_32(in_abfd,word, data+dst_address);
dst_address+=4;
@@ -1236,13 +1244,15 @@ DEFUN(b_out_get_relocated_section_contents,(in_abfd,
{
bfd_error_vector.undefined_symbol(reloc, seclet);
}
- word = (word & ~PCREL13_MASK) |
- (((word & PCREL13_MASK) +
- symbol->section->output_offset +
- symbol->section->output_section->vma+
- symbol->value + reloc->addend - dst_address -
- ( input_section->output_section->vma + input_section->output_offset))
- & PCREL13_MASK);
+ word = ((word & ~PCREL13_MASK)
+ | (((word & PCREL13_MASK)
+ + (symbol->section->output_offset
+ + symbol->section->output_section->vma)
+ + symbol->value
+ + reloc->addend
+ - (input_section->output_section->vma
+ + input_section->output_offset))
+ & PCREL13_MASK));
bfd_put_32(in_abfd,word, data+dst_address);
dst_address+=4;
@@ -1292,6 +1302,9 @@ DEFUN(b_out_get_relocated_section_contents,(in_abfd,
#define aout_32_bfd_get_relocated_section_contents b_out_get_relocated_section_contents
#define aout_32_bfd_relax_section b_out_relax_section
#define aout_32_bfd_seclet_link bfd_generic_seclet_link
+#define aout_32_bfd_reloc_type_lookup b_out_reloc_type_lookup
+#define aout_32_bfd_make_debug_symbol \
+ ((asymbol *(*) PARAMS ((bfd *, void *, unsigned long))) bfd_nullvoidptr)
bfd_target b_out_vec_big_host =
{
@@ -1318,7 +1331,7 @@ bfd_target b_out_vec_big_host =
_bfd_write_archive_contents, bfd_false},
JUMP_TABLE(aout_32),
- b_out_reloc_type_lookup,
+ (PTR) 0,
};
@@ -1346,5 +1359,5 @@ _do_getl64, _do_putl64, _do_getl32, _do_putl32, _do_getl16, _do_putl16, /* hdrs
{bfd_false, b_out_write_object_contents, /* bfd_write_contents */
_bfd_write_archive_contents, bfd_false},
JUMP_TABLE(aout_32),
- b_out_reloc_type_lookup,
+ (PTR) 0
};