diff options
author | Steve Chamberlain <steve@cygnus> | 1991-10-21 16:42:54 +0000 |
---|---|---|
committer | Steve Chamberlain <steve@cygnus> | 1991-10-21 16:42:54 +0000 |
commit | f58809fd417a0fd96c5f2cede426b770cfd25659 (patch) | |
tree | 79554a15b222b978fd68ee9a54c3026e11e07c24 /bfd/coffcode.h | |
parent | 7955ad1c4da9573edec02603e04774f8133622fc (diff) | |
download | gdb-f58809fd417a0fd96c5f2cede426b770cfd25659.zip gdb-f58809fd417a0fd96c5f2cede426b770cfd25659.tar.gz gdb-f58809fd417a0fd96c5f2cede426b770cfd25659.tar.bz2 |
* targets.c (proto write_armap). Changed orl_count to unsigned.
* opncls.c (bfd_close_all_done). Added so that generative
programs like gas can close a bfd without causing bfd confusion.
* libbfd.h (changed becuase of protos)
* amdcoff.c: messed with the way that jmp displacements are
calcualated. This may not yet be totally correct.
* archive.c (coff_write_armap): rewrote the way that ranlibs are
written out.
* coffcode.h (fixup_symbol_value): now doesn't core dump if a non
abs symbol has no section (like a register symbol).
(coff_write_symbol) now zeros auxent before filling it up to help
with sensitive applications.
* libbfd.c (bfd_write_bigendian_4byte_int): added.
Diffstat (limited to 'bfd/coffcode.h')
-rw-r--r-- | bfd/coffcode.h | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/bfd/coffcode.h b/bfd/coffcode.h index a55d2ea..b359f51 100644 --- a/bfd/coffcode.h +++ b/bfd/coffcode.h @@ -249,16 +249,6 @@ $ } coff_symbol_type; /* $Id$ */ /* Most of this hacked by Steve Chamberlain, steve@cygnus.com */ -/* Align an address upward to a boundary, expressed as a number of bytes. - E.g. align to an 8-byte boundary with argument of 8. */ -#define ALIGN(this, boundary) \ - ((( (this) + ((boundary) -1)) & (~((boundary)-1)))) - -/* Align an address upward to a power of two. Argument is the power - of two, e.g. 8-byte alignment uses argument of 3 (8 == 2^3). */ -#define i960_align(addr, align) \ - ( ((addr) + ((1<<(align))-1)) & (-1 << (align))) - #define PUTWORD bfd_h_put_32 #define PUTHALF bfd_h_put_16 @@ -1188,13 +1178,20 @@ struct internal_syment *syment) syment->n_value = coff_symbol_ptr->symbol.value; } else { - syment->n_scnum = - coff_symbol_ptr->symbol.section->output_section->index+1; + if (coff_symbol_ptr->symbol.section) { + syment->n_scnum = + coff_symbol_ptr->symbol.section->output_section->index+1; - syment->n_value = - coff_symbol_ptr->symbol.value + + syment->n_value = + coff_symbol_ptr->symbol.value + coff_symbol_ptr->symbol.section->output_offset + - coff_symbol_ptr->symbol.section->output_section->vma; + coff_symbol_ptr->symbol.section->output_section->vma; + } + else { + /* This can happen, but I don't know why yet (steve@cygnus.com) */ + syment->n_scnum = N_ABS; + syment->n_value = coff_symbol_ptr->symbol.value; + } } } @@ -1530,6 +1527,7 @@ unsigned int written) for (j = 0; j != native->u.syment.n_numaux; j++) { AUXENT buf1; + bzero((PTR)&buf, AUXESZ); coff_swap_aux_out(abfd, &( (native + j + 1)->u.auxent), type, class, &buf1); bfd_write((PTR) (&buf1), 1, AUXESZ, abfd); |