From 54862c89ac67642b22168994398e0489632b0b83 Mon Sep 17 00:00:00 2001 From: Steve Chamberlain Date: Sat, 2 May 1992 01:46:50 +0000 Subject: [PATCH] * coffcode.h (coff_write_object_contents): use RELSZ to work out size of output reloc struct. --- bfd/coffcode.h | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/bfd/coffcode.h b/bfd/coffcode.h index d969fddb179..6c7eea9974a 100644 --- a/bfd/coffcode.h +++ b/bfd/coffcode.h @@ -396,8 +396,8 @@ DEFUN(styp_to_sec_flags, (styp_flags), return(sec_flags); } -#define get_index(symbol) ((int) (symbol)->value) -#define set_index(symbol, idx) ((symbol)->value = (idx)) +#define get_index(symbol) ((int) (symbol)->udata) +#define set_index(symbol, idx) ((symbol)->udata =(PTR) (idx)) /* ********************************************************************** Here are all the routines for swapping the structures seen in the @@ -1611,9 +1611,25 @@ unsigned int written) count++; while (lineno[count].line_number) { +#if 0 +/* 13 april 92. sac +I've been told this, but still need proof: +> The second bug is also in `bfd/coffcode.h'. This bug causes the linker to screw +> up the pc-relocations for all the line numbers in COFF code. This bug isn't +> only specific to A29K implementations, but affects all systems using COFF +> format binaries. Note that in COFF object files, the line number core offsets +> output by the assembler are relative to the start of each procedure, not +> to the start of the .text section. This patch relocates the line numbers +> relative to the `native->u.syment.n_value' instead of the section virtual +> address. modular!olson@cs.arizona.edu (Jon Olson) +*/ + lineno[count].u.offset += native->u.syment.n_value; + +#else lineno[count].u.offset += symbol->symbol.section->output_section->vma + symbol->symbol.section->output_offset; +#endif count++; } symbol->done_lineno = true; @@ -2217,7 +2233,7 @@ DEFUN(coff_write_object_contents,(abfd), } if (current->reloc_count) { current->rel_filepos = reloc_base; - reloc_base += current->reloc_count * sizeof(struct internal_reloc); + reloc_base += current->reloc_count * RELSZ; } else { current->rel_filepos = 0; -- 2.30.2