1 /* MIPS Extended-Coff handler for Binary File Diddling.
2 Written by Per Bothner.
4 FIXME, Needs Copyleft here. */
6 /* This does not compile on anything but a MIPS yet (and I haven't been
7 able to test it there either since the latest merge!). So it stays
14 #include "libcoff.h" /* to allow easier abstraction-breaking */
16 #include "intel-coff.h"
21 static reloc_howto_type howto_table[] =
40 { R_RELLONG, 0, 2, 32, 0, 0, true, true},
48 { R_IPRMED, 2, 2,22,1,0, true, true},
50 /* What do we do with this - ? */
52 { R_OPTCALL, 0,2,32,0,0, true, true},
54 { R_OPTCALL, 0,3,32,0,0, true, true},
59 #define ALIGN(this, boundary) \
60 ((( (this) + ((boundary) -1)) & (~((boundary)-1))))
63 /* Support for Motorola 88k bcs coff as well as Intel 960 coff */
70 /* Align an address by rounding it up to a power of two. It leaves the
71 address unchanged if align == 0 (2^0 = alignment of 1 byte) */
72 #define i960_align(addr, align) \
73 ( ((addr) + ((1<<(align))-1)) & (-1 << (align)))
75 #define TAG_SECTION_NAME ".tagbits"
77 /* Libraries shouldn't be doing this stuff anyway! */
82 /* initialize a section structure with information
83 * peculiar to this particular implementation of coff
87 ecoff_new_section_hook(abfd, section)
92 section->output_file_alignment = DEFAULT_SECTION_ALIGNMENT;
93 section->subsection_alignment = section->output_file_alignment;
94 if (abfd->flags & D_PAGED)
97 If the output object file is demand paged then the
98 text section starts at the filehdr, with the first
99 usefull bit of data at the end of the filehdr+opthdr+
100 scnhdrs. Since we don't know how many sections will
101 be put into the output file, we have to recalculate
102 the section pads after each additional section has
105 asection *ptr = abfd->sections;
106 unsigned int padding = FILHSZ + AOUTSZ +SCNHSZ * abfd->section_count;
108 padding = ALIGN(padding, ptr->output_file_alignment);
111 ptr->start_pad = padding;
112 /* Only the first section is padded */
120 /* If the object is not demand paged, then all the sections
123 section->start_pad = 0;
129 /* actually it makes itself and its children from the file headers */
131 make_a_section_from_file (abfd, hdr)
136 asection *return_section ;
138 { char *name = (char *)xmalloc(9);
140 strncpy(name, (char *)&hdr->s_name[0], 8);
142 return_section = bfd_make_section(abfd, name);
143 (return_section->name)[8] = 0;
146 /* s_paddr is presumed to be = to s_vaddr */
147 /* FIXME -- needs to call swapping routines */
148 #define assign(to, from) return_section->to = hdr->from
149 assign (vma, s_vaddr);
150 assign (original_vma, s_vaddr);
151 assign (size, s_size);
152 assign (filepos, s_scnptr);
153 assign (rel_filepos, s_relptr);
154 assign (reloc_count, s_nreloc);
156 assign (alignment, s_align);
158 assign (line_filepos, s_lnnoptr);
159 /* return_section->linesize = hdr->s_nlnno * sizeof (struct lineno);*/
162 return_section->lineno_count = hdr->s_nlnno;
163 return_section->userdata = (void *)NULL;
164 return_section->next = (asection *)NULL;
165 if ((hdr->s_flags & STYP_TEXT) || (hdr->s_flags & STYP_DATA))
166 return_section->flags = (SEC_LOAD | SEC_ALLOC);
167 else if (hdr->s_flags & STYP_BSS)
168 return_section->flags = SEC_ALLOC;
170 if (hdr->s_nreloc != 0) return_section->flags |= SEC_RELOC;
176 ecoff_real_object_p (abfd, nscns, opthdr)
178 unsigned short nscns, opthdr;
180 struct icofdata *tdata;
181 char *file_info; /* buffer for all the headers */
182 long readsize; /* length of file_info */
183 struct filehdr* filehdr; /* points into file_info */
184 struct scnhdr *sections; /* points into file_info */
186 /* OK, now we know the format, read in the filehdr, soi-disant
187 "optional header", and all the sections.*/
188 readsize = sizeof(struct filehdr) + opthdr + (nscns * sizeof (struct scnhdr));
189 file_info = xmalloc (readsize);
190 if (file_info == NULL) {
191 bfd_error = no_memory;
194 if (bfd_seek (abfd, 0, false) < 0) return 0;
195 if (bfd_read (file_info, 1, readsize, abfd) != readsize) return 0;
196 filehdr = (struct filehdr *) file_info;
197 sections = (struct scnhdr *) (file_info + sizeof (struct filehdr) + opthdr);
199 /* Now copy data as required; construct all asections etc */
200 tdata = (struct icofdata *) xmalloc (sizeof (struct icofdata) +
203 bfd_error = no_memory;
210 for (i = 0; i < nscns; i++)
212 make_a_section_from_file (abfd, sections + i);
217 /* OK, now make a section for the tagbits if there were any */
220 AOUTHDR *aouthdr; /* points into tdata! */
221 aouthdr = (AOUTHDR *) (((char *) tdata) + sizeof (struct icofdata));
222 if (aouthdr->tagentries != 0) {
223 asection *tag_section = (asection *) xmalloc (sizeof (asection));
224 if (tag_section == NULL) {
228 tag_section->size = aouthdr->tagentries * sizeof (TAGBITS);
229 tag_section->name = TAG_SECTION_NAME;
230 tag_section->filepos = readsize; /* not surprisingly */
231 /* Put this one first */
232 tag_section->next = abfd->sections;
233 abfd->sections = tag_section;
238 abfd->flags |= HAS_RELOC | HAS_LINENO | HAS_LOCALS;
241 /* FIXME, the guess should be set by OR-ing info from the sections */
242 if ((filehdr->f_flags & F_RELFLG) != F_RELFLG) abfd->flags &= ~HAS_RELOC;
243 if ((filehdr->f_flags & F_EXEC) == F_EXEC) abfd->flags |= EXEC_P;
244 if ((filehdr->f_flags & F_LNNO) != F_LNNO) abfd->flags &= ~HAS_LINENO;
245 if ((filehdr->f_flags & F_LSYMS) != F_LSYMS) abfd->flags &= ~HAS_LOCALS;
247 bfd_get_symcount (abfd) = filehdr->f_nsyms;
248 if (filehdr->f_nsyms) abfd->flags |= HAS_SYMS;
250 tdata->sym_filepos = filehdr->f_symptr;
251 tdata->hdr = (struct aouthdr *)(file_info + sizeof (struct filehdr));
252 tdata->symbols = (esymbol *)NULL;
253 bfd_get_start_address (abfd) = exec_hdr (abfd)->entry;
258 ecoff_object_p (abfd)
261 unsigned short magic, nscns, opthdr;
263 bfd_error = no_error;
265 /* figure out how much to read */
266 if (bfd_read (&magic, 1, sizeof (magic), abfd) != sizeof (magic))
269 magic = bfd_h_getshort (abfd, (unsigned char *)&magic);
270 if (magic != (abfd->xvec->byteorder_big_p ? 0x160 : 0x162)) {
271 bfd_error = wrong_format;
274 if (bfd_read (&nscns, 1, sizeof (nscns), abfd) != sizeof (nscns))
276 nscns = bfd_h_getshort (abfd, (unsigned char *)&nscns);
278 if (bfd_seek (abfd, ((sizeof (long)) * 3), true) < 0) return false;
279 if (bfd_read (&opthdr, 1, sizeof (opthdr), abfd) != sizeof (opthdr))
281 opthdr = bfd_h_getshort (abfd, (unsigned char *)&opthdr);
283 return ecoff_real_object_p (abfd, nscns, opthdr);
287 ecoff_mkobject (abfd)
293 bfd_error = no_error;
295 /* Use an intermediate variable for clarity */
296 rawptr = xmalloc (sizeof (struct icofdata) + sizeof (AOUTHDR));
297 if (rawptr == NULL) {
298 bfd_error = no_memory;
302 abfd->tdata = (struct icofdata *) rawptr;
303 exec_hdr (abfd) = (AOUTHDR *) (rawptr + sizeof (struct icofdata));
309 ecoff_count_linenumbers(abfd)
312 unsigned int limit = bfd_get_symcount(abfd);
314 esymbol **p = (esymbol **)(abfd->outsymbols);
316 asection *s = abfd->sections;
318 if (s->lineno_count != 0) {
319 fatal("Bad initial state");
330 /* This symbol has a linenumber, increment the
331 * owning section's linenumber count */
332 alent *l = q->c.lineno;
333 q->c.section->lineno_count++;
335 while (l->line_number) {
336 q->c.section->lineno_count++;
346 run through the internal symbol table and make all the
347 pointers and things within the table point to the right places
351 ecoff_mangle_symbols(abfd)
354 esymbol **p = (esymbol **)(abfd->outsymbols);
355 unsigned int native_index = 0;
356 unsigned int last_file_index = 0;
357 unsigned int limit = bfd_get_symcount(abfd);
358 struct syment *last_file_symbol = (struct syment *)NULL;
361 struct syment *native = q->native;
363 /* Alter the native representation */
365 native->n_value = q->c.value;
366 if (q->c.flags & BSF_FORT_COMM) {
369 else if (q->c.flags & BSF_DEBUGGING) {
370 native->n_scnum = -2;
372 else if (q->c.flags & BSF_UNDEFINED) {
375 else if (q->c.flags & BSF_ABSOLUTE) {
376 native->n_scnum = -1;
379 native->n_scnum = q->c.section->index + 1;
381 if (native->n_numaux)
383 union auxent *a = (union auxent *)(native+1);
384 /* Relocate symbol indexes */
385 if (ISFCN(native->n_type))
387 a->x_sym.x_fcnary.x_fcn.x_endndx += last_file_index;
389 else if(native->n_sclass == C_BLOCK && q->c.name[1] == 'b')
391 a->x_sym.x_fcnary.x_fcn.x_endndx += last_file_index;
394 else if (native->n_sclass == C_STRTAG)
396 a->x_sym.x_fcnary.x_fcn.x_endndx += last_file_index;
398 else if (native->n_sclass == C_MOS || native->n_sclass == C_EOS || native->n_sclass == C_MOE)
400 a->x_sym.x_tagndx += last_file_index;
405 switch (native->n_sclass) {
410 case 19: /*C_REGARG:FIXME */
411 /* Fix so that they have an absolute section */
416 /* Chain all the .file symbols together */
417 if(last_file_symbol) {
418 last_file_symbol->n_value = native_index;
420 last_file_symbol = native;
421 last_file_index = native_index;
437 /* Bogus: This should be returning an error code, not printing
439 /* warning("Unrecognised sclass %d", native->n_sclass); */
442 native_index += 1 + native->n_numaux;
451 ecoff_write_symbols(abfd)
458 ecoff_write_linenumbers(abfd)
465 ecoff_make_empty_symbol(abfd, n)
470 esymbol *new = (esymbol *)xmalloc(sizeof(esymbol) * n);
471 for (j= 0; j < n; j++) {
473 new[j].c.lineno = (alent *)NULL;
475 return (asymbol *)new;
481 ecoff_write_object_contents (abfd)
487 /* Calculate the file position for each section. */
490 ecoff_compute_section_file_positions (abfd)
493 file_ptr sofar = sizeof (struct filehdr) + sizeof (AOUTHDR);
496 sofar += abfd->section_count * sizeof (struct scnhdr);
497 for (current = abfd->sections; current != NULL; current = current->next) {
498 sofar = ALIGN(sofar, current->output_file_alignment);
499 current->filepos = sofar;
500 /* Only add sections which are loadable */
501 if (current->flags & SEC_LOAD) sofar += current->size;
503 if(current->filepos & (current->alignment-1)) {
504 sofar += current->alignment - (current->filepos &(current->alignment-1));
505 current->filepos = (current->filepos + current->alignment) & -current->alignment;
509 obj_relocbase (abfd) = sofar;
513 ecoff_set_section_contents (abfd, section, location, offset, count)
516 unsigned char *location;
524 ecoff_set_section_linenos (abfd, section, location, offset, count)
527 unsigned char *location;
536 ecoff_close_and_cleanup (abfd)
547 buy_and_read(abfd, where, relative, size)
553 void *area = (void *)xmalloc(size);
555 bfd_error = no_memory;
558 bfd_seek(abfd, where, relative);
559 if (bfd_read(area, 1, size, abfd) != size){
560 bfd_error = system_call_error;
568 struct sec_struct *section_from_bfd_index(abfd, index)
573 struct sec_struct *answer = abfd->sections;
576 answer = answer->next;
584 ecoff_get_symcount_upper_bound (abfd)
587 fatal("call to ecoff_get_symcount_upper_bound");
592 ecoff_get_first_symbol (abfd)
599 ecoff_get_next_symbol (abfd, oidx)
603 if (oidx == BFD_NO_MORE_SYMBOLS) return BFD_NO_MORE_SYMBOLS;
604 return ++oidx >= bfd_get_symcount (abfd) ? BFD_NO_MORE_SYMBOLS : oidx;
608 ecoff_symbol_name (abfd, idx)
612 return (obj_symbols (abfd) + idx)->c.name;
616 ecoff_symbol_value (abfd, idx)
620 return (obj_symbols (abfd) + idx)->c.value;
624 ecoff_classify_symbol (abfd, idx)
628 esymbol *sym = obj_symbols (abfd) + idx;
630 if ((sym->c.flags & BSF_FORT_COMM) != 0) return bfd_symclass_fcommon;
631 if ((sym->c.flags & BSF_GLOBAL) != 0) return bfd_symclass_global;
632 if ((sym->c.flags & BSF_DEBUGGING) != 0) return bfd_symclass_debugger;
633 if ((sym->c.flags & BSF_UNDEFINED) != 0) return bfd_symclass_undefined;
635 return bfd_symclass_unknown;
639 ecoff_symbol_hasclass (abfd, idx, class)
645 esymbol *sym = obj_symbols (abfd) + idx;
649 case bfd_symclass_fcommon: return (sym->c.flags & BSF_FORT_COMM) != 0;
650 case bfd_symclass_global: return (sym->c.flags & BSF_GLOBAL) != 0;
651 case bfd_symclass_debugger: return (sym->c.flags & BSF_DEBUGGING) != 0;
652 case bfd_symclass_undefined: return (sym->c.flags & BSF_UNDEFINED) != 0;
654 default: return false;
663 ecoff_slurp_line_table (abfd, asect)
671 ecoff_slurp_symbol_table(abfd)
674 struct syment *native_symbols;
675 esymbol *cached_area;
676 char *string_table = (char *)NULL;
677 unsigned int string_table_size;
678 unsigned int number_of_symbols = 0;
679 if (obj_symbols (abfd)) return true;
680 bfd_seek(abfd, obj_sym_filepos(abfd), false);
681 /* Read in the symbol table */
683 (struct syment *)buy_and_read(abfd,
684 obj_sym_filepos(abfd),
686 bfd_get_symcount(abfd) * sizeof(struct syment));
687 if (!native_symbols) {
692 /* Allocate enough room for all the symbols in cached form */
693 cached_area = (esymbol *)xmalloc(bfd_get_symcount(abfd) * sizeof(esymbol));
698 esymbol *dst = cached_area;
699 unsigned int last_native_index = bfd_get_symcount(abfd);
700 unsigned int this_index = 0;
701 while (this_index < last_native_index)
703 struct syment *src = native_symbols + this_index;
704 if (src->n_zeroes == 0) {
705 /* This symbol has a name in the string table */
706 /* Which means that we'll have to read it in */
708 /* Fetch the size of the string table which is straight after the
711 if (string_table == (char *)NULL) {
712 if (bfd_read(&string_table_size, sizeof(string_table_size), 1, abfd) !=
713 sizeof(string_table_size)) {
714 fatal("Corrupt coff format");
717 /* Read the string table */
719 (char *)buy_and_read(abfd,0, true,
720 string_table_size - sizeof(string_table_size)) ;
726 dst->c.name = string_table + src->n_offset - 4;
729 /* Otherwise we have to buy somewhere for this name */
730 dst->c.name = xmalloc (SYMNMLEN+1);
731 strncpy(dst->c.name, src->n_name, SYMNMLEN);
732 dst->c.name[SYMNMLEN+1] = '\0'; /* Be sure to terminate it */
735 /* We use the native name field to point to the cached field */
736 src->n_zeroes = (long)dst;
737 dst->c.section = section_from_bfd_index(abfd, src->n_scnum);
738 switch (src->n_sclass)
742 dst->c.value = src->n_value - dst->c.section->vma;
743 dst->c.flags = BSF_EXPORT | BSF_GLOBAL;
744 dst->c.flags |= BSF_NOT_AT_END;
750 if (src->n_scnum == 0) {
751 if (src->n_value == 0)
753 dst->c.flags = BSF_UNDEFINED;
756 dst->c.flags = BSF_FORT_COMM;
757 dst->c.value = src->n_value;
762 /* Base the value as an index from the base of the section */
763 if (dst->c.section == (asection *)NULL)
765 dst->c.flags = BSF_EXPORT | BSF_GLOBAL | BSF_ABSOLUTE;
766 dst->c.value = src->n_value;
770 dst->c.flags = BSF_EXPORT | BSF_GLOBAL;
771 dst->c.value = src->n_value - dst->c.section->vma;
773 if (ISFCN(src->n_type)) {
774 /* A function ext does not go at the end of a file*/
775 dst->c.flags |= BSF_NOT_AT_END;
781 case C_STAT : /* static */
782 case C_LABEL : /* label */
783 dst->c.flags = BSF_LOCAL;
784 /* Base the value as an index from the base of the section */
785 dst->c.value = src->n_value - dst->c.section->vma;
788 case C_MOS : /* member of structure */
789 case C_EOS : /* end of structure */
790 case C_REGPARM : /* register parameter */
791 case C_REG : /* register variable */
792 case 19 : /* Intel specific REGARG FIXME */
793 case C_TPDEF : /* type definition */
796 case C_AUTO: /* automatic variable */
797 case C_FIELD: /* bit field */
798 case C_ENTAG : /* enumeration tag */
799 case C_MOE : /* member of enumeration */
800 case C_MOU : /* member of union */
801 case C_UNTAG : /* union tag */
803 dst->c.flags = BSF_DEBUGGING;
804 dst->c.value = src->n_value;
807 case C_FILE : /* file name */
808 case C_STRTAG : /* structure tag */
809 dst->c.flags = BSF_DEBUGGING;
810 dst->c.value = src->n_value ;
813 case C_BLOCK : /* ".bb" or ".eb" */
814 case C_FCN : /* ".bf" or ".ef" */
815 dst->c.flags = BSF_LOCAL;
816 /* Base the value as an index from the base of the section */
817 dst->c.value = src->n_value - dst->c.section->vma;
820 case C_EFCN : /* physical end of function */
822 case C_EXTDEF : /* external definition */
823 case C_ULABEL : /* undefined label */
824 case C_USTATIC : /* undefined static */
825 case C_LINE : /* line # reformatted as symbol table entry */
826 case C_ALIAS : /* duplicate tag */
827 case C_HIDDEN : /* ext symbol in dmert public lib */
831 printf("SICK%d\n",src->n_sclass);
832 dst->c.flags = BSF_DEBUGGING;
833 dst->c.value = src->n_value ;
841 if (dst->c.flags == 0) fatal("OOOO dear");
845 dst->c.lineno = (alent *)NULL;
846 this_index += src->n_numaux + 1;
852 obj_symbols(abfd) = cached_area;
853 obj_raw_syments(abfd) = native_symbols;
854 bfd_get_symcount(abfd) = number_of_symbols;
856 /* Slurp the line tables for each section too */
861 ecoff_slurp_line_table(abfd, p);
869 ecoff_get_symtab_upper_bound (abfd)
872 if (!ecoff_slurp_symbol_table (abfd)) return 0;
874 return (bfd_get_symcount (abfd)+1) * (sizeof (esymbol *));
879 ecoff_get_symtab(abfd, alocation)
883 unsigned int counter = 0;
885 esymbol **location = (esymbol **)(alocation);
887 if (!ecoff_slurp_symbol_table (abfd)) return 0;
889 for (symbase = obj_symbols (abfd); counter++ < bfd_get_symcount (abfd);)
890 *(location++) = symbase++;
896 ecoff_get_reloc_upper_bound (abfd, asect)
900 if (bfd_get_format (abfd) != bfd_object) {
901 bfd_error = invalid_operation;
905 return (asect->reloc_count + 1) * sizeof(arelent *);
912 ecoff_slurp_reloc_table (abfd, asect)
916 struct reloc *native_relocs;
917 arelent *reloc_cache;
919 if (asect->relocation) return true;
920 if (asect->reloc_count ==0) return true;
921 if (!ecoff_slurp_symbol_table (abfd)) return false;
923 native_relocs = (struct reloc *)buy_and_read(abfd,
926 sizeof(struct reloc) * asect->reloc_count);
927 reloc_cache = (arelent *)xmalloc(asect->reloc_count * sizeof(arelent ));
931 unsigned int counter = 0;
932 arelent *cache_ptr = reloc_cache;
933 struct reloc *src = native_relocs;
934 while (counter < asect->reloc_count)
936 cache_ptr->address = src->r_vaddr - asect->original_vma;
937 cache_ptr->sym = (asymbol *)(src->r_symndx +
938 obj_raw_syments (abfd))->n_zeroes;
939 /* The symbols that we have read in have been relocated as if their
940 * sections started at 0. But the offsets refering to the symbols
941 * in the raw data have not been modified, so we have to have
942 * a negative addend to compensate
944 if (cache_ptr->sym->section) {
945 cache_ptr->addend = - cache_ptr->sym->section->original_vma;
948 /* If the symbol doesn't have a section then it hasn't been relocated,
949 * so we don't have to fix it
951 cache_ptr->addend = 0;
954 cache_ptr->section = 0;
956 cache_ptr->howto = howto_table + src->r_type;
959 if (src->r_type >= R_PCR16L && src->r_type <= R_VRT32)
961 cache_ptr->howto = howto_table + src->r_type - R_PCR16L;
965 fatal("unrecognised reloc type %d\n", src->r_type);
975 free (native_relocs);
976 asect->relocation = reloc_cache;
981 /* This is stupid. This function should be a boolean predicate */
983 ecoff_canonicalize_reloc (abfd, section, relptr)
991 bfd_target ecoff_little_vec =
992 {"ecoff-littlemips", /* name */
993 false, /* data byte order is little */
994 false, /* header byte order is little */
996 (HAS_RELOC | EXEC_P | /* object flags */
997 HAS_LINENO | HAS_DEBUG |
998 HAS_SYMS | HAS_LOCALS | DYNAMIC | WP_TEXT),
1000 (SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* section flags */
1001 0, /* valid reloc types */
1002 '/', /* ar_pad_char */
1003 15, /* ar_max_namelen */
1004 ecoff_close_and_cleanup, /* _close_and_cleanup */
1005 ecoff_set_section_contents, /* bfd_set_section_contents */
1006 ecoff_new_section_hook, /* new_section_hook */
1007 _bfd_dummy_core_file_failing_command, /* _core_file_failing_command */
1008 _bfd_dummy_core_file_failing_signal, /* _core_file_failing_signal */
1009 _bfd_dummy_core_file_matches_executable_p, /* _core_file_matches_ex...p */
1011 bfd_slurp_coff_armap, /* bfd_slurp_armap */
1012 _bfd_slurp_extended_name_table, /* bfd_slurp_extended_name_table*/
1013 bfd_dont_truncate_arname, /* bfd_truncate_arname */
1015 ecoff_get_symtab_upper_bound, /* get_symtab_upper_bound */
1016 ecoff_get_symtab, /* canonicalize_symtab */
1017 (void (*)())bfd_false, /* bfd_reclaim_symbol_table */
1018 ecoff_get_reloc_upper_bound, /* get_reloc_upper_bound */
1019 ecoff_canonicalize_reloc, /* bfd_canonicalize_reloc */
1020 (void (*)())bfd_false, /* bfd_reclaim_reloc */
1022 ecoff_get_symcount_upper_bound, /* bfd_get_symcount_upper_bound */
1023 ecoff_get_first_symbol, /* bfd_get_first_symbol */
1024 ecoff_get_next_symbol, /* bfd_get_next_symbol */
1025 ecoff_classify_symbol, /* bfd_classify_symbol */
1026 ecoff_symbol_hasclass, /* bfd_symbol_hasclass */
1027 ecoff_symbol_name, /* bfd_symbol_name */
1028 ecoff_symbol_value, /* bfd_symbol_value */
1030 _do_getllong, _do_putllong, _do_getlshort, _do_putlshort, /* data */
1031 _do_getllong, _do_putllong, _do_getlshort, _do_putlshort, /* hdrs */
1033 {_bfd_dummy_target, ecoff_object_p, /* bfd_check_format */
1034 bfd_generic_archive_p, _bfd_dummy_target},
1035 {bfd_false, ecoff_mkobject, bfd_false, /* bfd_set_format */
1037 ecoff_make_empty_symbol,
1042 bfd_target ecoff_big_vec =
1043 {"ecoff-bigmips", /* name */
1044 true, /* data byte order is big */
1045 true, /* header byte order is big */
1047 (HAS_RELOC | EXEC_P | /* object flags */
1048 HAS_LINENO | HAS_DEBUG |
1049 HAS_SYMS | HAS_LOCALS | DYNAMIC | WP_TEXT),
1051 (SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* section flags */
1052 0, /* valid reloc types */
1053 '/', /* ar_pad_char */
1054 15, /* ar_max_namelen */
1055 ecoff_close_and_cleanup, /* _close_and_cleanup */
1056 ecoff_set_section_contents, /* bfd_set_section_contents */
1057 ecoff_new_section_hook, /* new_section_hook */
1058 _bfd_dummy_core_file_failing_command, /* _core_file_failing_command */
1059 _bfd_dummy_core_file_failing_signal, /* _core_file_failing_signal */
1060 _bfd_dummy_core_file_matches_executable_p, /* _core_file_matches_ex...p */
1062 bfd_slurp_coff_armap, /* bfd_slurp_armap */
1063 _bfd_slurp_extended_name_table, /* bfd_slurp_extended_name_table*/
1064 bfd_dont_truncate_arname, /* bfd_truncate_arname */
1066 ecoff_get_symtab_upper_bound, /* get_symtab_upper_bound */
1067 ecoff_get_symtab, /* canonicalize_symtab */
1068 (void (*)())bfd_false, /* bfd_reclaim_symbol_table */
1069 ecoff_get_reloc_upper_bound, /* get_reloc_upper_bound */
1070 ecoff_canonicalize_reloc, /* bfd_canonicalize_reloc */
1071 (void (*)())bfd_false, /* bfd_reclaim_reloc */
1073 ecoff_get_symcount_upper_bound, /* bfd_get_symcount_upper_bound */
1074 ecoff_get_first_symbol, /* bfd_get_first_symbol */
1075 ecoff_get_next_symbol, /* bfd_get_next_symbol */
1076 ecoff_classify_symbol, /* bfd_classify_symbol */
1077 ecoff_symbol_hasclass, /* bfd_symbol_hasclass */
1078 ecoff_symbol_name, /* bfd_symbol_name */
1079 ecoff_symbol_value, /* bfd_symbol_value */
1081 _do_getblong, _do_putblong, _do_getbshort, _do_putbshort, /* data */
1082 _do_getblong, _do_putblong, _do_getbshort, _do_putbshort, /* hdrs */
1084 {_bfd_dummy_target, ecoff_object_p, /* bfd_check_format */
1085 bfd_generic_archive_p, _bfd_dummy_target},
1086 {bfd_false, ecoff_mkobject, bfd_false, /* bfd_set_format */
1088 ecoff_make_empty_symbol,
1093 #endif /* ECOFF_BFD */