aboutsummaryrefslogtreecommitdiff
path: root/bfd/coffcode.h
diff options
context:
space:
mode:
authorSteve Chamberlain <sac@cygnus>1992-08-24 19:10:06 +0000
committerSteve Chamberlain <sac@cygnus>1992-08-24 19:10:06 +0000
commit9465d03ed593ed247e855af8093745510afc65d7 (patch)
tree70d46811fd000cd8c82bcae356365f322b89481e /bfd/coffcode.h
parent93220abe64fba1955712bdcbff0ff1e5bf5bf404 (diff)
downloadgdb-9465d03ed593ed247e855af8093745510afc65d7.zip
gdb-9465d03ed593ed247e855af8093745510afc65d7.tar.gz
gdb-9465d03ed593ed247e855af8093745510afc65d7.tar.bz2
* coffcode.h (coff_add_missing_symbols): if symbols don't come
from a coff file (csym is null), dont deref them * ieee.c (parse_expression): get the answer right when adding an abs+(sec+off), (ieee_generic_stat_arch_elt): call ieee_object_p on elts so that filename is filled in.
Diffstat (limited to 'bfd/coffcode.h')
-rw-r--r--bfd/coffcode.h45
1 files changed, 30 insertions, 15 deletions
diff --git a/bfd/coffcode.h b/bfd/coffcode.h
index 06b1b4e..cd3846f 100644
--- a/bfd/coffcode.h
+++ b/bfd/coffcode.h
@@ -1789,6 +1789,17 @@ DEFUN(coff_write_relocs,(abfd),
struct internal_reloc n;
arelent *q = p[i];
memset((PTR)&n, 0, sizeof(n));
+
+
+#ifndef SWAP_OUT_RELOC_OFFSET
+ /* @@FIXME COFF relocs don't support addends. Code should probably be
+ in the target-independent code, using a target flag to decide whether
+ to fold the addend into the section contents. */
+
+ if (q->addend != 0)
+ abort ();
+#endif
+
n.r_vaddr = q->address + s->vma;
/* The 29k const/consth reloc pair is a real kludge - the consth
part doesn't have a symbol - it has an offset. So rebuilt
@@ -2275,21 +2286,25 @@ coff_add_missing_symbols (abfd)
{
coff_symbol_type *csym = coff_symbol_from (abfd, sympp[i]);
CONST char *name;
-
- if (csym->native && csym->native->u.syment.n_sclass == C_FILE)
+ if (csym)
+ {
+ /* only do this if there is a coff representation of the input
+ symbol */
+ if (csym->native && csym->native->u.syment.n_sclass == C_FILE)
{
need_file = 0;
continue;
}
- name = csym->symbol.name;
- if (!name)
- continue;
- if (!strcmp (name, _TEXT))
- need_text = 0;
- else if (!strcmp (name, _DATA))
- need_data = 0;
- else if (!strcmp (name, _BSS))
- need_bss = 0;
+ name = csym->symbol.name;
+ if (!name)
+ continue;
+ if (!strcmp (name, _TEXT))
+ need_text = 0;
+ else if (!strcmp (name, _DATA))
+ need_data = 0;
+ else if (!strcmp (name, _BSS))
+ need_bss = 0;
+ }
}
/* Now i == bfd_get_symcount (abfd). */
/* @@ For now, don't deal with .file symbol. */
@@ -2311,7 +2326,7 @@ coff_add_missing_symbols (abfd)
sympp2[i++] = coff_section_symbol (abfd, _DATA);
if (need_bss)
sympp2[i++] = coff_section_symbol (abfd, _BSS);
- assert (i == nsyms);
+ BFD_ASSERT (i == nsyms);
bfd_set_symtab (abfd, sympp2, nsyms);
}
#endif /* NO_COFF_SYMBOLS */
@@ -3787,7 +3802,7 @@ DEFUN(perform_slip,(s, slip, input_section, value),
/* This was pointing into this section, so mangle it */
if (p->value > value)
{
- p->value -=2;
+ p->value -= slip;
}
}
s++;
@@ -4027,7 +4042,7 @@ DEFUN(bfd_coff_get_relocated_section_contents,(in_abfd, seclet, data),
*/
if (data[dst_address-1] != 0x6a)
abort();
- switch (data[dst_address] & 0xf0)
+ switch (data[src_address] & 0xf0)
{
case 0x00:
/* Src is memory */
@@ -4072,7 +4087,7 @@ DEFUN(bfd_coff_get_relocated_section_contents,(in_abfd, seclet, data),
case R_RELBYTE:
{
unsigned int gap =get_value(reloc,seclet);
- if (gap > 256)
+ if (gap > 0xff && gap < ~0xff)
{
bfd_error_vector.reloc_value_truncated(reloc, seclet);
}