• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.10/cxxfilt-11/cxxfilt/bfd/

Lines Matching defs:ieee

1 /* BFD back-end for ieee-695 objects.
33 #include "ieee.h"
56 /* Functions for writing to ieee files in the strange way that the
169 /* Functions for reading from ieee files in the strange way that the
172 #define this_byte(ieee) *((ieee)->input_p)
173 #define next_byte(ieee) ((ieee)->input_p++)
174 #define this_byte_and_next(ieee) (*((ieee)->input_p++))
177 read_2bytes (common_header_type *ieee)
179 unsigned char c1 = this_byte_and_next (ieee);
180 unsigned char c2 = this_byte_and_next (ieee);
186 bfd_get_string (common_header_type *ieee, char *string, size_t length)
191 string[i] = this_byte_and_next (ieee);
195 read_id (common_header_type *ieee)
200 length = this_byte_and_next (ieee);
207 length = this_byte_and_next (ieee);
212 length = this_byte_and_next (ieee);
213 length = (length * 256) + this_byte_and_next (ieee);
217 string = bfd_alloc (ieee->abfd, (bfd_size_type) length + 1);
220 bfd_get_string (ieee, string, length);
344 parse_int (common_header_type *ieee, bfd_vma *value_ptr)
346 int value = this_byte (ieee);
352 next_byte (ieee);
360 next_byte (ieee);
363 result = (result << 8) | this_byte_and_next (ieee);
373 parse_i (common_header_type *ieee, bfd_boolean *ok)
376 *ok = parse_int (ieee, &x);
381 must_parse_int (common_header_type *ieee)
384 BFD_ASSERT (parse_int (ieee, &result));
501 parse_expression (ieee_data_type *ieee,
524 while (loop && ieee->h.input_p < ieee->h.last_byte)
526 switch (this_byte (&(ieee->h)))
533 next_byte (&(ieee->h));
535 section_n = must_parse_int (&(ieee->h));
541 next_byte (&(ieee->h));
542 PUSH (NOSYMBOL, ieee->section_table[must_parse_int (&(ieee->h))], 0);
547 next_byte (&(ieee->h));
548 PUSH (NOSYMBOL, ieee->section_table[must_parse_int (&(ieee->h))], 0);
552 next_byte (&(ieee->h));
555 ieee->section_table[must_parse_int (&(ieee->h))]->size);
562 next_byte (&(ieee->h));
563 sy.index = (int) must_parse_int (&(ieee->h));
574 next_byte (&(ieee->h));
575 sy.index = (int) (must_parse_int (&(ieee->h)));
587 next_byte (&(ieee->h));
602 next_byte (&(ieee->h));
615 BFD_ASSERT (this_byte (&(ieee->h)) < (int) ieee_variable_A_enum
616 || this_byte (&(ieee->h)) > (int) ieee_variable_Z_enum);
617 if (parse_int (&(ieee->h), &va))
648 #define ieee_seek(ieee, offset) \
651 ieee->h.input_p = ieee->h.first_byte + offset; \
652 ieee->h.last_byte = (ieee->h.first_byte \
653 + ieee_part_after (ieee, offset)); \
657 #define ieee_pos(ieee) \
658 (ieee->h.input_p - ieee->h.first_byte)
660 /* Find the first part of the ieee file after HERE. */
663 ieee_part_after (ieee_data_type *ieee, file_ptr here)
666 file_ptr after = ieee->w.r.me_record;
671 if (ieee->w.offset[part] > here && after > ieee->w.offset[part])
672 after = ieee->w.offset[part];
682 ieee_data_type *ieee,
690 unsigned int new_index = must_parse_int (&(ieee->h));
697 new_symbol = bfd_alloc (ieee->h.abfd, amt);
719 ieee_data_type *ieee = IEEE_DATA (abfd);
720 file_ptr offset = ieee->w.r.external_part;
722 ieee_symbol_type **prev_symbols_ptr = &ieee->external_symbols;
723 ieee_symbol_type **prev_reference_ptr = &ieee->external_reference;
729 ieee->symbol_table_full = TRUE;
731 ieee_seek (ieee, offset);
735 switch (this_byte (&(ieee->h)))
738 next_byte (&(ieee->h));
740 symbol = get_symbol (abfd, ieee, symbol, &symbol_count,
742 & ieee->external_symbol_max_index, 'I');
747 symbol->symbol.name = read_id (&(ieee->h));
752 next_byte (&(ieee->h));
754 symbol = get_symbol (abfd, ieee, symbol, &symbol_count,
756 &ieee->external_symbol_max_index, 'D');
760 BFD_ASSERT (symbol->index >= ieee->external_symbol_min_index);
763 symbol->symbol.name = read_id (&(ieee->h));
774 switch (read_2bytes (&ieee->h))
777 symbol_name_index = must_parse_int (&(ieee->h));
778 symbol_type_index = must_parse_int (&(ieee->h));
779 symbol_attribute_def = must_parse_int (&(ieee->h));
784 parse_int (&ieee->h, &value);
797 parse_int (&(ieee->h), &value);
798 parse_int (&(ieee->h), &value);
799 parse_int (&(ieee->h), &value);
800 parse_int (&(ieee->h), &value);
806 parse_int (&ieee->h, &value);
807 parse_int (&ieee->h, &value);
808 parse_int (&ieee->h, &value);
817 parse_int (&ieee->h, &value);
818 parse_int (&ieee->h, &value);
825 switch (read_2bytes (&ieee->h))
828 parse_int (&ieee->h, &val1);
829 parse_int (&ieee->h, &val1);
849 next_byte (&(ieee->h));
850 next_byte (&(ieee->h));
852 symbol_name_index = must_parse_int (&(ieee->h));
853 parse_expression (ieee,
891 next_byte (&(ieee->h));
893 (void) must_parse_int (&(ieee->h));
895 size = must_parse_int (&(ieee->h));
897 if (! parse_int (&(ieee->h), &value))
906 next_byte (&(ieee->h));
908 symbol = get_symbol (abfd, ieee, symbol, &symbol_count,
910 &ieee->external_reference_max_index, 'X');
915 symbol->symbol.name = read_id (&(ieee->h));
921 BFD_ASSERT (symbol->index >= ieee->external_reference_min_index);
929 if (ieee->external_symbol_max_index != 0)
931 ieee->external_symbol_count =
932 ieee->external_symbol_max_index -
933 ieee->external_symbol_min_index + 1;
936 ieee->external_symbol_count = 0;
938 if (ieee->external_reference_max_index != 0)
940 ieee->external_reference_count =
941 ieee->external_reference_max_index -
942 ieee->external_reference_min_index + 1;
945 ieee->external_reference_count = 0;
948 ieee->external_reference_count + ieee->external_symbol_count;
952 ieee->symbol_table_full = FALSE;
995 " ieee empty",
1007 ieee_data_type *ieee = IEEE_DATA (abfd);
1013 if (! ieee->symbol_table_full)
1023 ieee->external_symbol_base_offset = -ieee->external_symbol_min_index;
1028 location[symp->index + ieee->external_symbol_base_offset] = &symp->symbol;
1031 ieee->external_reference_base_offset =
1032 -ieee->external_reference_min_index + ieee->external_symbol_count;
1037 location[symp->index + ieee->external_reference_base_offset] =
1048 get_section_entry (bfd *abfd, ieee_data_type *ieee, unsigned int index)
1050 if (index >= ieee->section_table_size)
1056 c = ieee->section_table_size;
1064 n = bfd_realloc (ieee->section_table, amt);
1068 for (i = ieee->section_table_size; i < c; i++)
1071 ieee->section_table = n;
1072 ieee->section_table_size = c;
1075 if (ieee->section_table[index] == (asection *) NULL)
1084 ieee->section_table[index] = section;
1086 ieee->section_table[index] = section;
1088 return ieee->section_table[index];
1094 ieee_data_type *ieee = IEEE_DATA (abfd);
1095 file_ptr offset = ieee->w.r.section_part;
1102 ieee_seek (ieee, offset);
1105 switch (this_byte (&(ieee->h)))
1112 next_byte (&(ieee->h));
1113 section_index = must_parse_int (&(ieee->h));
1115 section = get_section_entry (abfd, ieee, section_index);
1117 section_type[0] = this_byte_and_next (&(ieee->h));
1125 section_type[1] = this_byte (&(ieee->h));
1131 next_byte (&(ieee->h));
1132 section_type[2] = this_byte (&(ieee->h));
1137 next_byte (&(ieee->h));
1142 next_byte (&(ieee->h));
1146 next_byte (&(ieee->h));
1158 section_type[1] = this_byte (&(ieee->h));
1163 next_byte (&(ieee->h));
1167 next_byte (&(ieee->h));
1171 next_byte (&(ieee->h));
1180 name = read_id (&ieee->h);
1188 parse_int (&(ieee->h), &parent);
1189 parse_int (&(ieee->h), &brother);
1190 parse_int (&(ieee->h), &context);
1200 next_byte (&(ieee->h));
1201 section_index = must_parse_int (&ieee->h);
1202 section = get_section_entry (abfd, ieee, section_index);
1203 if (section_index > ieee->section_count)
1204 ieee->section_count = section_index;
1207 bfd_log2 (must_parse_int (&ieee->h));
1208 (void) parse_int (&(ieee->h), &value);
1216 t = (ieee_record_enum_type) (read_2bytes (&(ieee->h)));
1220 section = ieee->section_table[must_parse_int (&(ieee->h))];
1221 section->size = must_parse_int (&(ieee->h));
1224 section = ieee->section_table[must_parse_int (&(ieee->h))];
1225 section->size = must_parse_int (&(ieee->h));
1228 section = ieee->section_table[must_parse_int (&(ieee->h))];
1229 section->vma = must_parse_int (&(ieee->h));
1233 must_parse_int (&(ieee->h));
1234 must_parse_int (&(ieee->h));
1237 must_parse_int (&(ieee->h));
1238 must_parse_int (&(ieee->h));
1241 section = ieee->section_table[must_parse_int (&(ieee->h))];
1242 section->vma = must_parse_int (&(ieee->h));
1246 (void) must_parse_int (&(ieee->h));
1247 (void) must_parse_int (&(ieee->h));
1269 ieee_data_type *ieee = IEEE_DATA (abfd);
1274 if (ieee->w.r.debug_information_part == 0)
1281 sec->filepos = ieee->w.r.debug_information_part;
1283 debug_end = ieee_part_after (ieee, ieee->w.r.debug_information_part);
1284 sec->size = debug_end - ieee->w.r.debug_information_part;
1300 ieee_ar_data_type *ieee;
1308 ieee = IEEE_AR_DATA (abfd);
1311 the entire buffer. We might have a very small ieee file. */
1314 ieee->h.first_byte = buffer;
1315 ieee->h.input_p = buffer;
1317 ieee->h.abfd = abfd;
1319 if (this_byte (&(ieee->h)) != Module_Beginning)
1322 next_byte (&(ieee->h));
1323 library = read_id (&(ieee->h));
1328 read_id (&(ieee->h));
1330 ieee->element_count = 0;
1331 ieee->element_index = 0;
1333 next_byte (&(ieee->h)); /* Drop the ad part. */
1334 must_parse_int (&(ieee->h)); /* And the two dummy numbers. */
1335 must_parse_int (&(ieee->h));
1348 rec = read_2bytes (&(ieee->h));
1352 if (ieee->element_count >= alc_elts)
1363 t = &elts[ieee->element_count];
1364 ieee->element_count++;
1366 must_parse_int (&(ieee->h));
1367 t->file_offset = must_parse_int (&(ieee->h));
1380 ieee->h.first_byte = buffer;
1381 ieee->h.input_p = buffer;
1385 amt = ieee->element_count;
1386 amt *= sizeof *ieee->elements;
1387 ieee->elements = bfd_alloc (abfd, amt);
1388 if (ieee->elements == NULL)
1391 memcpy (ieee->elements, elts, (size_t) amt);
1396 for (i = 2; i < ieee->element_count; i++)
1398 if (bfd_seek (abfd, ieee->elements[i].file_offset, SEEK_SET) != 0)
1403 ieee->h.first_byte = buffer;
1404 ieee->h.input_p = buffer;
1406 next_byte (&(ieee->h)); /* Drop F8. */
1407 next_byte (&(ieee->h)); /* Drop 14. */
1408 must_parse_int (&(ieee->h)); /* Drop size of block. */
1410 if (must_parse_int (&(ieee->h)) != 0)
1412 ieee->elements[i].file_offset = 0;
1414 ieee->elements[i].file_offset = must_parse_int (&(ieee->h));
1426 bfd_release (abfd, ieee);
1453 do_one (ieee_data_type *ieee,
1459 switch (this_byte (&(ieee->h)))
1466 next_byte (&(ieee->h));
1467 number_of_maus = must_parse_int (&(ieee->h));
1471 location_ptr[current_map->pc++] = this_byte (&(ieee->h));
1472 next_byte (&(ieee->h));
1481 next_byte (&(ieee->h));
1484 switch (this_byte (&(ieee->h)))
1497 r = bfd_alloc (ieee->h.abfd, sizeof (* r));
1504 next_byte (&(ieee->h));
1507 parse_expression (ieee,
1518 if (this_byte (&(ieee->h)) == (int) ieee_comma)
1520 next_byte (&(ieee->h));
1522 extra = must_parse_int (&(ieee->h));
1525 switch (this_byte (&(ieee->h)))
1528 next_byte (&(ieee->h));
1531 next_byte (&(ieee->h));
1534 next_byte (&(ieee->h));
1554 bfd_put_32 (ieee->h.abfd, -current_map->pc,
1559 bfd_put_32 (ieee->h.abfd, (bfd_vma) 0, location_ptr +
1566 bfd_put_32 (ieee->h.abfd, (bfd_vma) 0,
1576 bfd_put_16 (ieee->h.abfd, (bfd_vma) -current_map->pc,
1582 bfd_put_16 (ieee->h.abfd, (bfd_vma) 0,
1590 bfd_put_16 (ieee->h.abfd, (bfd_vma) 0,
1600 bfd_put_8 (ieee->h.abfd, (int) (-current_map->pc), location_ptr + current_map->pc);
1604 bfd_put_8 (ieee->h.abfd, 0, location_ptr + current_map->pc);
1610 bfd_put_8 (ieee->h.abfd, 0, location_ptr + current_map->pc);
1626 if (parse_int (&(ieee->h), &this_size))
1632 location_ptr[current_map->pc++] = this_byte (&(ieee->h));
1633 next_byte (&(ieee->h));
1657 ieee_data_type *ieee = IEEE_DATA (abfd);
1663 if (ieee->read_data)
1665 ieee->read_data = TRUE;
1666 ieee_seek (ieee, ieee->w.r.data_part);
1676 per->data = bfd_alloc (ieee->h.abfd, s->size);
1685 switch (this_byte (&(ieee->h)))
1692 next_byte (&(ieee->h));
1693 section_number = must_parse_int (&(ieee->h));
1694 s = ieee->section_table[section_number];
1705 next_byte (&(ieee->h));
1706 switch (this_byte (&(ieee->h)))
1715 next_byte (&(ieee->h));
1716 must_parse_int (&(ieee->h)); /* Throw away section #. */
1717 parse_expression (ieee, &value,
1727 next_byte (&(ieee->h));
1728 if (this_byte (&(ieee->h)) == ieee_function_either_open_b_enum)
1729 next_byte (&(ieee->h));
1730 abfd->start_address = must_parse_int (&(ieee->h));
1747 next_byte (&(ieee->h));
1748 iterations = must_parse_int (&(ieee->h));
1749 start = ieee->h.input_p;
1758 next_byte (&(ieee->h));
1759 next_byte (&(ieee->h));
1760 next_byte (&(ieee->h));
1766 ieee->h.input_p = start;
1767 if (!do_one (ieee, current_map, location_ptr, s,
1777 if (!do_one (ieee, current_map, location_ptr, s, 1))
1788 ieee_data_type *ieee;
1796 ieee = IEEE_DATA (abfd);
1803 ieee->h.input_p = buffer;
1804 if (this_byte_and_next (&(ieee->h)) != Module_Beginning)
1807 ieee->read_symbols = FALSE;
1808 ieee->read_data = FALSE;
1809 ieee->section_count = 0;
1810 ieee->external_symbol_max_index = 0;
1811 ieee->external_symbol_min_index = IEEE_PUBLIC_BASE;
1812 ieee->external_reference_min_index = IEEE_REFERENCE_BASE;
1813 ieee->external_reference_max_index = 0;
1814 ieee->h.abfd = abfd;
1815 ieee->section_table = NULL;
1816 ieee->section_table_size = 0;
1818 processor = ieee->mb.processor = read_id (&(ieee->h));
1821 ieee->mb.module_name = read_id (&(ieee->h));
1823 abfd->filename = ieee->mb.module_name;
1896 if (this_byte (&(ieee->h)) != (int) ieee_address_descriptor_enum)
1899 next_byte (&(ieee->h));
1901 if (! parse_int (&(ieee->h), &ieee->ad.number_of_bits_mau))
1904 if (! parse_int (&(ieee->h), &ieee->ad.number_of_maus_in_address))
1908 if (this_byte (&(ieee->h)) == (int) ieee_variable_L_enum
1909 || this_byte (&(ieee->h)) == (int) ieee_variable_M_enum)
1910 next_byte (&(ieee->h));
1916 if (read_2bytes (&(ieee->h)) != (int) ieee_assign_value_to_variable_enum)
1919 if (this_byte_and_next (&(ieee->h)) != part)
1922 ieee->w.offset[part] = parse_i (&(ieee->h), &ok);
1927 if (ieee->w.r.external_part != 0)
1935 amt = ieee->w.r.me_record + 1;
1936 IEEE_DATA (abfd)->h.first_byte = bfd_alloc (ieee->h.abfd, amt);
1944 (bfd_size_type) ieee->w.r.me_record + 1, abfd);
1960 bfd_release (abfd, ieee);
2064 ieee_data_type *ieee = IEEE_DATA (abfd);
2076 symbols + src->symbol.index + ieee->external_symbol_base_offset;
2080 symbols + src->symbol.index + ieee->external_reference_base_offset;
2111 ieee_data_type *ieee = IEEE_DATA (abfd);
2114 ieee->w.r.section_part = bfd_tell (abfd);
2602 ieee_data_type *ieee;
2609 ieee = IEEE_DATA (input_bfd);
2610 s = ieee->section_table[section_number];
3104 ieee_data_type *ieee = IEEE_DATA (abfd);
3105 bfd_chain_type *chain = ieee->chain_root;
3124 ieee->w.r.debug_information_part = 0;
3128 ieee->w.r.debug_information_part = here;
3151 ieee->w.r.debug_information_part = here;
3153 ieee->w.r.debug_information_part = 0;
3161 /* Write the data in an ieee way. */
3168 ieee_data_type *ieee = IEEE_DATA (abfd);
3169 ieee->w.r.data_part = bfd_tell (abfd);
3263 ieee_data_type *ieee = IEEE_DATA (abfd);
3357 from an input ieee file. */
3362 ieee->w.r.external_part = here;
3392 ieee_data_type *ieee = IEEE_DATA (abfd);
3393 ieee->w.r.trailer_part = bfd_tell (abfd);
3402 ieee->w.r.me_record = bfd_tell (abfd);
3506 ieee_data_type *ieee = IEEE_DATA (abfd);
3536 ieee->w.r.extension_record = bfd_tell (abfd);
3551 ieee->w.r.environmental_record = bfd_tell (abfd);
3609 || ! ieee_write_int5_out (abfd, (bfd_vma) ieee->w.offset[i]))
3695 ieee_data_type *ieee;
3714 ieee = IEEE_DATA (abfd);
3716 buf->st_size = ieee->w.r.me_record + 1;
3778 "ieee", /* Name. */
3817 BFD_JUMP_TABLE_GENERIC (ieee),
3827 BFD_JUMP_TABLE_ARCHIVE (ieee),
3834 BFD_JUMP_TABLE_SYMBOLS (ieee),
3838 BFD_JUMP_TABLE_RELOCS (ieee),
3841 BFD_JUMP_TABLE_WRITE (ieee),
3849 BFD_JUMP_TABLE_LINK (ieee),