1 /* BFD back-end for ieee-695 objects.
2 Copyright (C) 1990, 91, 92, 93, 94, 95, 1996 Free Software Foundation, Inc.
3 Written by Steve Chamberlain of Cygnus Support.
5 This file is part of BFD, the Binary File Descriptor library.
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
21 #define KEEPMINUSPCININST 0
23 /* IEEE 695 format is a stream of records, which we parse using a simple one-
24 token (which is one byte in this lexicon) lookahead recursive decent
33 static boolean ieee_write_byte PARAMS ((bfd *, bfd_byte));
34 static boolean ieee_write_2bytes PARAMS ((bfd *, int));
35 static boolean ieee_write_int PARAMS ((bfd *, bfd_vma));
36 static boolean ieee_write_id PARAMS ((bfd *, const char *));
37 static boolean ieee_write_expression
38 PARAMS ((bfd *, bfd_vma, asymbol *, boolean, unsigned int));
39 static void ieee_write_int5 PARAMS ((bfd_byte *, bfd_vma));
40 static boolean ieee_write_int5_out PARAMS ((bfd *, bfd_vma));
41 static boolean ieee_write_section_part PARAMS ((bfd *));
42 static boolean do_with_relocs PARAMS ((bfd *, asection *));
43 static boolean do_as_repeat PARAMS ((bfd *, asection *));
44 static boolean do_without_relocs PARAMS ((bfd *, asection *));
45 static boolean ieee_write_external_part PARAMS ((bfd *));
46 static boolean ieee_write_data_part PARAMS ((bfd *));
47 static boolean ieee_write_debug_part PARAMS ((bfd *));
48 static boolean ieee_write_me_part PARAMS ((bfd *));
50 static boolean ieee_slurp_debug PARAMS ((bfd *));
52 /* Functions for writing to ieee files in the strange way that the
56 ieee_write_byte (abfd, byte)
60 if (bfd_write ((PTR) &byte, 1, 1, abfd) != 1)
66 ieee_write_2bytes (abfd, bytes)
72 buffer[0] = bytes >> 8;
73 buffer[1] = bytes & 0xff;
74 if (bfd_write ((PTR) buffer, 1, 2, abfd) != 2)
80 ieee_write_int (abfd, value)
86 if (! ieee_write_byte (abfd, (bfd_byte) value))
93 /* How many significant bytes ? */
94 /* FIXME FOR LONGER INTS */
95 if (value & 0xff000000)
97 else if (value & 0x00ff0000)
99 else if (value & 0x0000ff00)
104 if (! ieee_write_byte (abfd,
105 (bfd_byte) ((int) ieee_number_repeat_start_enum
111 if (! ieee_write_byte (abfd, (bfd_byte) (value >> 24)))
115 if (! ieee_write_byte (abfd, (bfd_byte) (value >> 16)))
119 if (! ieee_write_byte (abfd, (bfd_byte) (value >> 8)))
123 if (! ieee_write_byte (abfd, (bfd_byte) (value)))
132 ieee_write_id (abfd, id)
136 size_t length = strlen (id);
140 if (! ieee_write_byte (abfd, (bfd_byte) length))
143 else if (length < 255)
145 if (! ieee_write_byte (abfd, ieee_extension_length_1_enum)
146 || ! ieee_write_byte (abfd, (bfd_byte) length))
149 else if (length < 65535)
151 if (! ieee_write_byte (abfd, ieee_extension_length_2_enum)
152 || ! ieee_write_2bytes (abfd, (int) length))
157 (*_bfd_error_handler)
158 ("%s: string too long (%d chars, max 65535)",
159 bfd_get_filename (abfd), length);
160 bfd_set_error (bfd_error_invalid_operation);
164 if (bfd_write ((PTR) id, 1, length, abfd) != length)
169 /***************************************************************************
170 Functions for reading from ieee files in the strange way that the
174 #define this_byte(ieee) *((ieee)->input_p)
175 #define next_byte(ieee) ((ieee)->input_p++)
176 #define this_byte_and_next(ieee) (*((ieee)->input_p++))
178 static unsigned short
180 common_header_type *ieee;
182 unsigned char c1 = this_byte_and_next (ieee);
183 unsigned char c2 = this_byte_and_next (ieee);
184 return (c1 << 8) | c2;
188 bfd_get_string (ieee, string, length)
189 common_header_type *ieee;
194 for (i = 0; i < length; i++)
196 string[i] = this_byte_and_next (ieee);
202 common_header_type *ieee;
206 length = this_byte_and_next (ieee);
209 /* Simple string of length 0 to 127 */
211 else if (length == 0xde)
213 /* Length is next byte, allowing 0..255 */
214 length = this_byte_and_next (ieee);
216 else if (length == 0xdf)
218 /* Length is next two bytes, allowing 0..65535 */
219 length = this_byte_and_next (ieee);
220 length = (length * 256) + this_byte_and_next (ieee);
222 /* Buy memory and read string */
223 string = bfd_alloc (ieee->abfd, length + 1);
226 bfd_get_string (ieee, string, length);
232 ieee_write_expression (abfd, value, symbol, pcrel, index)
239 unsigned int term_count = 0;
243 if (! ieee_write_int (abfd, value))
248 if (bfd_is_com_section (symbol->section)
249 || bfd_is_und_section (symbol->section))
251 /* Def of a common symbol */
252 if (! ieee_write_byte (abfd, ieee_variable_X_enum)
253 || ! ieee_write_int (abfd, symbol->value))
257 else if (! bfd_is_abs_section (symbol->section))
259 /* Ref to defined symbol - */
261 if (! ieee_write_byte (abfd, ieee_variable_R_enum)
262 || ! ieee_write_byte (abfd,
263 (bfd_byte) (symbol->section->index
264 + IEEE_SECTION_NUMBER_BASE)))
267 if (symbol->flags & BSF_GLOBAL)
269 if (! ieee_write_byte (abfd, ieee_variable_I_enum)
270 || ! ieee_write_int (abfd, symbol->value))
274 else if (symbol->flags & (BSF_LOCAL | BSF_SECTION_SYM))
276 /* This is a reference to a defined local symbol. We can
277 easily do a local as a section+offset. */
278 if (! ieee_write_int (abfd, symbol->value))
284 (*_bfd_error_handler)
285 ("%s: unrecognized symbol `%s' flags 0x%x",
286 bfd_get_filename (abfd), bfd_asymbol_name (symbol),
288 bfd_set_error (bfd_error_invalid_operation);
295 /* subtract the pc from here by asking for PC of this section*/
296 if (! ieee_write_byte (abfd, ieee_variable_P_enum)
297 || ! ieee_write_byte (abfd,
298 (bfd_byte) (index + IEEE_SECTION_NUMBER_BASE))
299 || ! ieee_write_byte (abfd, ieee_function_minus_enum))
303 while (term_count > 1)
305 if (! ieee_write_byte (abfd, ieee_function_plus_enum))
313 /*****************************************************************************/
316 writes any integer into the buffer supplied and always takes 5 bytes
319 ieee_write_int5 (buffer, value)
323 buffer[0] = (bfd_byte) ieee_number_repeat_4_enum;
324 buffer[1] = (value >> 24) & 0xff;
325 buffer[2] = (value >> 16) & 0xff;
326 buffer[3] = (value >> 8) & 0xff;
327 buffer[4] = (value >> 0) & 0xff;
331 ieee_write_int5_out (abfd, value)
337 ieee_write_int5 (b, value);
338 if (bfd_write ((PTR) b, 1, 5, abfd) != 5)
344 parse_int (ieee, value_ptr)
345 common_header_type *ieee;
348 int value = this_byte (ieee);
350 if (value >= 0 && value <= 127)
356 else if (value >= 0x80 && value <= 0x88)
358 unsigned int count = value & 0xf;
363 result = (result << 8) | this_byte_and_next (ieee);
374 common_header_type *ieee;
378 *ok = parse_int (ieee, &x);
383 must_parse_int (ieee)
384 common_header_type *ieee;
387 BFD_ASSERT (parse_int (ieee, &result) == true);
395 ieee_symbol_index_type symbol;
399 static reloc_howto_type abs32_howto =
406 complain_overflow_bitfield,
414 static reloc_howto_type abs16_howto =
421 complain_overflow_bitfield,
429 static reloc_howto_type abs8_howto =
436 complain_overflow_bitfield,
444 static reloc_howto_type rel32_howto =
451 complain_overflow_signed,
459 static reloc_howto_type rel16_howto =
466 complain_overflow_signed,
474 static reloc_howto_type rel8_howto =
481 complain_overflow_signed,
489 static ieee_symbol_index_type NOSYMBOL = {0, 0};
492 parse_expression (ieee, value, symbol, pcrel, extra, section)
493 ieee_data_type *ieee;
495 ieee_symbol_index_type *symbol;
508 ieee_value_type stack[10];
510 /* The stack pointer always points to the next unused location */
511 #define PUSH(x,y,z) TOS.symbol=x;TOS.section=y;TOS.value=z;INC;
512 #define POP(x,y,z) DEC;x=TOS.symbol;y=TOS.section;z=TOS.value;
513 ieee_value_type *sp = stack;
517 switch (this_byte (&(ieee->h)))
519 case ieee_variable_P_enum:
520 /* P variable, current program counter for section n */
523 next_byte (&(ieee->h));
525 section_n = must_parse_int (&(ieee->h));
526 PUSH (NOSYMBOL, bfd_abs_section_ptr,
527 TOS.value = ieee->section_table[section_n]->vma +
528 ieee_per_section (ieee->section_table[section_n])->pc);
531 case ieee_variable_L_enum:
532 /* L variable address of section N */
533 next_byte (&(ieee->h));
534 PUSH (NOSYMBOL, ieee->section_table[must_parse_int (&(ieee->h))], 0);
536 case ieee_variable_R_enum:
537 /* R variable, logical address of section module */
538 /* FIXME, this should be different to L */
539 next_byte (&(ieee->h));
540 PUSH (NOSYMBOL, ieee->section_table[must_parse_int (&(ieee->h))], 0);
542 case ieee_variable_S_enum:
543 /* S variable, size in MAUS of section module */
544 next_byte (&(ieee->h));
547 ieee->section_table[must_parse_int (&(ieee->h))]->_raw_size);
549 case ieee_variable_I_enum:
550 case ieee_variable_X_enum:
551 /* Push the address of external variable n */
553 ieee_symbol_index_type sy;
554 next_byte (&(ieee->h));
555 sy.index = (int) (must_parse_int (&(ieee->h)));
558 PUSH (sy, bfd_und_section_ptr, 0);
561 case ieee_function_minus_enum:
563 bfd_vma value1, value2;
564 asection *section1, *section_dummy;
565 ieee_symbol_index_type sy;
566 next_byte (&(ieee->h));
568 POP (sy, section1, value1);
569 POP (sy, section_dummy, value2);
570 PUSH (sy, section1 ? section1 : section_dummy, value1 - value2);
573 case ieee_function_plus_enum:
575 bfd_vma value1, value2;
578 ieee_symbol_index_type sy1;
579 ieee_symbol_index_type sy2;
580 next_byte (&(ieee->h));
582 POP (sy1, section1, value1);
583 POP (sy2, section2, value2);
584 PUSH (sy1.letter ? sy1 : sy2,
585 bfd_is_abs_section (section1) ? section2 : section1,
592 BFD_ASSERT (this_byte (&(ieee->h)) < (int) ieee_variable_A_enum
593 || this_byte (&(ieee->h)) > (int) ieee_variable_Z_enum);
594 if (parse_int (&(ieee->h), &va))
596 PUSH (NOSYMBOL, bfd_abs_section_ptr, va);
601 Thats all that we can understand. As far as I can see
602 there is a bug in the Microtec IEEE output which I'm
603 using to scan, whereby the comma operator is omitted
604 sometimes in an expression, giving expressions with too
605 many terms. We can tell if that's the case by ensuring
606 that sp == stack here. If not, then we've pushed
607 something too far, so we keep adding. */
609 while (sp != stack + 1)
612 ieee_symbol_index_type sy1;
613 POP (sy1, section1, *extra);
618 POP (*symbol, dummy, *value);
631 #define ieee_seek(abfd, offset) \
632 IEEE_DATA(abfd)->h.input_p = IEEE_DATA(abfd)->h.first_byte + offset
634 #define ieee_pos(abfd) \
635 (IEEE_DATA(abfd)->h.input_p - IEEE_DATA(abfd)->h.first_byte)
637 static unsigned int last_index;
638 static char last_type; /* is the index for an X or a D */
640 static ieee_symbol_type *
650 ieee_data_type *ieee;
651 ieee_symbol_type *last_symbol;
652 unsigned int *symbol_count;
653 ieee_symbol_type ***pptr;
654 unsigned int *max_index;
658 /* Need a new symbol */
659 unsigned int new_index = must_parse_int (&(ieee->h));
660 if (new_index != last_index || this_type != last_type)
662 ieee_symbol_type *new_symbol = (ieee_symbol_type *) bfd_alloc (ieee->h.abfd,
663 sizeof (ieee_symbol_type));
667 new_symbol->index = new_index;
668 last_index = new_index;
671 *pptr = &new_symbol->next;
672 if (new_index > *max_index)
674 *max_index = new_index;
676 last_type = this_type;
683 ieee_slurp_external_symbols (abfd)
686 ieee_data_type *ieee = IEEE_DATA (abfd);
687 file_ptr offset = ieee->w.r.external_part;
689 ieee_symbol_type **prev_symbols_ptr = &ieee->external_symbols;
690 ieee_symbol_type **prev_reference_ptr = &ieee->external_reference;
691 ieee_symbol_type *symbol = (ieee_symbol_type *) NULL;
692 unsigned int symbol_count = 0;
694 last_index = 0xffffff;
695 ieee->symbol_table_full = true;
697 ieee_seek (abfd, offset);
701 switch (this_byte (&(ieee->h)))
704 next_byte (&(ieee->h));
706 symbol = get_symbol (abfd, ieee, symbol, &symbol_count,
708 &ieee->external_symbol_max_index, 'D');
712 symbol->symbol.the_bfd = abfd;
713 symbol->symbol.name = read_id (&(ieee->h));
714 symbol->symbol.udata.p = (PTR) NULL;
715 symbol->symbol.flags = BSF_NO_FLAGS;
717 case ieee_external_symbol_enum:
718 next_byte (&(ieee->h));
720 symbol = get_symbol (abfd, ieee, symbol, &symbol_count,
722 &ieee->external_symbol_max_index, 'D');
726 BFD_ASSERT (symbol->index >= ieee->external_symbol_min_index);
728 symbol->symbol.the_bfd = abfd;
729 symbol->symbol.name = read_id (&(ieee->h));
730 symbol->symbol.udata.p = (PTR) NULL;
731 symbol->symbol.flags = BSF_NO_FLAGS;
733 case ieee_attribute_record_enum >> 8:
735 unsigned int symbol_name_index;
736 unsigned int symbol_type_index;
737 unsigned int symbol_attribute_def;
739 next_byte (&(ieee->h)); /* Skip prefix */
740 next_byte (&(ieee->h));
741 symbol_name_index = must_parse_int (&(ieee->h));
742 symbol_type_index = must_parse_int (&(ieee->h));
743 symbol_attribute_def = must_parse_int (&(ieee->h));
744 switch (symbol_attribute_def)
747 /* Module misc; followed by two fields which describe the
748 current module block. The first fired is the type id
749 number, the second is the number of asn records
750 associated with the directive */
751 parse_int (&(ieee->h), &value);
752 parse_int (&(ieee->h), &value);
756 parse_int (&(ieee->h), &value);
761 case ieee_value_record_enum >> 8:
763 unsigned int symbol_name_index;
764 ieee_symbol_index_type symbol_ignore;
765 boolean pcrel_ignore;
767 next_byte (&(ieee->h));
768 next_byte (&(ieee->h));
770 symbol_name_index = must_parse_int (&(ieee->h));
771 parse_expression (ieee,
772 &symbol->symbol.value,
776 &symbol->symbol.section);
778 symbol->symbol.flags = BSF_GLOBAL | BSF_EXPORT;
782 case ieee_weak_external_reference_enum:
786 next_byte (&(ieee->h));
787 /* Throw away the external reference index */
788 (void) must_parse_int (&(ieee->h));
789 /* Fetch the default size if not resolved */
790 size = must_parse_int (&(ieee->h));
791 /* Fetch the defautlt value if available */
792 if (parse_int (&(ieee->h), &value) == false)
796 /* This turns into a common */
797 symbol->symbol.section = bfd_com_section_ptr;
798 symbol->symbol.value = size;
802 case ieee_external_reference_enum:
803 next_byte (&(ieee->h));
805 symbol = get_symbol (abfd, ieee, symbol, &symbol_count,
807 &ieee->external_reference_max_index, 'X');
811 symbol->symbol.the_bfd = abfd;
812 symbol->symbol.name = read_id (&(ieee->h));
813 symbol->symbol.udata.p = (PTR) NULL;
814 symbol->symbol.section = bfd_und_section_ptr;
815 symbol->symbol.value = (bfd_vma) 0;
816 symbol->symbol.flags = 0;
818 BFD_ASSERT (symbol->index >= ieee->external_reference_min_index);
826 if (ieee->external_symbol_max_index != 0)
828 ieee->external_symbol_count =
829 ieee->external_symbol_max_index -
830 ieee->external_symbol_min_index + 1;
834 ieee->external_symbol_count = 0;
837 if (ieee->external_reference_max_index != 0)
839 ieee->external_reference_count =
840 ieee->external_reference_max_index -
841 ieee->external_reference_min_index + 1;
845 ieee->external_reference_count = 0;
849 ieee->external_reference_count + ieee->external_symbol_count;
851 if (symbol_count != abfd->symcount)
853 /* There are gaps in the table -- */
854 ieee->symbol_table_full = false;
857 *prev_symbols_ptr = (ieee_symbol_type *) NULL;
858 *prev_reference_ptr = (ieee_symbol_type *) NULL;
864 ieee_slurp_symbol_table (abfd)
867 if (IEEE_DATA (abfd)->read_symbols == false)
869 if (! ieee_slurp_external_symbols (abfd))
871 IEEE_DATA (abfd)->read_symbols = true;
877 ieee_get_symtab_upper_bound (abfd)
880 if (! ieee_slurp_symbol_table (abfd))
883 return (abfd->symcount != 0) ?
884 (abfd->symcount + 1) * (sizeof (ieee_symbol_type *)) : 0;
888 Move from our internal lists to the canon table, and insert in
892 extern const bfd_target ieee_vec;
895 ieee_get_symtab (abfd, location)
899 ieee_symbol_type *symp;
900 static bfd dummy_bfd;
901 static asymbol empty_symbol =
902 /* the_bfd, name, value, attr, section */
903 {&dummy_bfd, " ieee empty", (symvalue) 0, BSF_DEBUGGING, bfd_abs_section_ptr};
907 ieee_data_type *ieee = IEEE_DATA (abfd);
908 dummy_bfd.xvec = &ieee_vec;
909 if (! ieee_slurp_symbol_table (abfd))
912 if (ieee->symbol_table_full == false)
914 /* Arrgh - there are gaps in the table, run through and fill them */
915 /* up with pointers to a null place */
917 for (i = 0; i < abfd->symcount; i++)
919 location[i] = &empty_symbol;
923 ieee->external_symbol_base_offset = -ieee->external_symbol_min_index;
924 for (symp = IEEE_DATA (abfd)->external_symbols;
925 symp != (ieee_symbol_type *) NULL;
928 /* Place into table at correct index locations */
929 location[symp->index + ieee->external_symbol_base_offset] = &symp->symbol;
932 /* The external refs are indexed in a bit */
933 ieee->external_reference_base_offset =
934 -ieee->external_reference_min_index + ieee->external_symbol_count;
936 for (symp = IEEE_DATA (abfd)->external_reference;
937 symp != (ieee_symbol_type *) NULL;
940 location[symp->index + ieee->external_reference_base_offset] =
947 location[abfd->symcount] = (asymbol *) NULL;
949 return abfd->symcount;
953 get_section_entry (abfd, ieee, index)
955 ieee_data_type *ieee;
958 if (ieee->section_table[index] == (asection *) NULL)
960 char *tmp = bfd_alloc (abfd, 11);
965 sprintf (tmp, " fsec%4d", index);
966 section = bfd_make_section (abfd, tmp);
967 ieee->section_table[index] = section;
968 section->flags = SEC_NO_FLAGS;
969 section->target_index = index;
970 ieee->section_table[index] = section;
972 return ieee->section_table[index];
976 ieee_slurp_sections (abfd)
979 ieee_data_type *ieee = IEEE_DATA (abfd);
980 file_ptr offset = ieee->w.r.section_part;
981 asection *section = (asection *) NULL;
986 bfd_byte section_type[3];
987 ieee_seek (abfd, offset);
990 switch (this_byte (&(ieee->h)))
992 case ieee_section_type_enum:
994 unsigned int section_index;
995 next_byte (&(ieee->h));
996 section_index = must_parse_int (&(ieee->h));
997 /* Fixme to be nice about a silly number of sections */
998 BFD_ASSERT (section_index < NSECTIONS);
1000 section = get_section_entry (abfd, ieee, section_index);
1002 section_type[0] = this_byte_and_next (&(ieee->h));
1003 switch (section_type[0])
1006 /* Normal attributes for absolute sections */
1007 section_type[1] = this_byte (&(ieee->h));
1008 section->flags = SEC_LOAD | SEC_ALLOC | SEC_HAS_CONTENTS;
1009 switch (section_type[1])
1011 case 0xD3: /* AS Absolute section attributes */
1012 next_byte (&(ieee->h));
1013 section_type[2] = this_byte (&(ieee->h));
1014 switch (section_type[2])
1018 next_byte (&(ieee->h));
1019 section->flags |= SEC_LOAD | SEC_CODE;
1022 next_byte (&(ieee->h));
1023 section->flags |= SEC_LOAD | SEC_DATA;
1027 next_byte (&(ieee->h));
1028 /* Normal rom data */
1029 section->flags |= SEC_LOAD | SEC_ROM | SEC_DATA;
1036 case 0xC3: /* Named relocatable sections (type C) */
1037 section_type[1] = this_byte (&(ieee->h));
1038 section->flags = SEC_LOAD | SEC_ALLOC | SEC_HAS_CONTENTS;
1039 switch (section_type[1])
1041 case 0xD0: /* Normal code (CP) */
1042 next_byte (&(ieee->h));
1043 section->flags |= SEC_LOAD | SEC_CODE;
1045 case 0xC4: /* Normal data (CD) */
1046 next_byte (&(ieee->h));
1047 section->flags |= SEC_LOAD | SEC_DATA;
1049 case 0xD2: /* Normal rom data (CR) */
1050 next_byte (&(ieee->h));
1051 section->flags |= SEC_LOAD | SEC_ROM | SEC_DATA;
1058 /* Read section name, use it if non empty. */
1059 name = read_id (&ieee->h);
1061 section->name = name;
1063 /* Skip these fields, which we don't care about */
1065 bfd_vma parent, brother, context;
1066 parse_int (&(ieee->h), &parent);
1067 parse_int (&(ieee->h), &brother);
1068 parse_int (&(ieee->h), &context);
1072 case ieee_section_alignment_enum:
1074 unsigned int section_index;
1077 next_byte (&(ieee->h));
1078 section_index = must_parse_int (&ieee->h);
1079 section = get_section_entry (abfd, ieee, section_index);
1080 if (section_index > ieee->section_count)
1082 ieee->section_count = section_index;
1084 section->alignment_power =
1085 bfd_log2 (must_parse_int (&ieee->h));
1086 (void) parse_int (&(ieee->h), &value);
1089 case ieee_e2_first_byte_enum:
1091 ieee_record_enum_type t = (ieee_record_enum_type) (read_2bytes (&(ieee->h)));
1095 case ieee_section_size_enum:
1096 section = ieee->section_table[must_parse_int (&(ieee->h))];
1097 section->_raw_size = must_parse_int (&(ieee->h));
1099 case ieee_physical_region_size_enum:
1100 section = ieee->section_table[must_parse_int (&(ieee->h))];
1101 section->_raw_size = must_parse_int (&(ieee->h));
1103 case ieee_region_base_address_enum:
1104 section = ieee->section_table[must_parse_int (&(ieee->h))];
1105 section->vma = must_parse_int (&(ieee->h));
1106 section->lma = section->vma;
1108 case ieee_mau_size_enum:
1109 must_parse_int (&(ieee->h));
1110 must_parse_int (&(ieee->h));
1112 case ieee_m_value_enum:
1113 must_parse_int (&(ieee->h));
1114 must_parse_int (&(ieee->h));
1116 case ieee_section_base_address_enum:
1117 section = ieee->section_table[must_parse_int (&(ieee->h))];
1118 section->vma = must_parse_int (&(ieee->h));
1119 section->lma = section->vma;
1121 case ieee_section_offset_enum:
1122 (void) must_parse_int (&(ieee->h));
1123 (void) must_parse_int (&(ieee->h));
1137 /* Make a section for the debugging information, if any. We don't try
1138 to interpret the debugging information; we just point the section
1139 at the area in the file so that program which understand can dig it
1143 ieee_slurp_debug (abfd)
1146 ieee_data_type *ieee = IEEE_DATA (abfd);
1149 if (ieee->w.r.debug_information_part == 0)
1152 sec = bfd_make_section (abfd, ".debug");
1155 sec->flags |= SEC_DEBUGGING | SEC_HAS_CONTENTS;
1156 sec->filepos = ieee->w.r.debug_information_part;
1157 sec->_raw_size = ieee->w.r.data_part - ieee->w.r.debug_information_part;
1162 /***********************************************************************
1167 ieee_archive_p (abfd)
1173 unsigned char buffer[512];
1174 file_ptr buffer_offset = 0;
1175 ieee_ar_data_type *save = abfd->tdata.ieee_ar_data;
1176 ieee_ar_data_type *ieee;
1177 abfd->tdata.ieee_ar_data = (ieee_ar_data_type *) bfd_alloc (abfd, sizeof (ieee_ar_data_type));
1178 if (!abfd->tdata.ieee_ar_data)
1180 ieee = IEEE_AR_DATA (abfd);
1182 /* FIXME: Check return value. I'm not sure whether it needs to read
1183 the entire buffer or not. */
1184 bfd_read ((PTR) buffer, 1, sizeof (buffer), abfd);
1186 ieee->h.first_byte = buffer;
1187 ieee->h.input_p = buffer;
1189 ieee->h.abfd = abfd;
1191 if (this_byte (&(ieee->h)) != Module_Beginning)
1193 abfd->tdata.ieee_ar_data = save;
1194 return (const bfd_target *) NULL;
1197 next_byte (&(ieee->h));
1198 library = read_id (&(ieee->h));
1199 if (strcmp (library, "LIBRARY") != 0)
1201 bfd_release (abfd, ieee);
1202 abfd->tdata.ieee_ar_data = save;
1203 return (const bfd_target *) NULL;
1205 /* Throw away the filename */
1206 read_id (&(ieee->h));
1208 ieee->element_count = 0;
1209 ieee->element_index = 0;
1211 next_byte (&(ieee->h)); /* Drop the ad part */
1212 must_parse_int (&(ieee->h)); /* And the two dummy numbers */
1213 must_parse_int (&(ieee->h));
1216 /* Read the index of the BB table */
1219 ieee_ar_obstack_type t;
1220 int rec = read_2bytes (&(ieee->h));
1221 if (rec == (int) ieee_assign_value_to_variable_enum)
1223 must_parse_int (&(ieee->h));
1224 t.file_offset = must_parse_int (&(ieee->h));
1225 t.abfd = (bfd *) NULL;
1226 ieee->element_count++;
1228 bfd_alloc_grow (abfd, (PTR) &t, sizeof t);
1230 /* Make sure that we don't go over the end of the buffer */
1232 if ((size_t) ieee_pos (abfd) > sizeof (buffer) / 2)
1234 /* Past half way, reseek and reprime */
1235 buffer_offset += ieee_pos (abfd);
1236 if (bfd_seek (abfd, buffer_offset, SEEK_SET) != 0)
1238 /* FIXME: Check return value. I'm not sure whether it
1239 needs to read the entire buffer or not. */
1240 bfd_read ((PTR) buffer, 1, sizeof (buffer), abfd);
1241 ieee->h.first_byte = buffer;
1242 ieee->h.input_p = buffer;
1249 ieee->elements = (ieee_ar_obstack_type *) bfd_alloc_finish (abfd);
1250 if (!ieee->elements)
1251 return (const bfd_target *) NULL;
1253 /* Now scan the area again, and replace BB offsets with file */
1256 for (i = 2; i < ieee->element_count; i++)
1258 if (bfd_seek (abfd, ieee->elements[i].file_offset, SEEK_SET) != 0)
1260 /* FIXME: Check return value. I'm not sure whether it needs to
1261 read the entire buffer or not. */
1262 bfd_read ((PTR) buffer, 1, sizeof (buffer), abfd);
1263 ieee->h.first_byte = buffer;
1264 ieee->h.input_p = buffer;
1266 next_byte (&(ieee->h)); /* Drop F8 */
1267 next_byte (&(ieee->h)); /* Drop 14 */
1268 must_parse_int (&(ieee->h)); /* Drop size of block */
1269 if (must_parse_int (&(ieee->h)) != 0)
1271 /* This object has been deleted */
1272 ieee->elements[i].file_offset = 0;
1276 ieee->elements[i].file_offset = must_parse_int (&(ieee->h));
1280 /* abfd->has_armap = ;*/
1285 ieee_mkobject (abfd)
1288 abfd->tdata.ieee_data = (ieee_data_type *) bfd_zalloc (abfd, sizeof (ieee_data_type));
1289 return abfd->tdata.ieee_data ? true : false;
1293 ieee_object_p (abfd)
1298 ieee_data_type *ieee;
1299 unsigned char buffer[300];
1300 ieee_data_type *save = IEEE_DATA (abfd);
1302 abfd->tdata.ieee_data = 0;
1303 ieee_mkobject (abfd);
1305 ieee = IEEE_DATA (abfd);
1306 if (bfd_seek (abfd, (file_ptr) 0, SEEK_SET) != 0)
1308 /* Read the first few bytes in to see if it makes sense */
1309 /* FIXME: Check return value. I'm not sure whether it needs to read
1310 the entire buffer or not. */
1311 bfd_read ((PTR) buffer, 1, sizeof (buffer), abfd);
1313 ieee->h.input_p = buffer;
1314 if (this_byte_and_next (&(ieee->h)) != Module_Beginning)
1315 goto got_wrong_format;
1317 ieee->read_symbols = false;
1318 ieee->read_data = false;
1319 ieee->section_count = 0;
1320 ieee->external_symbol_max_index = 0;
1321 ieee->external_symbol_min_index = IEEE_PUBLIC_BASE;
1322 ieee->external_reference_min_index = IEEE_REFERENCE_BASE;
1323 ieee->external_reference_max_index = 0;
1324 ieee->h.abfd = abfd;
1325 memset ((PTR) ieee->section_table, 0, sizeof (ieee->section_table));
1327 processor = ieee->mb.processor = read_id (&(ieee->h));
1328 if (strcmp (processor, "LIBRARY") == 0)
1329 goto got_wrong_format;
1330 ieee->mb.module_name = read_id (&(ieee->h));
1331 if (abfd->filename == (CONST char *) NULL)
1333 abfd->filename = ieee->mb.module_name;
1335 /* Determine the architecture and machine type of the object file.
1338 const bfd_arch_info_type *arch = bfd_scan_arch (processor);
1340 goto got_wrong_format;
1341 abfd->arch_info = arch;
1344 if (this_byte (&(ieee->h)) != (int) ieee_address_descriptor_enum)
1348 next_byte (&(ieee->h));
1350 if (parse_int (&(ieee->h), &ieee->ad.number_of_bits_mau) == false)
1354 if (parse_int (&(ieee->h), &ieee->ad.number_of_maus_in_address) == false)
1359 /* If there is a byte order info, take it */
1360 if (this_byte (&(ieee->h)) == (int) ieee_variable_L_enum ||
1361 this_byte (&(ieee->h)) == (int) ieee_variable_M_enum)
1362 next_byte (&(ieee->h));
1364 for (part = 0; part < N_W_VARIABLES; part++)
1367 if (read_2bytes (&(ieee->h)) != (int) ieee_assign_value_to_variable_enum)
1371 if (this_byte_and_next (&(ieee->h)) != part)
1376 ieee->w.offset[part] = parse_i (&(ieee->h), &ok);
1383 abfd->flags = HAS_SYMS;
1384 /* By now we know that this is a real IEEE file, we're going to read
1385 the whole thing into memory so that we can run up and down it
1386 quickly. We can work out how big the file is from the trailer
1389 IEEE_DATA (abfd)->h.first_byte = (unsigned char *) bfd_alloc (ieee->h.abfd, ieee->w.r.me_record
1391 if (!IEEE_DATA (abfd)->h.first_byte)
1393 if (bfd_seek (abfd, (file_ptr) 0, SEEK_SET) != 0)
1395 /* FIXME: Check return value. I'm not sure whether it needs to read
1396 the entire buffer or not. */
1397 bfd_read ((PTR) (IEEE_DATA (abfd)->h.first_byte), 1, ieee->w.r.me_record + 50, abfd);
1399 ieee_slurp_sections (abfd);
1401 if (! ieee_slurp_debug (abfd))
1406 bfd_set_error (bfd_error_wrong_format);
1408 (void) bfd_release (abfd, ieee);
1409 abfd->tdata.ieee_data = save;
1410 return (const bfd_target *) NULL;
1414 ieee_get_symbol_info (ignore_abfd, symbol, ret)
1419 bfd_symbol_info (symbol, ret);
1420 if (symbol->name[0] == ' ')
1421 ret->name = "* empty table entry ";
1422 if (!symbol->section)
1423 ret->type = (symbol->flags & BSF_LOCAL) ? 'a' : 'A';
1427 ieee_print_symbol (ignore_abfd, afile, symbol, how)
1431 bfd_print_symbol_type how;
1433 FILE *file = (FILE *) afile;
1437 case bfd_print_symbol_name:
1438 fprintf (file, "%s", symbol->name);
1440 case bfd_print_symbol_more:
1442 fprintf (file, "%4x %2x", aout_symbol (symbol)->desc & 0xffff,
1443 aout_symbol (symbol)->other & 0xff);
1447 case bfd_print_symbol_all:
1449 const char *section_name =
1450 (symbol->section == (asection *) NULL
1452 : symbol->section->name);
1453 if (symbol->name[0] == ' ')
1455 fprintf (file, "* empty table entry ");
1459 bfd_print_symbol_vandf ((PTR) file, symbol);
1461 fprintf (file, " %-5s %04x %02x %s",
1463 (unsigned) ieee_symbol (symbol)->index,
1473 do_one (ieee, current_map, location_ptr, s)
1474 ieee_data_type *ieee;
1475 ieee_per_section_type *current_map;
1476 unsigned char *location_ptr;
1479 switch (this_byte (&(ieee->h)))
1481 case ieee_load_constant_bytes_enum:
1483 unsigned int number_of_maus;
1485 next_byte (&(ieee->h));
1486 number_of_maus = must_parse_int (&(ieee->h));
1488 for (i = 0; i < number_of_maus; i++)
1490 location_ptr[current_map->pc++] = this_byte (&(ieee->h));
1491 next_byte (&(ieee->h));
1496 case ieee_load_with_relocation_enum:
1498 boolean loop = true;
1499 next_byte (&(ieee->h));
1502 switch (this_byte (&(ieee->h)))
1504 case ieee_variable_R_enum:
1506 case ieee_function_signed_open_b_enum:
1507 case ieee_function_unsigned_open_b_enum:
1508 case ieee_function_either_open_b_enum:
1510 unsigned int extra = 4;
1511 boolean pcrel = false;
1513 ieee_reloc_type *r =
1514 (ieee_reloc_type *) bfd_alloc (ieee->h.abfd,
1515 sizeof (ieee_reloc_type));
1519 *(current_map->reloc_tail_ptr) = r;
1520 current_map->reloc_tail_ptr = &r->next;
1521 r->next = (ieee_reloc_type *) NULL;
1522 next_byte (&(ieee->h));
1524 r->relent.sym_ptr_ptr = 0;
1525 parse_expression (ieee,
1528 &pcrel, &extra, §ion);
1529 r->relent.address = current_map->pc;
1531 if (r->relent.sym_ptr_ptr == 0)
1533 r->relent.sym_ptr_ptr = section->symbol_ptr_ptr;
1536 if (this_byte (&(ieee->h)) == (int) ieee_comma)
1538 next_byte (&(ieee->h));
1539 /* Fetch number of bytes to pad */
1540 extra = must_parse_int (&(ieee->h));
1543 switch (this_byte (&(ieee->h)))
1545 case ieee_function_signed_close_b_enum:
1546 next_byte (&(ieee->h));
1548 case ieee_function_unsigned_close_b_enum:
1549 next_byte (&(ieee->h));
1551 case ieee_function_either_close_b_enum:
1552 next_byte (&(ieee->h));
1557 /* Build a relocation entry for this type */
1558 /* If pc rel then stick -ve pc into instruction
1559 and take out of reloc ..
1561 I've changed this. It's all too complicated. I
1562 keep 0 in the instruction now. */
1571 #if KEEPMINUSPCININST
1572 bfd_put_32 (ieee->h.abfd, -current_map->pc, location_ptr +
1574 r->relent.howto = &rel32_howto;
1578 bfd_put_32 (ieee->h.abfd, 0, location_ptr +
1580 r->relent.howto = &rel32_howto;
1585 bfd_put_32 (ieee->h.abfd, 0, location_ptr +
1587 r->relent.howto = &abs32_howto;
1589 current_map->pc += 4;
1594 #if KEEPMINUSPCININST
1595 bfd_put_16 (ieee->h.abfd, (int) (-current_map->pc), location_ptr + current_map->pc);
1596 r->relent.addend -= current_map->pc;
1597 r->relent.howto = &rel16_howto;
1600 bfd_put_16 (ieee->h.abfd, 0, location_ptr + current_map->pc);
1601 r->relent.howto = &rel16_howto;
1607 bfd_put_16 (ieee->h.abfd, 0, location_ptr + current_map->pc);
1608 r->relent.howto = &abs16_howto;
1610 current_map->pc += 2;
1615 #if KEEPMINUSPCININST
1616 bfd_put_8 (ieee->h.abfd, (int) (-current_map->pc), location_ptr + current_map->pc);
1617 r->relent.addend -= current_map->pc;
1618 r->relent.howto = &rel8_howto;
1620 bfd_put_8 (ieee->h.abfd, 0, location_ptr + current_map->pc);
1621 r->relent.howto = &rel8_howto;
1626 bfd_put_8 (ieee->h.abfd, 0, location_ptr + current_map->pc);
1627 r->relent.howto = &abs8_howto;
1629 current_map->pc += 1;
1641 if (parse_int (&(ieee->h), &this_size) == true)
1644 for (i = 0; i < this_size; i++)
1646 location_ptr[current_map->pc++] = this_byte (&(ieee->h));
1647 next_byte (&(ieee->h));
1662 /* Read in all the section data and relocation stuff too */
1664 ieee_slurp_section_data (abfd)
1667 bfd_byte *location_ptr = (bfd_byte *) NULL;
1668 ieee_data_type *ieee = IEEE_DATA (abfd);
1669 unsigned int section_number;
1671 ieee_per_section_type *current_map = (ieee_per_section_type *) NULL;
1673 /* Seek to the start of the data area */
1674 if (ieee->read_data == true)
1676 ieee->read_data = true;
1677 ieee_seek (abfd, ieee->w.r.data_part);
1679 /* Allocate enough space for all the section contents */
1681 for (s = abfd->sections; s != (asection *) NULL; s = s->next)
1683 ieee_per_section_type *per = (ieee_per_section_type *) s->used_by_bfd;
1684 if ((s->flags & SEC_DEBUGGING) != 0)
1686 per->data = (bfd_byte *) bfd_alloc (ieee->h.abfd, s->_raw_size);
1690 per->reloc_tail_ptr =
1691 (ieee_reloc_type **) & (s->relocation);
1696 switch (this_byte (&(ieee->h)))
1698 /* IF we see anything strange then quit */
1702 case ieee_set_current_section_enum:
1703 next_byte (&(ieee->h));
1704 section_number = must_parse_int (&(ieee->h));
1705 s = ieee->section_table[section_number];
1706 current_map = (ieee_per_section_type *) s->used_by_bfd;
1707 location_ptr = current_map->data - s->vma;
1708 /* The document I have says that Microtec's compilers reset */
1709 /* this after a sec section, even though the standard says not */
1711 current_map->pc = s->vma;
1714 case ieee_e2_first_byte_enum:
1715 next_byte (&(ieee->h));
1716 switch (this_byte (&(ieee->h)))
1718 case ieee_set_current_pc_enum & 0xff:
1721 ieee_symbol_index_type symbol;
1724 next_byte (&(ieee->h));
1725 must_parse_int (&(ieee->h)); /* Thow away section #*/
1726 parse_expression (ieee, &value,
1730 current_map->pc = value;
1731 BFD_ASSERT ((unsigned) (value - s->vma) <= s->_raw_size);
1735 case ieee_value_starting_address_enum & 0xff:
1736 /* We've got to the end of the data now - */
1743 case ieee_repeat_data_enum:
1745 /* Repeat the following LD or LR n times - we do this by
1746 remembering the stream pointer before running it and
1747 resetting it and running it n times. We special case
1748 the repetition of a repeat_data/load_constant
1751 unsigned int iterations;
1752 unsigned char *start;
1753 next_byte (&(ieee->h));
1754 iterations = must_parse_int (&(ieee->h));
1755 start = ieee->h.input_p;
1756 if (start[0] == (int) ieee_load_constant_bytes_enum &&
1759 while (iterations != 0)
1761 location_ptr[current_map->pc++] = start[2];
1764 next_byte (&(ieee->h));
1765 next_byte (&(ieee->h));
1766 next_byte (&(ieee->h));
1770 while (iterations != 0)
1772 ieee->h.input_p = start;
1773 if (!do_one (ieee, current_map, location_ptr, s))
1780 case ieee_load_constant_bytes_enum:
1781 case ieee_load_with_relocation_enum:
1783 if (!do_one (ieee, current_map, location_ptr, s))
1791 ieee_new_section_hook (abfd, newsect)
1795 newsect->used_by_bfd = (PTR)
1796 bfd_alloc (abfd, sizeof (ieee_per_section_type));
1797 if (!newsect->used_by_bfd)
1799 ieee_per_section (newsect)->data = (bfd_byte *) NULL;
1800 ieee_per_section (newsect)->section = newsect;
1805 ieee_get_reloc_upper_bound (abfd, asect)
1809 if ((asect->flags & SEC_DEBUGGING) != 0)
1811 if (! ieee_slurp_section_data (abfd))
1813 return (asect->reloc_count + 1) * sizeof (arelent *);
1817 ieee_get_section_contents (abfd, section, location, offset, count)
1822 bfd_size_type count;
1824 ieee_per_section_type *p = (ieee_per_section_type *) section->used_by_bfd;
1825 if ((section->flags & SEC_DEBUGGING) != 0)
1826 return _bfd_generic_get_section_contents (abfd, section, location,
1828 ieee_slurp_section_data (abfd);
1829 (void) memcpy ((PTR) location, (PTR) (p->data + offset), (unsigned) count);
1834 ieee_canonicalize_reloc (abfd, section, relptr, symbols)
1840 /* ieee_per_section_type *p = (ieee_per_section_type *) section->used_by_bfd;*/
1841 ieee_reloc_type *src = (ieee_reloc_type *) (section->relocation);
1842 ieee_data_type *ieee = IEEE_DATA (abfd);
1844 if ((section->flags & SEC_DEBUGGING) != 0)
1847 while (src != (ieee_reloc_type *) NULL)
1849 /* Work out which symbol to attach it this reloc to */
1850 switch (src->symbol.letter)
1853 src->relent.sym_ptr_ptr =
1854 symbols + src->symbol.index + ieee->external_reference_base_offset;
1857 src->relent.sym_ptr_ptr =
1858 src->relent.sym_ptr_ptr[0]->section->symbol_ptr_ptr;
1864 *relptr++ = &src->relent;
1867 *relptr = (arelent *) NULL;
1868 return section->reloc_count;
1876 arelent *a = *((arelent **) ap);
1877 arelent *b = *((arelent **) bp);
1878 return a->address - b->address;
1881 /* Write the section headers. */
1884 ieee_write_section_part (abfd)
1887 ieee_data_type *ieee = IEEE_DATA (abfd);
1889 ieee->w.r.section_part = bfd_tell (abfd);
1890 for (s = abfd->sections; s != (asection *) NULL; s = s->next)
1892 if (! bfd_is_abs_section (s)
1893 && (s->flags & SEC_DEBUGGING) == 0)
1895 if (! ieee_write_byte (abfd, ieee_section_type_enum)
1896 || ! ieee_write_byte (abfd,
1897 (bfd_byte) (s->index
1898 + IEEE_SECTION_NUMBER_BASE)))
1901 if (abfd->flags & EXEC_P)
1903 /* This image is executable, so output absolute sections */
1904 if (! ieee_write_byte (abfd, ieee_variable_A_enum)
1905 || ! ieee_write_byte (abfd, ieee_variable_S_enum))
1910 if (! ieee_write_byte (abfd, ieee_variable_C_enum))
1914 switch (s->flags & (SEC_CODE | SEC_DATA | SEC_ROM))
1916 case SEC_CODE | SEC_LOAD:
1918 if (! ieee_write_byte (abfd, ieee_variable_P_enum))
1923 if (! ieee_write_byte (abfd, ieee_variable_D_enum))
1927 case SEC_ROM | SEC_DATA:
1928 case SEC_ROM | SEC_LOAD:
1929 case SEC_ROM | SEC_DATA | SEC_LOAD:
1930 if (! ieee_write_byte (abfd, ieee_variable_R_enum))
1935 if (! ieee_write_id (abfd, s->name))
1938 ieee_write_int (abfd, 0); /* Parent */
1939 ieee_write_int (abfd, 0); /* Brother */
1940 ieee_write_int (abfd, 0); /* Context */
1943 if (! ieee_write_byte (abfd, ieee_section_alignment_enum)
1944 || ! ieee_write_byte (abfd,
1945 (bfd_byte) (s->index
1946 + IEEE_SECTION_NUMBER_BASE))
1947 || ! ieee_write_int (abfd, 1 << s->alignment_power))
1951 if (! ieee_write_2bytes (abfd, ieee_section_size_enum)
1952 || ! ieee_write_byte (abfd,
1953 (bfd_byte) (s->index
1954 + IEEE_SECTION_NUMBER_BASE))
1955 || ! ieee_write_int (abfd, s->_raw_size))
1957 if (abfd->flags & EXEC_P)
1959 /* Relocateable sections don't have asl records */
1961 if (! ieee_write_2bytes (abfd, ieee_section_base_address_enum)
1962 || ! ieee_write_byte (abfd,
1965 + IEEE_SECTION_NUMBER_BASE)))
1966 || ! ieee_write_int (abfd, s->vma))
1977 do_with_relocs (abfd, s)
1981 unsigned int relocs_to_go = s->reloc_count;
1982 bfd_byte *stream = ieee_per_section (s)->data;
1983 arelent **p = s->orelocation;
1984 bfd_size_type current_byte_index = 0;
1986 qsort (s->orelocation,
1988 sizeof (arelent **),
1991 /* Output the section preheader */
1992 if (! ieee_write_byte (abfd, ieee_set_current_section_enum)
1993 || ! ieee_write_byte (abfd,
1994 (bfd_byte) (s->index + IEEE_SECTION_NUMBER_BASE))
1995 || ! ieee_write_2bytes (abfd, ieee_set_current_pc_enum)
1996 || ! ieee_write_byte (abfd,
1997 (bfd_byte) (s->index + IEEE_SECTION_NUMBER_BASE))
1998 || ! ieee_write_expression (abfd, 0, s->symbol, 0, 0))
2001 if (relocs_to_go == 0)
2003 /* If there aren't any relocations then output the load constant
2004 byte opcode rather than the load with relocation opcode */
2006 while (current_byte_index < s->_raw_size)
2009 unsigned int MAXRUN = 32;
2011 if (run > s->_raw_size - current_byte_index)
2013 run = s->_raw_size - current_byte_index;
2018 if (! ieee_write_byte (abfd, ieee_load_constant_bytes_enum))
2020 /* Output a stream of bytes */
2021 if (! ieee_write_int (abfd, run))
2023 if (bfd_write ((PTR) (stream + current_byte_index),
2029 current_byte_index += run;
2035 if (! ieee_write_byte (abfd, ieee_load_with_relocation_enum))
2038 /* Output the data stream as the longest sequence of bytes
2039 possible, allowing for the a reasonable packet size and
2040 relocation stuffs. */
2042 if ((PTR) stream == (PTR) NULL)
2044 /* Outputting a section without data, fill it up */
2045 stream = (unsigned char *) (bfd_alloc (abfd, s->_raw_size));
2048 memset ((PTR) stream, 0, (size_t) s->_raw_size);
2050 while (current_byte_index < s->_raw_size)
2053 unsigned int MAXRUN = 32;
2056 run = (*p)->address - current_byte_index;
2062 if (run > s->_raw_size - current_byte_index)
2064 run = s->_raw_size - current_byte_index;
2069 /* Output a stream of bytes */
2070 if (! ieee_write_int (abfd, run))
2072 if (bfd_write ((PTR) (stream + current_byte_index),
2078 current_byte_index += run;
2080 /* Output any relocations here */
2081 if (relocs_to_go && (*p) && (*p)->address == current_byte_index)
2084 && (*p) && (*p)->address == current_byte_index)
2090 if (r->howto->pc_relative)
2092 r->addend += current_byte_index;
2096 switch (r->howto->size)
2100 ov = bfd_get_32 (abfd,
2101 stream + current_byte_index);
2102 current_byte_index += 4;
2105 ov = bfd_get_16 (abfd,
2106 stream + current_byte_index);
2107 current_byte_index += 2;
2110 ov = bfd_get_8 (abfd,
2111 stream + current_byte_index);
2112 current_byte_index++;
2118 if (! ieee_write_byte (abfd,
2119 ieee_function_either_open_b_enum))
2124 if (r->sym_ptr_ptr != (asymbol **) NULL)
2126 if (! ieee_write_expression (abfd, r->addend + ov,
2128 r->howto->pc_relative,
2134 if (! ieee_write_expression (abfd, r->addend + ov,
2136 r->howto->pc_relative,
2141 if (1 || r->howto->size != 2)
2143 if (! ieee_write_byte (abfd, ieee_comma)
2144 || ! ieee_write_int (abfd, 1 << r->howto->size))
2147 if (! ieee_write_byte (abfd,
2148 ieee_function_either_close_b_enum))
2162 /* If there are no relocations in the output section then we can be
2163 clever about how we write. We block items up into a max of 127
2167 do_as_repeat (abfd, s)
2173 if (! ieee_write_byte (abfd, ieee_set_current_section_enum)
2174 || ! ieee_write_byte (abfd,
2175 (bfd_byte) (s->index
2176 + IEEE_SECTION_NUMBER_BASE))
2177 || ! ieee_write_byte (abfd, ieee_set_current_pc_enum >> 8)
2178 || ! ieee_write_byte (abfd, ieee_set_current_pc_enum & 0xff)
2179 || ! ieee_write_byte (abfd,
2180 (bfd_byte) (s->index
2181 + IEEE_SECTION_NUMBER_BASE))
2182 || ! ieee_write_int (abfd, s->vma)
2183 || ! ieee_write_byte (abfd, ieee_repeat_data_enum)
2184 || ! ieee_write_int (abfd, s->_raw_size)
2185 || ! ieee_write_byte (abfd, ieee_load_constant_bytes_enum)
2186 || ! ieee_write_byte (abfd, 1)
2187 || ! ieee_write_byte (abfd, 0))
2195 do_without_relocs (abfd, s)
2199 bfd_byte *stream = ieee_per_section (s)->data;
2201 if (stream == 0 || ((s->flags & SEC_LOAD) == 0))
2203 if (! do_as_repeat (abfd, s))
2209 for (i = 0; i < s->_raw_size; i++)
2213 if (! do_with_relocs (abfd, s))
2218 if (! do_as_repeat (abfd, s))
2226 static unsigned char *output_ptr_start;
2227 static unsigned char *output_ptr;
2228 static unsigned char *output_ptr_end;
2229 static unsigned char *input_ptr_start;
2230 static unsigned char *input_ptr;
2231 static unsigned char *input_ptr_end;
2232 static bfd *input_bfd;
2233 static bfd *output_bfd;
2234 static int output_buffer;
2239 /* FIXME: Check return value. I'm not sure whether it needs to read
2240 the entire buffer or not. */
2241 bfd_read ((PTR) input_ptr_start, 1, input_ptr_end - input_ptr_start, input_bfd);
2242 input_ptr = input_ptr_start;
2247 if (bfd_write ((PTR) (output_ptr_start), 1, output_ptr - output_ptr_start,
2249 != (bfd_size_type) (output_ptr - output_ptr_start))
2251 output_ptr = output_ptr_start;
2255 #define THIS() ( *input_ptr )
2256 #define NEXT() { input_ptr++; if (input_ptr == input_ptr_end) fill(); }
2257 #define OUT(x) { *output_ptr++ = (x); if(output_ptr == output_ptr_end) flush(); }
2263 if (value >= 0 && value <= 127)
2269 unsigned int length;
2270 /* How many significant bytes ? */
2271 /* FIXME FOR LONGER INTS */
2272 if (value & 0xff000000)
2276 else if (value & 0x00ff0000)
2280 else if (value & 0x0000ff00)
2287 OUT ((int) ieee_number_repeat_start_enum + length);
2306 int length = THIS ();
2318 #define VAR(x) ((x | 0x80))
2333 value = (value << 8) | THIS ();
2335 value = (value << 8) | THIS ();
2337 value = (value << 8) | THIS ();
2345 value = (value << 8) | THIS ();
2347 value = (value << 8) | THIS ();
2355 value = (value << 8) | THIS ();
2372 /* Not a number, just bug out with the answer */
2373 write_int (*(--tos));
2383 int value = *(--tos);
2392 ieee_data_type *ieee;
2395 section_number = THIS ();
2398 ieee = IEEE_DATA (input_bfd);
2399 s = ieee->section_table[section_number];
2400 if (s->output_section)
2402 value = s->output_section->vma;
2408 value += s->output_offset;
2416 write_int (*(--tos));
2426 /* Drop the int in the buffer, and copy a null into the gap, which we
2427 will overwrite later */
2429 struct output_buffer_struct
2431 unsigned char *ptrp;
2437 struct output_buffer_struct *buf;
2439 if (buf->buffer == output_buffer)
2441 /* Still a chance to output the size */
2442 int value = output_ptr - buf->ptrp + 3;
2443 buf->ptrp[0] = value >> 24;
2444 buf->ptrp[1] = value >> 16;
2445 buf->ptrp[2] = value >> 8;
2446 buf->ptrp[3] = value >> 0;
2452 struct output_buffer_struct *buf;
2478 buf->ptrp = output_ptr;
2479 buf->buffer = output_buffer;
2519 #define ID copy_id()
2520 #define INT copy_int()
2521 #define EXP copy_expression()
2522 static void copy_till_end ();
2523 #define INTn(q) copy_int()
2524 #define EXPn(q) copy_expression()
2563 EXPn (instruction address);
2597 EXPn (external function);
2607 INTn (locked register);
2630 /* Attribute record */
2688 static void block ();
2700 /* Unique typedefs for module */
2701 /* GLobal typedefs */
2702 /* High level module scope beginning */
2704 struct output_buffer_struct ob;
2719 /* Global function */
2721 struct output_buffer_struct ob;
2735 EXPn (size of block);
2741 /* File name for source line numbers */
2743 struct output_buffer_struct ob;
2763 /* Local function */
2765 struct output_buffer_struct ob;
2783 /* Assembler module scope beginning -*/
2785 struct output_buffer_struct ob;
2811 struct output_buffer_struct ob;
2818 INTn (section index);
2826 EXPn (Size in Maus);
2881 moves all the debug information from the source bfd to the output
2882 bfd, and relocates any expressions it finds
2886 relocate_debug (output, input)
2892 unsigned char input_buffer[IBS];
2894 input_ptr_start = input_ptr = input_buffer;
2895 input_ptr_end = input_buffer + IBS;
2897 /* FIXME: Check return value. I'm not sure whether it needs to read
2898 the entire buffer or not. */
2899 bfd_read ((PTR) input_ptr_start, 1, IBS, input);
2904 During linking, we we told about the bfds which made up our
2905 contents, we have a list of them. They will still be open, so go to
2906 the debug info in each, and copy it out, relocating it as we go.
2910 ieee_write_debug_part (abfd)
2913 ieee_data_type *ieee = IEEE_DATA (abfd);
2914 bfd_chain_type *chain = ieee->chain_root;
2915 unsigned char output_buffer[OBS];
2916 boolean some_debug = false;
2917 file_ptr here = bfd_tell (abfd);
2919 output_ptr_start = output_ptr = output_buffer;
2920 output_ptr_end = output_buffer + OBS;
2921 output_ptr = output_buffer;
2924 if (chain == (bfd_chain_type *) NULL)
2928 for (s = abfd->sections; s != NULL; s = s->next)
2929 if ((s->flags & SEC_DEBUGGING) != 0)
2933 ieee->w.r.debug_information_part = 0;
2937 ieee->w.r.debug_information_part = here;
2938 if (bfd_write (s->contents, 1, s->_raw_size, abfd) != s->_raw_size)
2943 while (chain != (bfd_chain_type *) NULL)
2945 bfd *entry = chain->this;
2946 ieee_data_type *entry_ieee = IEEE_DATA (entry);
2947 if (entry_ieee->w.r.debug_information_part)
2949 if (bfd_seek (entry, entry_ieee->w.r.debug_information_part,
2953 relocate_debug (abfd, entry);
2956 chain = chain->next;
2960 ieee->w.r.debug_information_part = here;
2964 ieee->w.r.debug_information_part = 0;
2973 /* Write the data in an ieee way. */
2976 ieee_write_data_part (abfd)
2980 ieee_data_type *ieee = IEEE_DATA (abfd);
2981 ieee->w.r.data_part = bfd_tell (abfd);
2982 for (s = abfd->sections; s != (asection *) NULL; s = s->next)
2984 if ((s->flags & SEC_DEBUGGING) != 0)
2986 /* Sort the reloc records so we can insert them in the correct
2988 if (s->reloc_count != 0)
2990 if (! do_with_relocs (abfd, s))
2995 if (! do_without_relocs (abfd, s))
3005 init_for_output (abfd)
3009 for (s = abfd->sections; s != (asection *) NULL; s = s->next)
3011 if ((s->flags & SEC_DEBUGGING) != 0)
3013 if (s->_raw_size != 0)
3015 ieee_per_section (s)->data = (bfd_byte *) (bfd_alloc (abfd, s->_raw_size));
3016 if (!ieee_per_section (s)->data)
3023 /** exec and core file sections */
3025 /* set section contents is complicated with IEEE since the format is
3026 * not a byte image, but a record stream.
3029 ieee_set_section_contents (abfd, section, location, offset, count)
3034 bfd_size_type count;
3036 if ((section->flags & SEC_DEBUGGING) != 0)
3038 if (section->contents == NULL)
3040 section->contents = bfd_alloc (abfd, section->_raw_size);
3041 if (section->contents == NULL)
3044 /* bfd_set_section_contents has already checked that everything
3046 memcpy (section->contents + offset, location, count);
3050 if (ieee_per_section (section)->data == (bfd_byte *) NULL)
3052 if (!init_for_output (abfd))
3055 memcpy ((PTR) (ieee_per_section (section)->data + offset),
3057 (unsigned int) count);
3061 /* Write the external symbols of a file. IEEE considers two sorts of
3062 external symbols, public, and referenced. It uses to internal
3063 forms to index them as well. When we write them out we turn their
3064 symbol values into indexes from the right base. */
3067 ieee_write_external_part (abfd)
3071 ieee_data_type *ieee = IEEE_DATA (abfd);
3073 unsigned int reference_index = IEEE_REFERENCE_BASE;
3074 unsigned int public_index = IEEE_PUBLIC_BASE + 2;
3075 file_ptr here = bfd_tell (abfd);
3076 boolean hadone = false;
3077 if (abfd->outsymbols != (asymbol **) NULL)
3080 for (q = abfd->outsymbols; *q != (asymbol *) NULL; q++)
3084 if (bfd_is_und_section (p->section))
3086 /* This must be a symbol reference .. */
3087 if (! ieee_write_byte (abfd, ieee_external_reference_enum)
3088 || ! ieee_write_int (abfd, reference_index)
3089 || ! ieee_write_id (abfd, p->name))
3091 p->value = reference_index;
3094 else if (bfd_is_com_section (p->section))
3096 /* This is a weak reference */
3097 if (! ieee_write_byte (abfd, ieee_external_reference_enum)
3098 || ! ieee_write_int (abfd, reference_index)
3099 || ! ieee_write_id (abfd, p->name)
3100 || ! ieee_write_byte (abfd,
3101 ieee_weak_external_reference_enum)
3102 || ! ieee_write_int (abfd, reference_index)
3103 || ! ieee_write_int (abfd, p->value)
3104 || ! ieee_write_int (abfd, BFD_FORT_COMM_DEFAULT_VALUE))
3106 p->value = reference_index;
3109 else if (p->flags & BSF_GLOBAL)
3111 /* This must be a symbol definition */
3113 if (! ieee_write_byte (abfd, ieee_external_symbol_enum)
3114 || ! ieee_write_int (abfd, public_index)
3115 || ! ieee_write_id (abfd, p->name)
3116 || ! ieee_write_2bytes (abfd, ieee_attribute_record_enum)
3117 || ! ieee_write_int (abfd, public_index)
3118 || ! ieee_write_byte (abfd, 15) /* instruction address */
3119 || ! ieee_write_byte (abfd, 19) /* static symbol */
3120 || ! ieee_write_byte (abfd, 1)) /* one of them */
3123 /* Write out the value */
3124 if (! ieee_write_2bytes (abfd, ieee_value_record_enum)
3125 || ! ieee_write_int (abfd, public_index))
3127 if (! bfd_is_abs_section (p->section))
3129 if (abfd->flags & EXEC_P)
3131 /* If fully linked, then output all symbols
3133 if (! (ieee_write_int
3136 + p->section->output_offset
3137 + p->section->output_section->vma))))
3142 if (! (ieee_write_expression
3144 p->value + p->section->output_offset,
3145 p->section->output_section->symbol,
3152 if (! ieee_write_expression (abfd,
3154 bfd_abs_section_ptr->symbol,
3158 p->value = public_index;
3163 /* This can happen - when there are gaps in the symbols read */
3164 /* from an input ieee file */
3169 ieee->w.r.external_part = here;
3175 static CONST unsigned char exten[] =
3178 0xf1, 0xce, 0x20, 0x00, 37, 3, 3, /* Set version 3 rev 3 */
3179 0xf1, 0xce, 0x20, 0x00, 39, 2,/* keep symbol in original case */
3180 0xf1, 0xce, 0x20, 0x00, 38 /* set object type relocateable to x */
3183 static CONST unsigned char envi[] =
3187 /* 0xf1, 0xce, 0x21, 00, 50, 0x82, 0x07, 0xc7, 0x09, 0x11, 0x11,
3190 0xf1, 0xce, 0x21, 00, 52, 0x00, /* exec ok */
3192 0xf1, 0xce, 0x21, 0, 53, 0x03,/* host unix */
3193 /* 0xf1, 0xce, 0x21, 0, 54, 2,1,1 tool & version # */
3197 ieee_write_me_part (abfd)
3200 ieee_data_type *ieee = IEEE_DATA (abfd);
3201 ieee->w.r.trailer_part = bfd_tell (abfd);
3202 if (abfd->start_address)
3204 ieee->w.r.me_record = bfd_tell (abfd);
3205 if (! ieee_write_2bytes (abfd, ieee_value_starting_address_enum)
3206 || ! ieee_write_byte (abfd, ieee_function_either_open_b_enum)
3207 || ! ieee_write_int (abfd, abfd->start_address)
3208 || ! ieee_write_byte (abfd, ieee_function_either_close_b_enum))
3213 ieee->w.r.me_record = bfd_tell (abfd);
3215 if (! ieee_write_byte (abfd, ieee_module_end_enum))
3221 ieee_write_object_contents (abfd)
3224 ieee_data_type *ieee = IEEE_DATA (abfd);
3228 /* Fast forward over the header area */
3229 if (bfd_seek (abfd, (file_ptr) 0, SEEK_SET) != 0)
3231 if (! ieee_write_byte (abfd, ieee_module_beginning_enum)
3232 || ! ieee_write_id (abfd, bfd_printable_name (abfd))
3233 || ! ieee_write_id (abfd, abfd->filename))
3236 /* Fast forward over the variable bits */
3237 if (! ieee_write_byte (abfd, ieee_address_descriptor_enum))
3241 if (! ieee_write_byte (abfd, (bfd_byte) (bfd_arch_bits_per_byte (abfd))))
3243 /* MAU's per address */
3244 if (! ieee_write_byte (abfd,
3245 (bfd_byte) (bfd_arch_bits_per_address (abfd)
3246 / bfd_arch_bits_per_byte (abfd))))
3249 old = bfd_tell (abfd);
3250 if (bfd_seek (abfd, (file_ptr) (8 * N_W_VARIABLES), SEEK_CUR) != 0)
3253 ieee->w.r.extension_record = bfd_tell (abfd);
3254 if (bfd_write ((char *) exten, 1, sizeof (exten), abfd) != sizeof (exten))
3256 if (abfd->flags & EXEC_P)
3258 if (! ieee_write_byte (abfd, 0x1)) /* Absolute */
3263 if (! ieee_write_byte (abfd, 0x2)) /* Relocateable */
3267 ieee->w.r.environmental_record = bfd_tell (abfd);
3268 if (bfd_write ((char *) envi, 1, sizeof (envi), abfd) != sizeof (envi))
3274 if (! ieee_write_section_part (abfd))
3276 /* First write the symbols. This changes their values into table
3277 indeces so we cant use it after this point. */
3278 if (! ieee_write_external_part (abfd))
3281 /* ieee_write_byte(abfd, ieee_record_seperator_enum);*/
3283 /* ieee_write_byte(abfd, ieee_record_seperator_enum);*/
3286 /* Write any debugs we have been told about. */
3287 if (! ieee_write_debug_part (abfd))
3290 /* Can only write the data once the symbols have been written, since
3291 the data contains relocation information which points to the
3293 if (! ieee_write_data_part (abfd))
3296 /* At the end we put the end! */
3297 if (! ieee_write_me_part (abfd))
3300 /* Generate the header */
3301 if (bfd_seek (abfd, old, SEEK_SET) != 0)
3304 for (i = 0; i < N_W_VARIABLES; i++)
3306 if (! ieee_write_2bytes (abfd, ieee_assign_value_to_variable_enum)
3307 || ! ieee_write_byte (abfd, (bfd_byte) i)
3308 || ! ieee_write_int5_out (abfd, ieee->w.offset[i]))
3315 /* Native-level interface to symbols. */
3317 /* We read the symbols into a buffer, which is discarded when this
3318 function exits. We read the strings into a buffer large enough to
3319 hold them all plus all the cached symbol entries. */
3322 ieee_make_empty_symbol (abfd)
3325 ieee_symbol_type *new =
3326 (ieee_symbol_type *) bfd_zmalloc (sizeof (ieee_symbol_type));
3329 new->symbol.the_bfd = abfd;
3330 return &new->symbol;
3334 ieee_openr_next_archived_file (arch, prev)
3338 ieee_ar_data_type *ar = IEEE_AR_DATA (arch);
3339 /* take the next one from the arch state, or reset */
3340 if (prev == (bfd *) NULL)
3342 /* Reset the index - the first two entries are bogus*/
3343 ar->element_index = 2;
3347 ieee_ar_obstack_type *p = ar->elements + ar->element_index;
3348 ar->element_index++;
3349 if (ar->element_index <= ar->element_count)
3351 if (p->file_offset != (file_ptr) 0)
3353 if (p->abfd == (bfd *) NULL)
3355 p->abfd = _bfd_create_empty_archive_element_shell (arch);
3356 p->abfd->origin = p->file_offset;
3363 bfd_set_error (bfd_error_no_more_archived_files);
3364 return (bfd *) NULL;
3371 ieee_find_nearest_line (abfd,
3382 char **filename_ptr;
3383 char **functionname_ptr;
3390 ieee_generic_stat_arch_elt (abfd, buf)
3394 ieee_ar_data_type *ar = abfd->my_archive->tdata.ieee_ar_data;
3395 if (ar == (ieee_ar_data_type *) NULL)
3397 bfd_set_error (bfd_error_invalid_operation);
3403 buf->st_mode = 0666;
3404 return !ieee_object_p (abfd);
3409 ieee_sizeof_headers (abfd, x)
3417 /* The debug info routines are never used. */
3421 ieee_bfd_debug_info_start (abfd)
3428 ieee_bfd_debug_info_end (abfd)
3435 /* Add this section to the list of sections we have debug info for, to
3436 be ready to output it at close time
3439 ieee_bfd_debug_info_accumulate (abfd, section)
3443 ieee_data_type *ieee = IEEE_DATA (section->owner);
3444 ieee_data_type *output_ieee = IEEE_DATA (abfd);
3445 /* can only accumulate data from other ieee bfds */
3446 if (section->owner->xvec != abfd->xvec)
3448 /* Only bother once per bfd */
3449 if (ieee->done_debug == true)
3451 ieee->done_debug = true;
3453 /* Don't bother if there is no debug info */
3454 if (ieee->w.r.debug_information_part == 0)
3460 bfd_chain_type *n = (bfd_chain_type *) bfd_alloc (abfd, sizeof (bfd_chain_type));
3462 abort (); /* FIXME */
3463 n->this = section->owner;
3464 n->next = (bfd_chain_type *) NULL;
3466 if (output_ieee->chain_head)
3468 output_ieee->chain_head->next = n;
3472 output_ieee->chain_root = n;
3475 output_ieee->chain_head = n;
3481 #define ieee_close_and_cleanup _bfd_generic_close_and_cleanup
3482 #define ieee_bfd_free_cached_info _bfd_generic_bfd_free_cached_info
3484 #define ieee_slurp_armap bfd_true
3485 #define ieee_slurp_extended_name_table bfd_true
3486 #define ieee_construct_extended_name_table \
3487 ((boolean (*) PARAMS ((bfd *, char **, bfd_size_type *, const char **))) \
3489 #define ieee_truncate_arname bfd_dont_truncate_arname
3490 #define ieee_write_armap \
3492 PARAMS ((bfd *, unsigned int, struct orl *, unsigned int, int))) \
3494 #define ieee_read_ar_hdr bfd_nullvoidptr
3495 #define ieee_update_armap_timestamp bfd_true
3497 #define ieee_bfd_is_local_label bfd_generic_is_local_label
3498 #define ieee_get_lineno _bfd_nosymbols_get_lineno
3499 #define ieee_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol
3500 #define ieee_read_minisymbols _bfd_generic_read_minisymbols
3501 #define ieee_minisymbol_to_symbol _bfd_generic_minisymbol_to_symbol
3503 #define ieee_bfd_reloc_type_lookup _bfd_norelocs_bfd_reloc_type_lookup
3505 #define ieee_set_arch_mach _bfd_generic_set_arch_mach
3507 #define ieee_get_section_contents_in_window \
3508 _bfd_generic_get_section_contents_in_window
3509 #define ieee_bfd_get_relocated_section_contents \
3510 bfd_generic_get_relocated_section_contents
3511 #define ieee_bfd_relax_section bfd_generic_relax_section
3512 #define ieee_bfd_link_hash_table_create _bfd_generic_link_hash_table_create
3513 #define ieee_bfd_link_add_symbols _bfd_generic_link_add_symbols
3514 #define ieee_bfd_final_link _bfd_generic_final_link
3515 #define ieee_bfd_link_split_section _bfd_generic_link_split_section
3518 const bfd_target ieee_vec =
3521 bfd_target_ieee_flavour,
3522 BFD_ENDIAN_UNKNOWN, /* target byte order */
3523 BFD_ENDIAN_UNKNOWN, /* target headers byte order */
3524 (HAS_RELOC | EXEC_P | /* object flags */
3525 HAS_LINENO | HAS_DEBUG |
3526 HAS_SYMS | HAS_LOCALS | WP_TEXT | D_PAGED),
3527 (SEC_CODE | SEC_DATA | SEC_ROM | SEC_HAS_CONTENTS
3528 | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* section flags */
3529 0, /* leading underscore */
3530 ' ', /* ar_pad_char */
3531 16, /* ar_max_namelen */
3532 bfd_getb64, bfd_getb_signed_64, bfd_putb64,
3533 bfd_getb32, bfd_getb_signed_32, bfd_putb32,
3534 bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* data */
3535 bfd_getb64, bfd_getb_signed_64, bfd_putb64,
3536 bfd_getb32, bfd_getb_signed_32, bfd_putb32,
3537 bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* hdrs */
3540 ieee_object_p, /* bfd_check_format */
3547 _bfd_generic_mkarchive,
3552 ieee_write_object_contents,
3553 _bfd_write_archive_contents,
3557 BFD_JUMP_TABLE_GENERIC (ieee),
3558 BFD_JUMP_TABLE_COPY (_bfd_generic),
3559 BFD_JUMP_TABLE_CORE (_bfd_nocore),
3560 BFD_JUMP_TABLE_ARCHIVE (ieee),
3561 BFD_JUMP_TABLE_SYMBOLS (ieee),
3562 BFD_JUMP_TABLE_RELOCS (ieee),
3563 BFD_JUMP_TABLE_WRITE (ieee),
3564 BFD_JUMP_TABLE_LINK (ieee),
3565 BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),