From 330595d00b81733b03df38810bbf2bb75f612a26 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Tue, 1 Feb 1994 17:11:56 +0000 Subject: [PATCH] * coffcode.h (bfd_coff_backend_data): Added new arguments to _bfd_coff_swap_aux_in and _bfd_coff_swap_aux_out: aux index number and number of aux entries. (bfd_coff_swap_aux_in, bfd_coff_swap_aux_out): Changed accordingly. * libcoff.h: Rebuilt. * coffswap.h (coff_swap_aux_in, coff_swap_aux_out): Accept new arguments. If RS6000COFF_C, only treat C_EXT and C_HIDEXT specially if this is the last aux entry. * coffgen.c (coff_write_symbol, coff_get_normalized_symtab): Pass new arguments to swap_aux functions. --- bfd/ChangeLog | 14 ++++ bfd/coffcode.h | 44 +++++++----- bfd/coffgen.c | 7 ++ bfd/coffswap.h | 210 ++++++++++++++++++++++++++++++++++++++------------------- bfd/libcoff.h | 49 ++++++++++---- 5 files changed, 227 insertions(+), 97 deletions(-) diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 53c8108..7468b4c 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,17 @@ +Tue Feb 1 12:05:44 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * coffcode.h (bfd_coff_backend_data): Added new arguments to + _bfd_coff_swap_aux_in and _bfd_coff_swap_aux_out: aux index number + and number of aux entries. + (bfd_coff_swap_aux_in, bfd_coff_swap_aux_out): Changed + accordingly. + * libcoff.h: Rebuilt. + * coffswap.h (coff_swap_aux_in, coff_swap_aux_out): Accept new + arguments. If RS6000COFF_C, only treat C_EXT and C_HIDEXT + specially if this is the last aux entry. + * coffgen.c (coff_write_symbol, coff_get_normalized_symtab): Pass + new arguments to swap_aux functions. + Sun Jan 30 15:14:36 1994 Ken Raeburn (raeburn@cujo.cygnus.com) * gen-aout.c (main): Set DEFAULT_ARCH based on preprocessor macros diff --git a/bfd/coffcode.h b/bfd/coffcode.h index 264c3fd..7e50f2a 100644 --- a/bfd/coffcode.h +++ b/bfd/coffcode.h @@ -290,7 +290,6 @@ CODE_FRAGMENT */ -#include "seclet.h" #include "coffswap.h" /* void warning(); */ @@ -475,10 +474,12 @@ Special entry points for gdb to swap in coff symbol table parts: .typedef struct .{ . void (*_bfd_coff_swap_aux_in) PARAMS (( -. bfd *abfd , +. bfd *abfd, . PTR ext, . int type, -. int class , +. int class, +. int indaux, +. int numaux, . PTR in)); . . void (*_bfd_coff_swap_sym_in) PARAMS (( @@ -499,6 +500,8 @@ Special entry points for gas to swap out coff parts: . PTR in, . int type, . int class, +. int indaux, +. int numaux, . PTR ext)); . . unsigned int (*_bfd_coff_swap_sym_out) PARAMS (( @@ -581,7 +584,8 @@ dependent COFF routines: . struct internal_syment *sym)); . void (*_bfd_coff_reloc16_extra_cases) PARAMS (( . bfd *abfd, -. struct bfd_seclet *seclet, +. struct bfd_link_info *link_info, +. struct bfd_link_order *link_order, . arelent *reloc, . bfd_byte *data, . unsigned int *src_ptr, @@ -590,14 +594,15 @@ dependent COFF routines: . asection *input_section, . asymbol **symbols, . arelent *r, -. unsigned int shrink)); +. unsigned int shrink, +. struct bfd_link_info *link_info)); . .} bfd_coff_backend_data; . .#define coff_backend_info(abfd) ((bfd_coff_backend_data *) (abfd)->xvec->backend_data) . -.#define bfd_coff_swap_aux_in(a,e,t,c,i) \ -. ((coff_backend_info (a)->_bfd_coff_swap_aux_in) (a,e,t,c,i)) +.#define bfd_coff_swap_aux_in(a,e,t,c,ind,num,i) \ +. ((coff_backend_info (a)->_bfd_coff_swap_aux_in) (a,e,t,c,ind,num,i)) . .#define bfd_coff_swap_sym_in(a,e,i) \ . ((coff_backend_info (a)->_bfd_coff_swap_sym_in) (a,e,i)) @@ -611,8 +616,8 @@ dependent COFF routines: .#define bfd_coff_swap_lineno_out(abfd, i, o) \ . ((coff_backend_info (abfd)->_bfd_coff_swap_lineno_out) (abfd, i, o)) . -.#define bfd_coff_swap_aux_out(abfd, i, t,c,o) \ -. ((coff_backend_info (abfd)->_bfd_coff_swap_aux_out) (abfd, i,t,c, o)) +.#define bfd_coff_swap_aux_out(a,i,t,c,ind,num,o) \ +. ((coff_backend_info (a)->_bfd_coff_swap_aux_out) (a,i,t,c,ind,num,o)) . .#define bfd_coff_swap_sym_out(abfd, i,o) \ . ((coff_backend_info (abfd)->_bfd_coff_swap_sym_out) (abfd, i, o)) @@ -665,13 +670,13 @@ dependent COFF routines: .#define bfd_coff_symname_in_debug(abfd, sym)\ . ((coff_backend_info (abfd)->_bfd_coff_symname_in_debug) (abfd, sym)) . -.#define bfd_coff_reloc16_extra_cases(abfd, seclet, reloc, data, src_ptr, dst_ptr)\ +.#define bfd_coff_reloc16_extra_cases(abfd, link_info, link_order, reloc, data, src_ptr, dst_ptr)\ . ((coff_backend_info (abfd)->_bfd_coff_reloc16_extra_cases)\ -. (abfd, seclet, reloc, data, src_ptr, dst_ptr)) +. (abfd, link_info, link_order, reloc, data, src_ptr, dst_ptr)) . -.#define bfd_coff_reloc16_estimate(abfd, section, symbols, reloc, shrink)\ +.#define bfd_coff_reloc16_estimate(abfd, section, symbols, reloc, shrink, link_info)\ . ((coff_backend_info (abfd)->_bfd_coff_reloc16_estimate)\ -. (section, symbols, reloc, shrink)) +. (section, symbols, reloc, shrink, link_info)) . */ @@ -2321,11 +2326,12 @@ bfd *abfd; #define coff_reloc16_estimate dummy_reloc16_estimate static int -dummy_reloc16_estimate(input_section, symbols, reloc, shrink) +dummy_reloc16_estimate (input_section, symbols, reloc, shrink, link_info) asection *input_section; asymbol **symbols; arelent *reloc; unsigned int shrink; + struct bfd_link_info *link_info; { abort (); } @@ -2336,9 +2342,11 @@ dummy_reloc16_estimate(input_section, symbols, reloc, shrink) #define coff_reloc16_extra_cases dummy_reloc16_extra_cases /* This works even if abort is not declared in any header file. */ static void -dummy_reloc16_extra_cases (abfd, seclet, reloc, data, src_ptr, dst_ptr) +dummy_reloc16_extra_cases (abfd, link_info, link_order, reloc, data, src_ptr, + dst_ptr) bfd *abfd; - struct bfd_seclet *seclet; + struct bfd_link_info *link_info; + struct bfd_link_order *link_order; arelent *reloc; bfd_byte *data; unsigned int *src_ptr; @@ -2385,8 +2393,10 @@ static CONST bfd_coff_backend_data bfd_coff_std_swap_table = { (void (*) PARAMS ((bfd *, struct sec *))) bfd_void #define coff_bfd_get_relocated_section_contents bfd_generic_get_relocated_section_contents #define coff_bfd_relax_section bfd_generic_relax_section -#define coff_bfd_seclet_link bfd_generic_seclet_link #ifndef coff_bfd_reloc_type_lookup #define coff_bfd_reloc_type_lookup \ ((CONST struct reloc_howto_struct *(*) PARAMS ((bfd *, bfd_reloc_code_real_type))) bfd_nullvoidptr) #endif +#define coff_bfd_link_hash_table_create _bfd_generic_link_hash_table_create +#define coff_bfd_link_add_symbols _bfd_generic_link_add_symbols +#define coff_bfd_final_link _bfd_generic_final_link diff --git a/bfd/coffgen.c b/bfd/coffgen.c index ebc596f..c9a570f 100644 --- a/bfd/coffgen.c +++ b/bfd/coffgen.c @@ -359,6 +359,7 @@ DEFUN(coff_count_linenumbers,(abfd), /* Takes a bfd and a symbol, returns a pointer to the coff specific area of the symbol if there is one. */ +/*ARGSUSED*/ coff_symbol_type * DEFUN(coff_symbol_from,(ignore_abfd, symbol), bfd *ignore_abfd AND @@ -641,6 +642,8 @@ unsigned int written) &((native + j + 1)->u.auxent), type, class, + j, + native->u.syment.n_numaux, buf); bfd_write(buf, 1, auxesz, abfd); } @@ -892,6 +895,7 @@ DEFUN(coff_write_linenumbers,(abfd), bfd_release (abfd, buff); } +/*ARGSUSED*/ alent * DEFUN(coff_get_lineno,(ignore_abfd, symbol), bfd *ignore_abfd AND @@ -1143,6 +1147,7 @@ bfd *abfd) bfd_coff_swap_aux_in(abfd, (PTR) raw_src, symbol_ptr->u.syment.n_type, symbol_ptr->u.syment.n_sclass, + i, symbol_ptr->u.syment.n_numaux, &(internal_ptr->u.auxent)); /* Remember that bal entries arn't pointerized */ if (i != 1 || symbol_ptr->u.syment.n_sclass != C_LEAFPROC) @@ -1284,6 +1289,7 @@ coff_bfd_make_debug_symbol (abfd, ptr, sz) return &new->symbol; } +/*ARGSUSED*/ void coff_get_symbol_info (abfd, symbol, ret) bfd *abfd; @@ -1392,6 +1398,7 @@ coff_print_symbol (abfd, filep, symbol, how) and return the name of the source file and the line nearest to the wanted location. */ +/*ARGSUSED*/ boolean DEFUN(coff_find_nearest_line,(abfd, section, diff --git a/bfd/coffswap.h b/bfd/coffswap.h index 475387a..3e15ddc 100644 --- a/bfd/coffswap.h +++ b/bfd/coffswap.h @@ -324,11 +324,13 @@ DEFUN(coff_swap_sym_out,(abfd, inp, extp), } static void -DEFUN(coff_swap_aux_in,(abfd, ext1, type, class, in1), +DEFUN(coff_swap_aux_in,(abfd, ext1, type, class, indx, numaux, in1), bfd *abfd AND PTR ext1 AND int type AND int class AND + int indx AND + int numaux AND PTR in1) { AUXENT *ext = (AUXENT *)ext1; @@ -347,21 +349,27 @@ DEFUN(coff_swap_aux_in,(abfd, ext1, type, class, in1), memcpy (in->x_file.x_fname, ext->x_file.x_fname, FILNMLEN); #endif } - break; + return; /* RS/6000 "csect" auxents */ #ifdef RS6000COFF_C case C_EXT: case C_HIDEXT: - in->x_csect.x_scnlen = bfd_h_get_32 (abfd, (bfd_byte *) ext->x_csect.x_scnlen); - in->x_csect.x_parmhash = bfd_h_get_32 (abfd, (bfd_byte *) ext->x_csect.x_parmhash); - in->x_csect.x_snhash = bfd_h_get_16 (abfd, (bfd_byte *) ext->x_csect.x_snhash); - /* We don't have to hack bitfields in x_smtyp because it's defined by - shifts-and-ands, which are equivalent on all byte orders. */ - in->x_csect.x_smtyp = bfd_h_get_8 (abfd, (bfd_byte *) ext->x_csect.x_smtyp); - in->x_csect.x_smclas = bfd_h_get_8 (abfd, (bfd_byte *) ext->x_csect.x_smclas); - in->x_csect.x_stab = bfd_h_get_32 (abfd, (bfd_byte *) ext->x_csect.x_stab); - in->x_csect.x_snstab = bfd_h_get_16 (abfd, (bfd_byte *) ext->x_csect.x_snstab); + if (indx + 1 == numaux) + { + in->x_csect.x_scnlen = bfd_h_get_32 (abfd, ext->x_csect.x_scnlen); + in->x_csect.x_parmhash = bfd_h_get_32 (abfd, + ext->x_csect.x_parmhash); + in->x_csect.x_snhash = bfd_h_get_16 (abfd, ext->x_csect.x_snhash); + /* We don't have to hack bitfields in x_smtyp because it's + defined by shifts-and-ands, which are equivalent on all + byte orders. */ + in->x_csect.x_smtyp = bfd_h_get_8 (abfd, ext->x_csect.x_smtyp); + in->x_csect.x_smclas = bfd_h_get_8 (abfd, ext->x_csect.x_smclas); + in->x_csect.x_stab = bfd_h_get_32 (abfd, ext->x_csect.x_stab); + in->x_csect.x_snstab = bfd_h_get_16 (abfd, ext->x_csect.x_snstab); + return; + } break; #endif @@ -374,45 +382,48 @@ DEFUN(coff_swap_aux_in,(abfd, ext1, type, class, in1), in->x_scn.x_scnlen = GET_SCN_SCNLEN(abfd, ext); in->x_scn.x_nreloc = GET_SCN_NRELOC(abfd, ext); in->x_scn.x_nlinno = GET_SCN_NLINNO(abfd, ext); - break; + return; } - default: - in->x_sym.x_tagndx.l = bfd_h_get_32(abfd, (bfd_byte *) ext->x_sym.x_tagndx); + break; + } + + in->x_sym.x_tagndx.l = bfd_h_get_32(abfd, (bfd_byte *) ext->x_sym.x_tagndx); #ifndef NO_TVNDX - in->x_sym.x_tvndx = bfd_h_get_16(abfd, (bfd_byte *) ext->x_sym.x_tvndx); + in->x_sym.x_tvndx = bfd_h_get_16(abfd, (bfd_byte *) ext->x_sym.x_tvndx); #endif - if (ISARY(type)) { + if (ISARY(type)) { #if DIMNUM != E_DIMNUM - -> Error, we need to cope with truncating or extending DIMNUM!; + -> Error, we need to cope with truncating or extending DIMNUM!; #else - in->x_sym.x_fcnary.x_ary.x_dimen[0] = bfd_h_get_16(abfd, (bfd_byte *) ext->x_sym.x_fcnary.x_ary.x_dimen[0]); - in->x_sym.x_fcnary.x_ary.x_dimen[1] = bfd_h_get_16(abfd, (bfd_byte *) ext->x_sym.x_fcnary.x_ary.x_dimen[1]); - in->x_sym.x_fcnary.x_ary.x_dimen[2] = bfd_h_get_16(abfd, (bfd_byte *) ext->x_sym.x_fcnary.x_ary.x_dimen[2]); - in->x_sym.x_fcnary.x_ary.x_dimen[3] = bfd_h_get_16(abfd, (bfd_byte *) ext->x_sym.x_fcnary.x_ary.x_dimen[3]); + in->x_sym.x_fcnary.x_ary.x_dimen[0] = bfd_h_get_16(abfd, (bfd_byte *) ext->x_sym.x_fcnary.x_ary.x_dimen[0]); + in->x_sym.x_fcnary.x_ary.x_dimen[1] = bfd_h_get_16(abfd, (bfd_byte *) ext->x_sym.x_fcnary.x_ary.x_dimen[1]); + in->x_sym.x_fcnary.x_ary.x_dimen[2] = bfd_h_get_16(abfd, (bfd_byte *) ext->x_sym.x_fcnary.x_ary.x_dimen[2]); + in->x_sym.x_fcnary.x_ary.x_dimen[3] = bfd_h_get_16(abfd, (bfd_byte *) ext->x_sym.x_fcnary.x_ary.x_dimen[3]); #endif - } - if (class == C_BLOCK || ISFCN(type) || ISTAG(class)) { - in->x_sym.x_fcnary.x_fcn.x_lnnoptr = GET_FCN_LNNOPTR(abfd, ext); - in->x_sym.x_fcnary.x_fcn.x_endndx.l = GET_FCN_ENDNDX(abfd, ext); - } + } + if (class == C_BLOCK || ISFCN(type) || ISTAG(class)) { + in->x_sym.x_fcnary.x_fcn.x_lnnoptr = GET_FCN_LNNOPTR(abfd, ext); + in->x_sym.x_fcnary.x_fcn.x_endndx.l = GET_FCN_ENDNDX(abfd, ext); + } - if (ISFCN(type)) { - in->x_sym.x_misc.x_fsize = bfd_h_get_32(abfd, (bfd_byte *) ext->x_sym.x_misc.x_fsize); - } - else { - in->x_sym.x_misc.x_lnsz.x_lnno = GET_LNSZ_LNNO(abfd, ext); - in->x_sym.x_misc.x_lnsz.x_size = GET_LNSZ_SIZE(abfd, ext); - } - } + if (ISFCN(type)) { + in->x_sym.x_misc.x_fsize = bfd_h_get_32(abfd, (bfd_byte *) ext->x_sym.x_misc.x_fsize); + } + else { + in->x_sym.x_misc.x_lnsz.x_lnno = GET_LNSZ_LNNO(abfd, ext); + in->x_sym.x_misc.x_lnsz.x_size = GET_LNSZ_SIZE(abfd, ext); + } } static unsigned int -DEFUN(coff_swap_aux_out,(abfd, inp, type, class, extp), +DEFUN(coff_swap_aux_out,(abfd, inp, type, class, indx, numaux, extp), bfd *abfd AND PTR inp AND int type AND int class AND + int indx AND + int numaux AND PTR extp) { union internal_auxent *in = (union internal_auxent *)inp; @@ -434,21 +445,26 @@ DEFUN(coff_swap_aux_out,(abfd, inp, type, class, extp), memcpy (ext->x_file.x_fname, in->x_file.x_fname, FILNMLEN); #endif } - break; + return sizeof (AUXENT); #ifdef RS6000COFF_C /* RS/6000 "csect" auxents */ case C_EXT: case C_HIDEXT: - PUTWORD (abfd, in->x_csect.x_scnlen, ext->x_csect.x_scnlen); - PUTWORD (abfd, in->x_csect.x_parmhash, ext->x_csect.x_parmhash); - PUTHALF (abfd, in->x_csect.x_snhash, ext->x_csect.x_snhash); - /* We don't have to hack bitfields in x_smtyp because it's defined by - shifts-and-ands, which are equivalent on all byte orders. */ - PUTBYTE (abfd, in->x_csect.x_smtyp, ext->x_csect.x_smtyp); - PUTBYTE (abfd, in->x_csect.x_smclas, ext->x_csect.x_smclas); - PUTWORD (abfd, in->x_csect.x_stab, ext->x_csect.x_stab); - PUTHALF (abfd, in->x_csect.x_snstab, ext->x_csect.x_snstab); + if (indx + 1 == numaux) + { + PUTWORD (abfd, in->x_csect.x_scnlen, ext->x_csect.x_scnlen); + PUTWORD (abfd, in->x_csect.x_parmhash, ext->x_csect.x_parmhash); + PUTHALF (abfd, in->x_csect.x_snhash, ext->x_csect.x_snhash); + /* We don't have to hack bitfields in x_smtyp because it's + defined by shifts-and-ands, which are equivalent on all + byte orders. */ + PUTBYTE (abfd, in->x_csect.x_smtyp, ext->x_csect.x_smtyp); + PUTBYTE (abfd, in->x_csect.x_smclas, ext->x_csect.x_smclas); + PUTWORD (abfd, in->x_csect.x_stab, ext->x_csect.x_stab); + PUTHALF (abfd, in->x_csect.x_snstab, ext->x_csect.x_snstab); + return sizeof (AUXENT); + } break; #endif @@ -461,38 +477,39 @@ DEFUN(coff_swap_aux_out,(abfd, inp, type, class, extp), PUT_SCN_SCNLEN(abfd, in->x_scn.x_scnlen, ext); PUT_SCN_NRELOC(abfd, in->x_scn.x_nreloc, ext); PUT_SCN_NLINNO(abfd, in->x_scn.x_nlinno, ext); - break; + return sizeof (AUXENT); } - default: - PUTWORD(abfd, in->x_sym.x_tagndx.l, (bfd_byte *) ext->x_sym.x_tagndx); + break; + } + + PUTWORD(abfd, in->x_sym.x_tagndx.l, (bfd_byte *) ext->x_sym.x_tagndx); #ifndef NO_TVNDX - bfd_h_put_16(abfd, in->x_sym.x_tvndx , (bfd_byte *) ext->x_sym.x_tvndx); + bfd_h_put_16(abfd, in->x_sym.x_tvndx , (bfd_byte *) ext->x_sym.x_tvndx); #endif - if (class == C_BLOCK || ISFCN(type) || ISTAG(class)) { - PUT_FCN_LNNOPTR(abfd, in->x_sym.x_fcnary.x_fcn.x_lnnoptr, ext); - PUT_FCN_ENDNDX(abfd, in->x_sym.x_fcnary.x_fcn.x_endndx.l, ext); - } + if (class == C_BLOCK || ISFCN(type) || ISTAG(class)) { + PUT_FCN_LNNOPTR(abfd, in->x_sym.x_fcnary.x_fcn.x_lnnoptr, ext); + PUT_FCN_ENDNDX(abfd, in->x_sym.x_fcnary.x_fcn.x_endndx.l, ext); + } - if (ISFCN(type)) { - PUTWORD(abfd, in->x_sym.x_misc.x_fsize, (bfd_byte *) ext->x_sym.x_misc.x_fsize); - } - else { - if (ISARY(type)) { + if (ISFCN(type)) { + PUTWORD(abfd, in->x_sym.x_misc.x_fsize, (bfd_byte *) ext->x_sym.x_misc.x_fsize); + } + else { + if (ISARY(type)) { #if DIMNUM != E_DIMNUM - -> Error, we need to cope with truncating or extending DIMNUM!; + -> Error, we need to cope with truncating or extending DIMNUM!; #else - bfd_h_put_16(abfd, in->x_sym.x_fcnary.x_ary.x_dimen[0], (bfd_byte *)ext->x_sym.x_fcnary.x_ary.x_dimen[0]); - bfd_h_put_16(abfd, in->x_sym.x_fcnary.x_ary.x_dimen[1], (bfd_byte *)ext->x_sym.x_fcnary.x_ary.x_dimen[1]); - bfd_h_put_16(abfd, in->x_sym.x_fcnary.x_ary.x_dimen[2], (bfd_byte *)ext->x_sym.x_fcnary.x_ary.x_dimen[2]); - bfd_h_put_16(abfd, in->x_sym.x_fcnary.x_ary.x_dimen[3], (bfd_byte *)ext->x_sym.x_fcnary.x_ary.x_dimen[3]); + bfd_h_put_16(abfd, in->x_sym.x_fcnary.x_ary.x_dimen[0], (bfd_byte *)ext->x_sym.x_fcnary.x_ary.x_dimen[0]); + bfd_h_put_16(abfd, in->x_sym.x_fcnary.x_ary.x_dimen[1], (bfd_byte *)ext->x_sym.x_fcnary.x_ary.x_dimen[1]); + bfd_h_put_16(abfd, in->x_sym.x_fcnary.x_ary.x_dimen[2], (bfd_byte *)ext->x_sym.x_fcnary.x_ary.x_dimen[2]); + bfd_h_put_16(abfd, in->x_sym.x_fcnary.x_ary.x_dimen[3], (bfd_byte *)ext->x_sym.x_fcnary.x_ary.x_dimen[3]); #endif - } - PUT_LNSZ_LNNO(abfd, in->x_sym.x_misc.x_lnsz.x_lnno, ext); - PUT_LNSZ_SIZE(abfd, in->x_sym.x_misc.x_lnsz.x_size, ext); } + PUT_LNSZ_LNNO(abfd, in->x_sym.x_misc.x_lnsz.x_lnno, ext); + PUT_LNSZ_SIZE(abfd, in->x_sym.x_misc.x_lnsz.x_size, ext); } -return sizeof(AUXENT); + return sizeof(AUXENT); } #endif /* NO_COFF_SYMBOLS */ @@ -558,6 +575,14 @@ DEFUN(coff_swap_aouthdr_in,(abfd, aouthdr_ext1, aouthdr_int1), aouthdr_int->tagentries = bfd_h_get_32(abfd, (bfd_byte *) aouthdr_ext->tagentries); #endif +#ifdef APOLLO_M68 + bfd_h_put_32(abfd, aouthdr_int->o_inlib, (bfd_byte *) aouthdr_ext->o_inlib); + bfd_h_put_32(abfd, aouthdr_int->o_sri, (bfd_byte *) aouthdr_ext->o_sri); + bfd_h_put_32(abfd, aouthdr_int->vid[0], (bfd_byte *) aouthdr_ext->vid); + bfd_h_put_32(abfd, aouthdr_int->vid[1], (bfd_byte *) aouthdr_ext->vid + 4); +#endif + + #ifdef RS6000COFF_C aouthdr_int->o_toc = bfd_h_get_32(abfd, aouthdr_ext->o_toc); aouthdr_int->o_snentry = bfd_h_get_16(abfd, aouthdr_ext->o_snentry); @@ -624,7 +649,9 @@ DEFUN(coff_swap_aouthdr_out,(abfd, in, out), #endif #ifdef ALPHAECOFF - bfd_h_put_32(abfd, 0, (bfd_byte *) aouthdr_out->padding); + /* FIXME: What does bldrev mean? */ + bfd_h_put_16(abfd, (bfd_vma) 2, (bfd_byte *) aouthdr_out->bldrev); + bfd_h_put_16(abfd, (bfd_vma) 0, (bfd_byte *) aouthdr_out->padding); bfd_h_put_64(abfd, aouthdr_in->bss_start, (bfd_byte *) aouthdr_out->bss_start); bfd_h_put_64(abfd, aouthdr_in->gp_value, (bfd_byte *) aouthdr_out->gp_value); bfd_h_put_32(abfd, aouthdr_in->gprmask, (bfd_byte *) aouthdr_out->gprmask); @@ -669,6 +696,9 @@ DEFUN(coff_swap_scnhdr_in,(abfd, ext, in), scnhdr_int->s_align = bfd_h_get_32(abfd, (bfd_byte *) scnhdr_ext->s_align); #endif } +/* start-sanitize-mpw */ +#ifndef MPW_C +/* end-sanitize-mpw */ static unsigned int DEFUN(coff_swap_scnhdr_out,(abfd, in, out), @@ -706,3 +736,47 @@ DEFUN(coff_swap_scnhdr_out,(abfd, in, out), #endif return sizeof(SCNHDR); } +/* start-sanitize-mpw */ +#else +/* Same routine, but with some pre-expanded macros, so ^&%$#&! MPW C doesn't + corrupt itself and then freak out. */ + +static unsigned int +DEFUN(coff_swap_scnhdr_out,(abfd, in, out), + bfd *abfd AND + PTR in AND + PTR out) +{ + struct internal_scnhdr *scnhdr_int = (struct internal_scnhdr *)in; + SCNHDR *scnhdr_ext = (SCNHDR *)out; + + memcpy(scnhdr_ext->s_name, scnhdr_int->s_name, sizeof(scnhdr_int->s_name)); + bfd_h_put_32 (abfd, scnhdr_int->s_vaddr, + (bfd_byte *) scnhdr_ext->s_vaddr); + bfd_h_put_32 (abfd, scnhdr_int->s_paddr, + (bfd_byte *) scnhdr_ext->s_paddr); + bfd_h_put_32 (abfd, scnhdr_int->s_size, + (bfd_byte *) scnhdr_ext->s_size); + PUT_SCNHDR_SCNPTR (abfd, scnhdr_int->s_scnptr, + (bfd_byte *) scnhdr_ext->s_scnptr); + PUT_SCNHDR_RELPTR (abfd, scnhdr_int->s_relptr, + (bfd_byte *) scnhdr_ext->s_relptr); + PUT_SCNHDR_LNNOPTR (abfd, scnhdr_int->s_lnnoptr, + (bfd_byte *) scnhdr_ext->s_lnnoptr); + PUTWORD(abfd, scnhdr_int->s_flags, (bfd_byte *) scnhdr_ext->s_flags); +#if defined(M88) + PUTWORD(abfd, scnhdr_int->s_nlnno, (bfd_byte *) scnhdr_ext->s_nlnno); + PUTWORD(abfd, scnhdr_int->s_nreloc, (bfd_byte *) scnhdr_ext->s_nreloc); +#else + PUTHALF(abfd, scnhdr_int->s_nlnno, (bfd_byte *) scnhdr_ext->s_nlnno); + PUTHALF(abfd, scnhdr_int->s_nreloc, (bfd_byte *) scnhdr_ext->s_nreloc); +#endif + +#if defined(I960) + PUTWORD(abfd, scnhdr_int->s_align, (bfd_byte *) scnhdr_ext->s_align); +#endif + return sizeof(SCNHDR); +} + +#endif +/* end-sanitize-mpw */ diff --git a/bfd/libcoff.h b/bfd/libcoff.h index fd80f71..8955181 100644 --- a/bfd/libcoff.h +++ b/bfd/libcoff.h @@ -92,7 +92,10 @@ extern unsigned int coff_get_reloc_upper_bound PARAMS ((bfd *, sec_ptr)); extern asymbol *coff_make_empty_symbol PARAMS ((bfd *)); extern void coff_print_symbol PARAMS ((bfd *, PTR filep, asymbol *, bfd_print_symbol_type how)); -extern asymbol *coff_make_debug_symbol PARAMS ((bfd *, PTR, unsigned long)); +extern void coff_get_symbol_info PARAMS ((bfd *, asymbol *, + symbol_info *ret)); +extern asymbol *coff_bfd_make_debug_symbol PARAMS ((bfd *, PTR, + unsigned long)); extern boolean coff_find_nearest_line PARAMS ((bfd *, asection *, asymbol **, @@ -103,11 +106,17 @@ extern boolean coff_find_nearest_line PARAMS ((bfd *, extern int coff_sizeof_headers PARAMS ((bfd *, boolean reloc)); extern boolean bfd_coff_reloc16_relax_section PARAMS ((bfd *, asection *, + struct bfd_link_info *, asymbol **)); extern bfd_byte *bfd_coff_reloc16_get_relocated_section_contents - PARAMS ((bfd *, struct bfd_seclet *, bfd_byte *, boolean relocateable)); + PARAMS ((bfd *, struct bfd_link_info *, struct bfd_link_order *, + bfd_byte *, boolean relocateable, asymbol **)); extern bfd_vma bfd_coff_reloc16_get_value PARAMS ((arelent *, - struct bfd_seclet *)); + struct bfd_link_info *, + asection *)); +extern void bfd_perform_slip PARAMS ((asymbol **s, unsigned int slip, + asection *input_section, + bfd_vma value)); /* And more taken from the source .. */ @@ -155,10 +164,12 @@ boolean done_lineno; typedef struct { void (*_bfd_coff_swap_aux_in) PARAMS (( - bfd *abfd , + bfd *abfd, PTR ext, int type, - int class , + int class, + int indaux, + int numaux, PTR in)); void (*_bfd_coff_swap_sym_in) PARAMS (( @@ -176,6 +187,8 @@ typedef struct PTR in, int type, int class, + int indaux, + int numaux, PTR ext)); unsigned int (*_bfd_coff_swap_sym_out) PARAMS (( @@ -254,17 +267,25 @@ typedef struct struct internal_syment *sym)); void (*_bfd_coff_reloc16_extra_cases) PARAMS (( bfd *abfd, - struct bfd_seclet *seclet, + struct bfd_link_info *link_info, + struct bfd_link_order *link_order, arelent *reloc, bfd_byte *data, unsigned int *src_ptr, unsigned int *dst_ptr)); + int (*_bfd_coff_reloc16_estimate) PARAMS (( + asection *input_section, + asymbol **symbols, + arelent *r, + unsigned int shrink, + struct bfd_link_info *link_info)); + } bfd_coff_backend_data; #define coff_backend_info(abfd) ((bfd_coff_backend_data *) (abfd)->xvec->backend_data) -#define bfd_coff_swap_aux_in(a,e,t,c,i) \ - ((coff_backend_info (a)->_bfd_coff_swap_aux_in) (a,e,t,c,i)) +#define bfd_coff_swap_aux_in(a,e,t,c,ind,num,i) \ + ((coff_backend_info (a)->_bfd_coff_swap_aux_in) (a,e,t,c,ind,num,i)) #define bfd_coff_swap_sym_in(a,e,i) \ ((coff_backend_info (a)->_bfd_coff_swap_sym_in) (a,e,i)) @@ -278,8 +299,8 @@ typedef struct #define bfd_coff_swap_lineno_out(abfd, i, o) \ ((coff_backend_info (abfd)->_bfd_coff_swap_lineno_out) (abfd, i, o)) -#define bfd_coff_swap_aux_out(abfd, i, t,c,o) \ - ((coff_backend_info (abfd)->_bfd_coff_swap_aux_out) (abfd, i,t,c, o)) +#define bfd_coff_swap_aux_out(a,i,t,c,ind,num,o) \ + ((coff_backend_info (a)->_bfd_coff_swap_aux_out) (a,i,t,c,ind,num,o)) #define bfd_coff_swap_sym_out(abfd, i,o) \ ((coff_backend_info (abfd)->_bfd_coff_swap_sym_out) (abfd, i, o)) @@ -332,7 +353,11 @@ typedef struct #define bfd_coff_symname_in_debug(abfd, sym)\ ((coff_backend_info (abfd)->_bfd_coff_symname_in_debug) (abfd, sym)) -#define bfd_coff_reloc16_extra_cases(abfd, seclet, reloc, data, src_ptr, dst_ptr)\ +#define bfd_coff_reloc16_extra_cases(abfd, link_info, link_order, reloc, data, src_ptr, dst_ptr)\ ((coff_backend_info (abfd)->_bfd_coff_reloc16_extra_cases)\ - (abfd, seclet, reloc, data, src_ptr, dst_ptr)) + (abfd, link_info, link_order, reloc, data, src_ptr, dst_ptr)) + +#define bfd_coff_reloc16_estimate(abfd, section, symbols, reloc, shrink, link_info)\ + ((coff_backend_info (abfd)->_bfd_coff_reloc16_estimate)\ + (section, symbols, reloc, shrink, link_info)) -- 2.7.4