X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=bfd%2Fcoff-code.h;h=904023652639c3b1ed29b94f2a268a9abdb1d338;hb=14dd454bea3944270aae97d60b5a7f1d8ea46d60;hp=12cb080b380694b2c4741755b8cb7de4abfdd3a2;hpb=99a2aa2cb5e1e3fcd5a88ad452ae13d9f7236a6a;p=deliverable%2Fbinutils-gdb.git diff --git a/bfd/coff-code.h b/bfd/coff-code.h index 12cb080b38..9040236526 100755 --- a/bfd/coff-code.h +++ b/bfd/coff-code.h @@ -40,6 +40,12 @@ You should have received a copy of the GNU General Public License along with #define sp(x) bfd_h_put_x(abfd, x, &x) +#ifndef I960 +#define GDB_EXPORT static +#else +#define GDB_EXPORT /* nothing */ +#endif + PROTO(static void,force_indices_file_symbol_relative,(bfd *abfd, struct internal_syment *symtab)); @@ -70,9 +76,9 @@ DEFUN(set_index,(symbol, idx), */ - -static void -DEFUN(swap_reloc_in,(abfd, reloc_src, reloc_dst), +GDB_EXPORT +void +DEFUN(bfd_swap_reloc_in,(abfd, reloc_src, reloc_dst), bfd *abfd AND RELOC *reloc_src AND struct internal_reloc *reloc_dst) @@ -85,8 +91,9 @@ DEFUN(swap_reloc_in,(abfd, reloc_src, reloc_dst), #endif } -static void -DEFUN(swap_reloc_out,(abfd, reloc_src, reloc_dst), +GDB_EXPORT + void +DEFUN(bfd_swap_reloc_out,(abfd, reloc_src, reloc_dst), bfd *abfd AND struct internal_reloc *reloc_src AND struct external_reloc *reloc_dst) @@ -100,8 +107,8 @@ DEFUN(swap_reloc_out,(abfd, reloc_src, reloc_dst), } -static void -DEFUN(swap_filehdr_in,(abfd, filehdr_src, filehdr_dst), +GDB_EXPORT void +DEFUN(bfd_swap_filehdr_in,(abfd, filehdr_src, filehdr_dst), bfd *abfd AND FILHDR *filehdr_src AND struct internal_filehdr *filehdr_dst) @@ -115,8 +122,8 @@ DEFUN(swap_filehdr_in,(abfd, filehdr_src, filehdr_dst), filehdr_dst->f_flags = bfd_h_get_x(abfd,filehdr_src-> f_flags); } -static void -DEFUN(swap_filehdr_out,(abfd, filehdr_in, filehdr_out), +GDB_EXPORT void +DEFUN(bfd_swap_filehdr_out,(abfd, filehdr_in, filehdr_out), bfd *abfd AND struct internal_filehdr *filehdr_in AND FILHDR *filehdr_out) @@ -131,7 +138,8 @@ DEFUN(swap_filehdr_out,(abfd, filehdr_in, filehdr_out), } -static void +GDB_EXPORT +void DEFUN(bfd_coff_swap_sym_in,(abfd, ext, in), bfd *abfd AND SYMENT *ext AND @@ -151,7 +159,7 @@ DEFUN(bfd_coff_swap_sym_in,(abfd, ext, in), in->n_numaux = bfd_h_get_x(abfd, ext->e_numaux); } -static void +GDB_EXPORT void DEFUN(bfd_coff_swap_sym_out,(abfd,in, ext), bfd *abfd AND struct internal_syment *in AND @@ -171,7 +179,7 @@ DEFUN(bfd_coff_swap_sym_out,(abfd,in, ext), bfd_h_put_x(abfd, in->n_numaux , ext->e_numaux); } -static void +GDB_EXPORT void DEFUN(bfd_coff_swap_aux_in,(abfd, ext, type, class, in), bfd *abfd AND AUXENT *ext AND @@ -222,7 +230,7 @@ DEFUN(bfd_coff_swap_aux_in,(abfd, ext, type, class, in), } } -static void +GDB_EXPORT void DEFUN(bfd_coff_swap_aux_out,(abfd, in, type, class, ext), bfd *abfd AND union internal_auxent *in AND @@ -273,7 +281,7 @@ DEFUN(bfd_coff_swap_aux_out,(abfd, in, type, class, ext), } } -static void +GDB_EXPORT void DEFUN(bfd_coff_swap_lineno_in,(abfd, ext, in), bfd *abfd AND LINENO *ext AND @@ -283,7 +291,7 @@ DEFUN(bfd_coff_swap_lineno_in,(abfd, ext, in), in->l_lnno = bfd_h_get_x(abfd, ext->l_lnno); } -static void +GDB_EXPORT void DEFUN(bfd_coff_swap_lineno_out,(abfd, in, ext), bfd *abfd AND struct internal_lineno *in AND @@ -296,8 +304,8 @@ DEFUN(bfd_coff_swap_lineno_out,(abfd, in, ext), -static void -DEFUN(swap_aouthdr_in,(abfd, aouthdr_ext, aouthdr_int), +GDB_EXPORT void +DEFUN(bfd_swap_aouthdr_in,(abfd, aouthdr_ext, aouthdr_int), bfd *abfd AND AOUTHDR *aouthdr_ext AND struct internal_aouthdr *aouthdr_int) @@ -315,8 +323,8 @@ DEFUN(swap_aouthdr_in,(abfd, aouthdr_ext, aouthdr_int), #endif } -static void -DEFUN(swap_aouthdr_out,(abfd, aouthdr_in, aouthdr_out), +GDB_EXPORT void +DEFUN(bfd_swap_aouthdr_out,(abfd, aouthdr_in, aouthdr_out), bfd *abfd AND struct internal_aouthdr *aouthdr_in AND AOUTHDR *aouthdr_out) @@ -334,8 +342,8 @@ DEFUN(swap_aouthdr_out,(abfd, aouthdr_in, aouthdr_out), #endif } -static void -DEFUN(swap_scnhdr_in,(abfd, scnhdr_ext, scnhdr_int), +GDB_EXPORT void +DEFUN(bfd_coff_swap_scnhdr_in,(abfd, scnhdr_ext, scnhdr_int), bfd *abfd AND SCNHDR *scnhdr_ext AND struct internal_scnhdr *scnhdr_int) @@ -453,6 +461,7 @@ DEFUN(make_a_section_from_file,(abfd, hdr), return_section->lineno_count = hdr->s_nlnno; return_section->userdata = NULL; return_section->next = (asection *) NULL; + return_section->flags = 0; if ((hdr->s_flags & STYP_TEXT) || (hdr->s_flags & STYP_DATA)) return_section->flags = (SEC_LOAD | SEC_ALLOC); else if (hdr->s_flags & STYP_BSS) @@ -515,7 +524,7 @@ DEFUN(coff_real_object_p,(abfd, nscns, internal_f, internal_a), unsigned int i; for (i = 0; i < nscns; i++) { struct internal_scnhdr tmp; - swap_scnhdr_in(abfd, external_sections + i, &tmp); + bfd_coff_swap_scnhdr_in(abfd, external_sections + i, &tmp); make_a_section_from_file(abfd,&tmp); } } @@ -523,18 +532,14 @@ DEFUN(coff_real_object_p,(abfd, nscns, internal_f, internal_a), abfd->obj_machine = 0; switch (internal_f->f_magic) { #ifdef MIPS -#ifdef MIPSEBMAGIC - case SMIPSEBMAGIC: - case SMIPSELMAGIC: - case MIPSEBUMAGIC: - case MIPSELUMAGIC: - case MIPSEBMAGIC: - case MIPSELMAGIC: +case MIPS_MAGIC_1: +case MIPS_MAGIC_2: +case MIPS_MAGIC_3: abfd->obj_arch = bfd_arch_mips; abfd->obj_machine = 0; break; #endif -#endif + #ifdef MC68MAGIC case MC68MAGIC: case M68MAGIC: @@ -630,7 +635,7 @@ DEFUN(coff_object_p,(abfd), if (bfd_read((PTR) &filehdr, 1, FILHSZ, abfd) != FILHSZ) return 0; - swap_filehdr_in(abfd, &filehdr, &internal_f); + bfd_swap_filehdr_in(abfd, &filehdr, &internal_f); if (BADMAG(internal_f)) { bfd_error = wrong_format; @@ -642,7 +647,7 @@ DEFUN(coff_object_p,(abfd), if (bfd_read((PTR) &opthdr, 1,AOUTSZ, abfd) != AOUTSZ) { return 0; } - swap_aouthdr_in(abfd, &opthdr, &internal_a); + bfd_swap_aouthdr_in(abfd, &opthdr, &internal_a); } /* Seek past the opt hdr stuff */ @@ -1167,7 +1172,7 @@ bfd *abfd; #else n.r_type = q->howto->type; #endif - swap_reloc_out(abfd, &n, &dst); + bfd_swap_reloc_out(abfd, &n, &dst); bfd_write((PTR) &n, 1, RELSZ, abfd); } } @@ -1318,7 +1323,12 @@ unsigned *magicp, } break; #endif - +#ifdef MIPS + case bfd_arch_mips: + *magicp = MIPS_MAGIC_2; + return true; + break; +#endif #ifdef MC68MAGIC case bfd_arch_m68k: *magicp = MC68MAGIC; @@ -1609,11 +1619,9 @@ bfd *abfd) { int magic = 0; int flags = 0; coff_set_flags(abfd, &magic, &flags); - internal_f.f_flags |= flags; internal_f.f_magic = magic; internal_f.f_flags = flags; - /* ...and the "opt"hdr... */ #ifdef I960 @@ -1652,12 +1660,12 @@ bfd *abfd) return false; { FILHDR buff; - swap_filehdr_out(abfd, &internal_f, &buff); - bfd_write((PTR) &internal_f, 1, FILHSZ, abfd); + bfd_swap_filehdr_out(abfd, &internal_f, &buff); + bfd_write((PTR) &buff, 1, FILHSZ, abfd); } if (abfd->flags & EXEC_P) { AOUTHDR buff; - swap_aouthdr_out(abfd, &internal_a, &buff); + bfd_swap_aouthdr_out(abfd, &internal_a, &buff); bfd_write((PTR) &buff, 1, AOUTSZ, abfd); } return true; @@ -2347,7 +2355,7 @@ DEFUN(coff_slurp_reloc_table,(abfd, asect, symbols), src++) { struct internal_reloc dst; asymbol *ptr; - swap_reloc_in(abfd, src, &dst); + bfd_swap_reloc_in(abfd, src, &dst); dst.r_symndx += obj_symbol_slew(abfd); cache_ptr->sym_ptr_ptr = symbols + obj_convert(abfd)[dst.r_symndx];