aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>1994-06-10 19:00:28 +0000
committerIan Lance Taylor <ian@airs.com>1994-06-10 19:00:28 +0000
commit4f019d0445c7b355b7c097382ab874db7c64735c (patch)
treea7d8dc0b624f2db363b2072be5ca8cacb4fe9953
parent726672c5a5c0fb9c750a461a7eadb9ad980b8968 (diff)
downloadgdb-4f019d0445c7b355b7c097382ab874db7c64735c.zip
gdb-4f019d0445c7b355b7c097382ab874db7c64735c.tar.gz
gdb-4f019d0445c7b355b7c097382ab874db7c64735c.tar.bz2
* aoutx.h (NAME(aout,canonicalize_reloc)): Handle .bss section.
(NAME(aout,get_reloc_upper_bound)): Likewise.
-rw-r--r--bfd/ChangeLog3
-rw-r--r--bfd/aoutx.h18
2 files changed, 17 insertions, 4 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 6d84808..aad953e 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,5 +1,8 @@
Fri Jun 10 13:25:13 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+ * aoutx.h (NAME(aout,canonicalize_reloc)): Handle .bss section.
+ (NAME(aout,get_reloc_upper_bound)): Likewise.
+
* coff-i960.c (coff_i960_reloc_type_lookup): Add BFD_RELOC_CTOR.
* linker.c (_bfd_generic_link_write_global_symbol): Don't assume
the section of a common symbol is not NULL.
diff --git a/bfd/aoutx.h b/bfd/aoutx.h
index 62922a6..5801c71 100644
--- a/bfd/aoutx.h
+++ b/bfd/aoutx.h
@@ -1137,7 +1137,8 @@ aout_get_external_symbols (abfd)
obj_aout_external_sym_count (abfd) = count;
}
- if (obj_aout_external_strings (abfd) == NULL)
+ if (obj_aout_external_strings (abfd) == NULL
+ && exec_hdr (abfd)->a_syms != 0)
{
unsigned char string_chars[BYTES_IN_WORD];
bfd_size_type stringsize;
@@ -2523,6 +2524,12 @@ NAME(aout,canonicalize_reloc) (abfd, section, relptr, symbols)
arelent *tblptr = section->relocation;
unsigned int count;
+ if (section == obj_bsssec (abfd))
+ {
+ *relptr = NULL;
+ return 0;
+ }
+
if (!(tblptr || NAME(aout,slurp_reloc_table)(abfd, section, symbols)))
return -1;
@@ -2569,6 +2576,9 @@ NAME(aout,get_reloc_upper_bound) (abfd, asect)
* ((exec_hdr(abfd)->a_trsize / obj_reloc_entry_size (abfd))
+ 1));
+ if (asect == obj_bsssec (abfd))
+ return sizeof (arelent *);
+
bfd_set_error (bfd_error_invalid_operation);
return -1;
}
@@ -3997,7 +4007,7 @@ aout_link_write_other_symbol (h, data)
{
asection *sec;
- sec = h->root.u.def.section;
+ sec = h->root.u.def.section->output_section;
BFD_ASSERT (sec == &bfd_abs_section
|| sec->owner == output_bfd);
if (sec == obj_textsec (output_bfd))
@@ -4009,8 +4019,8 @@ aout_link_write_other_symbol (h, data)
else
type = N_ABS | N_EXT;
val = (h->root.u.def.value
- + sec->output_section->vma
- + sec->output_offset);
+ + sec->vma
+ + h->root.u.def.section->output_offset);
}
break;
case bfd_link_hash_common: