diff options
Diffstat (limited to 'contrib/binutils/bfd/coffswap.h')
-rw-r--r-- | contrib/binutils/bfd/coffswap.h | 44 |
1 files changed, 31 insertions, 13 deletions
diff --git a/contrib/binutils/bfd/coffswap.h b/contrib/binutils/bfd/coffswap.h index ff76e9e..d7d090f 100644 --- a/contrib/binutils/bfd/coffswap.h +++ b/contrib/binutils/bfd/coffswap.h @@ -1,5 +1,6 @@ /* Generic COFF swapping routines, for BFD. - Copyright 1990, 91, 92, 93, 94, 95, 96, 1997 Free Software Foundation, Inc. + Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 98, 1999 + Free Software Foundation, Inc. Written by Cygnus Support. This file is part of BFD, the Binary File Descriptor library. @@ -26,10 +27,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ Any file which uses this must first include "coff/internal.h" and "coff/CPU.h". The functions will then be correct for that CPU. */ -#ifndef IMAGE_BASE -#define IMAGE_BASE 0 -#endif - #define PUTWORD bfd_h_put_32 #define PUTHALF bfd_h_put_16 #define PUTBYTE bfd_h_put_8 @@ -264,7 +261,7 @@ coff_swap_reloc_out (abfd, src, dst) SWAP_OUT_RELOC_EXTRA(abfd,reloc_src, reloc_dst); #endif - return RELSZ; + return bfd_coff_relsz (abfd); } #endif /* NO_COFF_RELOCS */ @@ -288,6 +285,9 @@ coff_swap_filehdr_in (abfd, src, dst) filehdr_dst->f_nsyms = bfd_h_get_32(abfd, (bfd_byte *)filehdr_src-> f_nsyms); filehdr_dst->f_opthdr = bfd_h_get_16(abfd, (bfd_byte *)filehdr_src-> f_opthdr); filehdr_dst->f_flags = bfd_h_get_16(abfd, (bfd_byte *)filehdr_src-> f_flags); +#ifdef TIC80_TARGET_ID + filehdr_dst->f_target_id = bfd_h_get_16(abfd, (bfd_byte *)filehdr_src-> f_target_id); +#endif #ifdef COFF_ADJUST_FILEHDR_IN_POST COFF_ADJUST_FILEHDR_IN_POST (abfd, src, dst); @@ -314,11 +314,14 @@ coff_swap_filehdr_out (abfd, in, out) bfd_h_put_32(abfd, filehdr_in->f_nsyms, (bfd_byte *) filehdr_out->f_nsyms); bfd_h_put_16(abfd, filehdr_in->f_opthdr, (bfd_byte *) filehdr_out->f_opthdr); bfd_h_put_16(abfd, filehdr_in->f_flags, (bfd_byte *) filehdr_out->f_flags); +#ifdef TIC80_TARGET_ID + bfd_h_put_16(abfd, filehdr_in->f_target_id, (bfd_byte *) filehdr_out->f_target_id); +#endif #ifdef COFF_ADJUST_FILEHDR_OUT_POST COFF_ADJUST_FILEHDR_OUT_POST (abfd, in, out); #endif - return FILHSZ; + return bfd_coff_filhsz (abfd); } @@ -354,6 +357,9 @@ coff_swap_sym_in (abfd, ext1, in1) } in->n_sclass = bfd_h_get_8(abfd, ext->e_sclass); in->n_numaux = bfd_h_get_8(abfd, ext->e_numaux); +#ifdef COFF_ADJUST_SYM_IN_POST + COFF_ADJUST_SYM_IN_POST (abfd, ext1, in1); +#endif } static unsigned int @@ -387,6 +393,9 @@ coff_swap_sym_out (abfd, inp, extp) } bfd_h_put_8(abfd, in->n_sclass , ext->e_sclass); bfd_h_put_8(abfd, in->n_numaux , ext->e_numaux); +#ifdef COFF_ADJUST_SYM_OUT_POST + COFF_ADJUST_SYM_OUT_POST (abfd, inp, extp); +#endif return SYMESZ; } @@ -416,7 +425,16 @@ coff_swap_aux_in (abfd, ext1, type, class, indx, numaux, in1) #if FILNMLEN != E_FILNMLEN -> Error, we need to cope with truncating or extending FILNMLEN!; #else - memcpy (in->x_file.x_fname, ext->x_file.x_fname, FILNMLEN); + if (numaux > 1) + { + if (indx == 0) + memcpy (in->x_file.x_fname, ext->x_file.x_fname, + numaux * sizeof (AUXENT)); + } + else + { + memcpy (in->x_file.x_fname, ext->x_file.x_fname, FILNMLEN); + } #endif } goto end; @@ -512,8 +530,8 @@ coff_swap_aux_out (abfd, inp, type, class, indx, numaux, extp) PTR inp; int type; int class; - int indx; - int numaux; + int indx ATTRIBUTE_UNUSED; + int numaux ATTRIBUTE_UNUSED; PTR extp; { union internal_auxent *in = (union internal_auxent *)inp; @@ -833,7 +851,7 @@ coff_swap_scnhdr_out (abfd, in, out) { struct internal_scnhdr *scnhdr_int = (struct internal_scnhdr *)in; SCNHDR *scnhdr_ext = (SCNHDR *)out; - unsigned int ret = SCNHSZ; + unsigned int ret = bfd_coff_scnhsz (abfd); #ifdef COFF_ADJUST_SCNHDR_OUT_PRE COFF_ADJUST_SCNHDR_OUT_PRE (abfd, in, out); @@ -870,7 +888,7 @@ coff_swap_scnhdr_out (abfd, in, out) memcpy (buf, scnhdr_int->s_name, sizeof (scnhdr_int->s_name)); buf[sizeof (scnhdr_int->s_name)] = '\0'; (*_bfd_error_handler) - ("%s: warning: %s: line number overflow: 0x%lx > 0xffff", + (_("%s: warning: %s: line number overflow: 0x%lx > 0xffff"), bfd_get_filename (abfd), buf, scnhdr_int->s_nlnno); PUTHALF (abfd, 0xffff, (bfd_byte *) scnhdr_ext->s_nlnno); @@ -883,7 +901,7 @@ coff_swap_scnhdr_out (abfd, in, out) memcpy (buf, scnhdr_int->s_name, sizeof (scnhdr_int->s_name)); buf[sizeof (scnhdr_int->s_name)] = '\0'; - (*_bfd_error_handler) ("%s: %s: reloc overflow: 0x%lx > 0xffff", + (*_bfd_error_handler) (_("%s: %s: reloc overflow: 0x%lx > 0xffff"), bfd_get_filename (abfd), buf, scnhdr_int->s_nreloc); bfd_set_error (bfd_error_file_truncated); |