aboutsummaryrefslogtreecommitdiff
path: root/bfd/coff-a29k.c
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>1994-09-12 21:01:19 +0000
committerIan Lance Taylor <ian@airs.com>1994-09-12 21:01:19 +0000
commit2a895595271b278bfab1041ac916688681aeedec (patch)
tree82ff7476ed510691ff14edaa5f5747a2a3237b60 /bfd/coff-a29k.c
parent3cd942de1e9a5e19c7132a1de400c6d3d931057b (diff)
downloadgdb-2a895595271b278bfab1041ac916688681aeedec.zip
gdb-2a895595271b278bfab1041ac916688681aeedec.tar.gz
gdb-2a895595271b278bfab1041ac916688681aeedec.tar.bz2
* cofflink.c (coff_link_input_bfd): If r_symndx is -1, don't
change it. (_bfd_coff_generic_relocate_section): If r_symndx is -1, it is an absolute reloc. Don't dump core using r_symndx as an array index. * cf-m68klynx.c (coff_bfd_link_add_symbols): Define. (lynx_link_add_symbols): New static function (copy of function in coff-i386.c). (coff_m68k_lynxrtype_to_howto): sym argument may be NULL. * coff-i386.c (coff_i386_rtype_to_howto): Likewise. * coff-a29k.c (coff_a29k_relocate_section): Handle an r_symndx value of -1, meaning an absolute reloc.
Diffstat (limited to 'bfd/coff-a29k.c')
-rw-r--r--bfd/coff-a29k.c26
1 files changed, 18 insertions, 8 deletions
diff --git a/bfd/coff-a29k.c b/bfd/coff-a29k.c
index 35e6ea3..8e6f11d 100644
--- a/bfd/coff-a29k.c
+++ b/bfd/coff-a29k.c
@@ -353,7 +353,10 @@ coff_a29k_relocate_section (output_bfd, info, input_bfd, input_section,
symndx = rel->r_symndx;
loc = contents + rel->r_vaddr - input_section->vma;
- h = obj_coff_sym_hashes (input_bfd)[symndx];
+ if (symndx == -1)
+ h = NULL;
+ else
+ h = obj_coff_sym_hashes (input_bfd)[symndx];
sym = NULL;
sec = NULL;
@@ -366,12 +369,17 @@ coff_a29k_relocate_section (output_bfd, info, input_bfd, input_section,
{
if (h == NULL)
{
- sym = syms + symndx;
- sec = sections[symndx];
- val = (sec->output_section->vma
- + sec->output_offset
- + sym->n_value
- - sec->vma);
+ if (symndx == -1)
+ sec = bfd_abs_section_ptr;
+ else
+ {
+ sym = syms + symndx;
+ sec = sections[symndx];
+ val = (sec->output_section->vma
+ + sec->output_offset
+ + sym->n_value
+ - sec->vma);
+ }
}
else
{
@@ -497,7 +505,9 @@ coff_a29k_relocate_section (output_bfd, info, input_bfd, input_section,
const char *name;
char buf[SYMNMLEN + 1];
- if (h != NULL)
+ if (symndx == -1)
+ name = "*ABS*";
+ else if (h != NULL)
name = h->root.root.string;
else if (sym == NULL)
name = "*unknown*";