Lines Matching refs:abfd
490 mmo_make_section (abfd, secname) in mmo_make_section() argument
491 bfd *abfd; in mmo_make_section()
494 asection *sec = bfd_get_section_by_name (abfd, secname);
504 bfd_get_filename (abfd), secname);
508 sec = bfd_make_section (abfd, newsecname);
542 mmo_object_p (abfd) in mmo_object_p() argument
543 bfd *abfd; in mmo_object_p()
550 if (bfd_stat (abfd, &statbuf) < 0
551 || bfd_seek (abfd, (file_ptr) 0, SEEK_SET) != 0
552 || bfd_bread (b, 4, abfd) != 4)
562 if (bfd_seek (abfd, (file_ptr) statbuf.st_size - 4, SEEK_SET) != 0
563 || bfd_bread (b, 4, abfd) != 4)
567 if (b[0] != LOP || b[1] != LOP_END || ! mmo_mkobject (abfd))
572 abfd->tdata.mmo_data->max_symbol_length = (b[2] * 256 + b[3]) * 4;
573 abfd->tdata.mmo_data->lop_stab_symbol
574 = bfd_malloc (abfd->tdata.mmo_data->max_symbol_length + 1);
576 if (abfd->tdata.mmo_data->lop_stab_symbol == NULL)
580 bfd_get_filename (abfd), abfd->tdata.mmo_data->max_symbol_length);
585 if (! mmo_scan (abfd))
588 if (abfd->symcount > 0)
589 abfd->flags |= HAS_SYMS;
594 if (! bfd_default_set_arch_mach (abfd, bfd_arch_mmix, 0))
597 return abfd->xvec;
600 free (abfd->tdata.mmo_data->lop_stab_symbol);
610 mmo_mkobject (abfd) in mmo_mkobject() argument
611 bfd *abfd; in mmo_mkobject()
615 if (abfd->tdata.mmo_data == NULL)
626 bfd_put_32 (abfd, created, tdata->created);
628 abfd->tdata.mmo_data = tdata;
655 mmo_find_sec_w_addr (abfd, sec, p) in mmo_find_sec_w_addr() argument
656 bfd *abfd ATTRIBUTE_UNUSED; in mmo_find_sec_w_addr()
661 bfd_vma vma = bfd_get_section_vma (abfd, sec);
664 if ((bfd_get_section_flags (abfd, sec) & (SEC_LOAD | SEC_ALLOC))
673 mmo_find_sec_w_addr_grow (abfd, sec, p) in mmo_find_sec_w_addr_grow() argument
674 bfd *abfd ATTRIBUTE_UNUSED; in mmo_find_sec_w_addr_grow()
679 bfd_vma vma = bfd_get_section_vma (abfd, sec);
682 if ((bfd_get_section_flags (abfd, sec) & (SEC_LOAD | SEC_ALLOC))
696 mmo_decide_section (abfd, vma) in mmo_decide_section() argument
697 bfd *abfd; in mmo_decide_section()
708 bfd_map_over_sections (abfd, mmo_find_sec_w_addr, &info);
719 sec = bfd_make_section_old_way (abfd, MMO_TEXT_SECTION_NAME);
725 bfd_set_section_vma (abfd, sec, vma);
726 if (! bfd_set_section_flags (abfd, sec,
727 bfd_get_section_flags (abfd, sec)
733 sec = bfd_make_section_old_way (abfd, MMO_DATA_SECTION_NAME);
739 bfd_set_section_vma (abfd, sec, vma);
740 if (! bfd_set_section_flags (abfd, sec,
741 bfd_get_section_flags (abfd, sec)
746 bfd_map_over_sections (abfd, mmo_find_sec_w_addr_grow, &info);
752 sprintf (sec_name, ".MMIX.sec.%d", abfd->tdata.mmo_data->sec_no++);
753 sec = mmo_make_section (abfd, sec_name);
755 bfd_set_section_vma (abfd, sec, vma);
757 if (! bfd_set_section_flags (abfd, sec,
758 bfd_get_section_flags (abfd, sec)
812 mmo_write_tetra_raw (abfd, value) in mmo_write_tetra_raw() argument
813 bfd *abfd; in mmo_write_tetra_raw()
818 bfd_put_32 (abfd, value, buf);
820 if (bfd_bwrite ((PTR) buf, 4, abfd) != 4)
821 abfd->tdata.mmo_data->have_error = TRUE;
827 mmo_write_tetra (abfd, value) in mmo_write_tetra() argument
828 bfd *abfd; in mmo_write_tetra()
832 mmo_write_tetra_raw (abfd, LOP_QUOTE_NEXT);
834 mmo_write_tetra_raw (abfd, value);
840 mmo_write_octa (abfd, value) in mmo_write_octa() argument
841 bfd *abfd; in mmo_write_octa()
844 mmo_write_tetra (abfd, (unsigned int) (value >> 32));
845 mmo_write_tetra (abfd, (unsigned int) value);
851 mmo_write_octa_raw (abfd, value) in mmo_write_octa_raw() argument
852 bfd *abfd; in mmo_write_octa_raw()
855 mmo_write_tetra_raw (abfd, (unsigned int) (value >> 32));
856 mmo_write_tetra_raw (abfd, (unsigned int) value);
863 mmo_write_chunk (abfd, loc, len) in mmo_write_chunk() argument
864 bfd *abfd; in mmo_write_chunk()
871 if (abfd->tdata.mmo_data->byte_no != 0)
873 while (abfd->tdata.mmo_data->byte_no < 4 && len != 0)
875 abfd->tdata.mmo_data->buf[abfd->tdata.mmo_data->byte_no++] = *loc++;
879 if (abfd->tdata.mmo_data->byte_no == 4)
881 mmo_write_tetra (abfd,
882 bfd_get_32 (abfd, abfd->tdata.mmo_data->buf));
883 abfd->tdata.mmo_data->byte_no = 0;
890 mmo_write_tetra_raw (abfd, LOP_QUOTE_NEXT);
893 && ! abfd->tdata.mmo_data->have_error
894 && 4 == bfd_bwrite ((PTR) loc, 4, abfd));
902 memcpy (abfd->tdata.mmo_data->buf, loc, len);
903 abfd->tdata.mmo_data->byte_no = len;
907 abfd->tdata.mmo_data->have_error = TRUE;
915 mmo_flush_chunk (abfd) in mmo_flush_chunk() argument
916 bfd *abfd; in mmo_flush_chunk()
918 if (abfd->tdata.mmo_data->byte_no != 0)
920 memset (abfd->tdata.mmo_data->buf + abfd->tdata.mmo_data->byte_no,
921 0, 4 - abfd->tdata.mmo_data->byte_no);
922 mmo_write_tetra (abfd,
923 bfd_get_32 (abfd, abfd->tdata.mmo_data->buf));
924 abfd->tdata.mmo_data->byte_no = 0;
927 return ! abfd->tdata.mmo_data->have_error;
933 mmo_write_chunk_list (abfd, datap) in mmo_write_chunk_list() argument
934 bfd *abfd; in mmo_write_chunk_list()
938 if (! mmo_write_chunk (abfd, datap->data, datap->size))
941 return mmo_flush_chunk (abfd);
949 mmo_write_loc_chunk (abfd, vma, loc, len, last_vmap) in mmo_write_loc_chunk() argument
950 bfd *abfd; in mmo_write_loc_chunk()
964 if (abfd->tdata.mmo_data->byte_no == 0 || vma != *last_vmap)
966 while (len >= 4 && bfd_get_32 (abfd, loc) == 0)
973 while (len >= 4 && bfd_get_32 (abfd, loc + len - 4) == 0)
982 mmo_flush_chunk (abfd);
986 mmo_write_tetra_raw (abfd, (LOP << 24) | (LOP_LOC << 16) | 2);
987 mmo_write_octa_raw (abfd, vma);
993 return (! abfd->tdata.mmo_data->have_error
994 && mmo_write_chunk (abfd, loc, len));
1000 mmo_write_loc_chunk_list (abfd, datap) in mmo_write_loc_chunk_list() argument
1001 bfd *abfd; in mmo_write_loc_chunk_list()
1008 if (! mmo_write_loc_chunk (abfd, datap->where, datap->data, datap->size,
1012 return mmo_flush_chunk (abfd);
1018 mmo_get_generic_spec_data_section (abfd, spec_data_number) in mmo_get_generic_spec_data_section() argument
1019 bfd *abfd; in mmo_get_generic_spec_data_section()
1029 sec = mmo_make_section (abfd, secname);
1038 mmo_get_spec_section (abfd, spec_data_number) in mmo_get_spec_section() argument
1039 bfd *abfd; in mmo_get_spec_section()
1056 return mmo_get_generic_spec_data_section (abfd, spec_data_number);
1059 orig_pos = bfd_tell (abfd);
1062 if (bfd_bread (buf, 4, abfd) != 4)
1070 if (bfd_bread (buf, 4, abfd) != 4)
1076 secname_length = bfd_get_32 (abfd, buf) * 4;
1088 if (bfd_bread (secname + i * 4, 4, abfd) != 4)
1096 || bfd_bread (secname + i * 4, 4, abfd) != 4)
1105 if (bfd_bread (buf, 4, abfd) != 4
1107 && (buf[1] != LOP_QUOTE || bfd_bread (buf, 4, abfd) != 4)))
1110 flags = bfd_get_32 (abfd, buf);
1113 if (bfd_bread (buf, 4, abfd) != 4
1115 && (buf[1] != LOP_QUOTE || bfd_bread (buf, 4, abfd) != 4)))
1118 section_length = (bfd_vma) bfd_get_32 (abfd, buf) << 32;
1122 if (bfd_bread (buf, 4, abfd) != 4
1124 && (buf[1] != LOP_QUOTE || bfd_bread (buf, 4, abfd) != 4)))
1127 section_length |= (bfd_vma) bfd_get_32 (abfd, buf);
1134 if (bfd_bread (buf, 4, abfd) != 4
1136 && (buf[1] != LOP_QUOTE || bfd_bread (buf, 4, abfd) != 4)))
1139 section_vma = (bfd_vma) bfd_get_32 (abfd, buf) << 32;
1142 if (bfd_bread (buf, 4, abfd) != 4
1144 && (buf[1] != LOP_QUOTE || bfd_bread (buf, 4, abfd) != 4)))
1147 section_vma |= (bfd_vma) bfd_get_32 (abfd, buf);
1149 sec = mmo_make_section (abfd, secname);
1167 if (! bfd_set_section_flags (abfd, sec,
1169 | bfd_get_section_flags (abfd, sec)
1171 || ! bfd_set_section_size (abfd, sec,
1175 && ! bfd_set_section_vma (abfd, sec, section_vma)))
1195 if (bfd_seek (abfd, orig_pos, SEEK_SET) != 0)
1198 return mmo_get_generic_spec_data_section (abfd, spec_data_number);
1204 mmo_get_byte (abfd) in mmo_get_byte() argument
1205 bfd *abfd; in mmo_get_byte()
1209 if (abfd->tdata.mmo_data->byte_no == 0)
1211 if (! abfd->tdata.mmo_data->have_error
1212 && bfd_bread (abfd->tdata.mmo_data->buf, 4, abfd) != 4)
1214 abfd->tdata.mmo_data->have_error = TRUE;
1222 retval = abfd->tdata.mmo_data->buf[abfd->tdata.mmo_data->byte_no];
1223 abfd->tdata.mmo_data->byte_no = (abfd->tdata.mmo_data->byte_no + 1) % 4;
1231 mmo_write_byte (abfd, value) in mmo_write_byte() argument
1232 bfd *abfd; in mmo_write_byte()
1235 abfd->tdata.mmo_data->buf[(abfd->tdata.mmo_data->byte_no++ % 4)] = value;
1236 if ((abfd->tdata.mmo_data->byte_no % 4) == 0)
1238 if (! abfd->tdata.mmo_data->have_error
1239 && bfd_bwrite (abfd->tdata.mmo_data->buf, 4, abfd) != 4)
1240 abfd->tdata.mmo_data->have_error = TRUE;
1247 mmo_create_symbol (abfd, symname, addr, sym_type, serno) in mmo_create_symbol() argument
1248 bfd *abfd; in mmo_create_symbol()
1256 n = (struct mmo_symbol *) bfd_alloc (abfd, sizeof (struct mmo_symbol));
1260 n->name = bfd_alloc (abfd, strlen (symname) + 1);
1270 if (abfd->tdata.mmo_data->symbols == NULL)
1271 abfd->tdata.mmo_data->symbols = n;
1273 abfd->tdata.mmo_data->symtail->next = n;
1274 abfd->tdata.mmo_data->symtail = n;
1277 ++abfd->symcount;
1284 && bfd_get_start_address (abfd) != addr)
1288 bfd_get_filename (abfd));
1299 mmo_get_symbols (abfd) in mmo_get_symbols() argument
1300 bfd *abfd; in mmo_get_symbols()
1401 bfd_byte m = mmo_get_byte (abfd);
1404 if (abfd->tdata.mmo_data->have_error)
1409 mmo_get_symbols (abfd);
1413 bfd_byte c = mmo_get_byte (abfd);
1422 bfd_byte c2 = mmo_get_byte (abfd);
1429 abfd->tdata.mmo_data->lop_stab_symbol
1430 [abfd->tdata.mmo_data->symbol_position] = 0;
1435 bfd_get_filename (abfd), c, c2,
1436 abfd->tdata.mmo_data->lop_stab_symbol);
1438 abfd->tdata.mmo_data->have_error = TRUE;
1445 abfd->tdata.mmo_data->lop_stab_symbol[abfd->tdata.mmo_data->symbol_position++] = c;
1446 abfd->tdata.mmo_data->lop_stab_symbol[abfd->tdata.mmo_data->symbol_position] = 0;
1453 addr = mmo_get_byte (abfd);
1460 addr = (addr << 8) + mmo_get_byte (abfd);
1472 addr = (addr << 8) + mmo_get_byte (abfd);
1481 k = mmo_get_byte (abfd);
1488 if (! abfd->tdata.mmo_data->have_error
1489 && ! mmo_create_symbol (abfd,
1490 abfd->tdata.mmo_data->lop_stab_symbol
1493 abfd->tdata.mmo_data->have_error = TRUE;
1498 mmo_get_symbols (abfd);
1500 abfd->tdata.mmo_data->symbol_position--;
1505 mmo_get_symbols (abfd);
1507 return ! abfd->tdata.mmo_data->have_error;
1619 mmo_map_set_sizes (abfd, sec, ignored) in mmo_map_set_sizes() argument
1620 bfd *abfd ATTRIBUTE_UNUSED; in mmo_map_set_sizes()
1631 mmo_scan (abfd) in mmo_scan() argument
1632 bfd *abfd; in mmo_scan()
1638 asection *sec = bfd_make_section_old_way (abfd, MMO_TEXT_SECTION_NAME);
1650 if (bfd_seek (abfd, (file_ptr) 0, SEEK_SET) != 0)
1653 while ((nbytes_read = bfd_bread (buf, 4, abfd)) == 4)
1657 unsigned int y = bfd_get_8 (abfd, buf + 2);
1658 unsigned int z = bfd_get_8 (abfd, buf + 3);
1675 bfd_get_filename (abfd), buf[1]);
1685 bfd_get_filename (abfd), y*256+z);
1689 if (bfd_bread (buf, 4, abfd) != 4)
1692 mmo_xore_32 (sec, vma, bfd_get_32 (abfd, buf));
1704 if (bfd_bread (buf, 4, abfd) != 4)
1707 vma += bfd_get_32 (abfd, buf);
1712 if (bfd_bread (buf, 8, abfd) != 8)
1715 vma += bfd_get_64 (abfd, buf);
1721 bfd_get_filename (abfd), z);
1726 sec = mmo_decide_section (abfd, vma);
1735 sec = mmo_decide_section (abfd, vma);
1750 if (bfd_bread (buf, 4, abfd) != 4)
1753 p += bfd_get_32 (abfd, buf);
1758 if (bfd_bread (buf, 8, abfd) != 8)
1761 p += bfd_get_64 (abfd, buf);
1767 bfd_get_filename (abfd), z);
1774 fixosec = mmo_decide_section (abfd, p);
1786 asection *fixrsec = mmo_decide_section (abfd, p);
1806 bfd_get_filename (abfd), y);
1815 bfd_get_filename (abfd), z);
1821 if (bfd_bread (buf, 4, abfd) != 4)
1824 delta = bfd_get_32 (abfd, buf);
1838 bfd_get_filename (abfd), buf[0]);
1843 fixrsec = mmo_decide_section (abfd, vma);
1861 bfd_get_filename (abfd), y, z * 4 + 1);
1870 if (bfd_bread (fname + i * 4, 4, abfd) != 4)
1882 bfd_get_filename (abfd), y, fname, file_names[y]);
1895 bfd_get_filename (abfd), y);
1917 sec = mmo_get_spec_section (abfd, y * 256 + z);
1930 && bfd_bread (abfd->tdata.mmo_data->created, 4,
1931 abfd) != 4)
1935 if (bfd_bread (buf, 4, abfd) != 4)
1952 if (bfd_bread (buf, 8, abfd) != 8)
1955 first_octa = bfd_get_64 (abfd, buf);
1962 = bfd_make_section_old_way (abfd,
1966 bfd_put_64 (abfd, first_octa, loc);
1970 if (bfd_bread (loc + (i - z) * 8, 8, abfd) != 8)
1976 if (bfd_bread (buf, 8, abfd) != 8)
1979 startaddr_octa = bfd_get_64 (abfd, buf);
1984 if (! bfd_set_start_address (abfd, startaddr_octa))
2001 bfd_get_filename (abfd), y, z);
2008 stab_loc = bfd_tell (abfd);
2017 if (abfd->tdata.mmo_data->max_symbol_length != 0
2018 && ! mmo_get_symbols (abfd))
2027 long curpos = bfd_tell (abfd);
2029 if (bfd_stat (abfd, &statbuf) < 0)
2037 bfd_get_filename (abfd));
2050 bfd_get_filename (abfd), (long) (y * 256 + z),
2056 bfd_map_over_sections (abfd, mmo_map_set_sizes, NULL);
2064 mmo_xore_32 (sec, vma & ~3, bfd_get_32 (abfd, buf));
2089 sec = bfd_get_section_by_name (abfd, MMO_TEXT_SECTION_NAME);
2091 && (bfd_get_section_flags (abfd, sec) & SEC_HAS_CONTENTS)
2092 && ! bfd_set_section_flags (abfd, sec,
2093 bfd_get_section_flags (abfd, sec)
2097 sec = bfd_get_section_by_name (abfd, MMO_DATA_SECTION_NAME);
2099 && (bfd_get_section_flags (abfd, sec) & SEC_HAS_CONTENTS)
2100 && ! bfd_set_section_flags (abfd, sec,
2101 bfd_get_section_flags (abfd, sec)
2116 mmo_new_section_hook (abfd, newsect) in mmo_new_section_hook() argument
2117 bfd *abfd ATTRIBUTE_UNUSED; in mmo_new_section_hook()
2123 (PTR) bfd_zalloc (abfd, sizeof (struct mmo_section_data_struct));
2137 mmo_get_section_contents (abfd, sec, location, offset, bytes_to_do) in mmo_get_section_contents() argument
2138 bfd *abfd ATTRIBUTE_UNUSED; in mmo_get_section_contents()
2174 mmo_get_symtab_upper_bound (abfd) in mmo_get_symtab_upper_bound() argument
2175 bfd *abfd ATTRIBUTE_UNUSED; in mmo_get_symtab_upper_bound()
2177 return (abfd->symcount + 1) * sizeof (asymbol *);
2203 mmo_canonicalize_symtab (abfd, alocation) in mmo_canonicalize_symtab() argument
2204 bfd *abfd; in mmo_canonicalize_symtab()
2207 unsigned int symcount = bfd_get_symcount (abfd);
2211 csymbols = abfd->tdata.mmo_data->csymbols;
2222 for (s = abfd->tdata.mmo_data->symbols,
2233 csymbols = (asymbol *) bfd_alloc (abfd, symcount * sizeof (asymbol));
2236 abfd->tdata.mmo_data->csymbols = csymbols;
2243 c->the_bfd = abfd;
2251 = bfd_get_section_by_name (abfd, MMO_DATA_SECTION_NAME);
2263 = bfd_make_section_old_way (abfd, MMIX_REG_SECTION_NAME);
2268 = bfd_get_section_by_name (abfd, MMO_TEXT_SECTION_NAME);
2305 mmo_print_symbol (abfd, afile, symbol, how) in mmo_print_symbol() argument
2306 bfd *abfd; in mmo_print_symbol()
2319 bfd_print_symbol_vandf (abfd, (PTR) file, symbol);
2331 mmo_sizeof_headers (abfd, exec) in mmo_sizeof_headers() argument
2332 bfd *abfd ATTRIBUTE_UNUSED; in mmo_sizeof_headers()
2341 mmo_internal_write_header (abfd) in mmo_internal_write_header() argument
2342 bfd *abfd; in mmo_internal_write_header()
2346 if (bfd_bwrite (lop_pre_bfd, 4, abfd) != 4)
2350 if (bfd_bwrite (abfd->tdata.mmo_data->created, 4, abfd) != 4)
2362 mmo_internal_write_post (abfd, z, sec) in mmo_internal_write_post() argument
2363 bfd *abfd; in mmo_internal_write_post()
2369 mmo_write_tetra_raw (abfd, (LOP << 24) | (LOP_POST << 16) | z);
2375 if (bfd_bwrite (data, 8, abfd) != 8)
2382 bfd_put_64 (abfd, bfd_get_start_address (abfd), buf);
2384 return ! abfd->tdata.mmo_data->have_error && bfd_bwrite (buf, 8, abfd) == 8;
2449 mmo_internal_write_section (abfd, sec) in mmo_internal_write_section() argument
2450 bfd *abfd; in mmo_internal_write_section()
2467 return mmo_write_loc_chunk_list (abfd, mmo_section_data (sec)->head);
2469 return mmo_write_loc_chunk_list (abfd, mmo_section_data (sec)->head);
2482 mmo_write_tetra_raw (abfd, (LOP << 24) | (LOP_SPEC << 16) | n);
2483 return (! abfd->tdata.mmo_data->have_error
2484 && mmo_write_chunk_list (abfd, mmo_section_data (sec)->head));
2488 else if ((bfd_get_section_flags (abfd, sec) & SEC_HAS_CONTENTS) != 0
2584 mmo_write_tetra_raw (abfd, LOP_SPEC_SECTION);
2585 mmo_write_tetra (abfd, (strlen (sec->name) + 3) / 4);
2586 mmo_write_chunk (abfd, sec->name, strlen (sec->name));
2587 mmo_flush_chunk (abfd);
2592 mmo_write_tetra (abfd,
2594 (bfd_get_section_flags (abfd, sec)));
2595 mmo_write_octa (abfd, sec->_raw_size);
2596 mmo_write_octa (abfd, bfd_get_section_vma (abfd, sec));
2600 if (bfd_get_section_flags (abfd, sec) & SEC_LOAD)
2601 return (! abfd->tdata.mmo_data->have_error
2602 && mmo_write_loc_chunk_list (abfd,
2604 return (! abfd->tdata.mmo_data->have_error
2605 && mmo_write_chunk_list (abfd, mmo_section_data (sec)->head));
2613 mmo_set_section_contents (abfd, sec, location, offset, bytes_to_do) in mmo_set_section_contents() argument
2614 bfd *abfd ATTRIBUTE_UNUSED; in mmo_set_section_contents()
2649 mmo_internal_add_3_sym (abfd, rootp, symp) in mmo_internal_add_3_sym() argument
2650 bfd *abfd; in mmo_internal_add_3_sym()
2687 trie = bfd_zalloc (abfd, sizeof (struct mmo_symbol_trie));
2699 bfd_get_filename (abfd), trie->sym.name);
2711 mmo_internal_3_length (abfd, trie) in mmo_internal_3_length() argument
2712 bfd *abfd; in mmo_internal_3_length()
2722 length += mmo_internal_3_length (abfd, trie->left);
2725 length += 1 + mmo_internal_3_length (abfd, trie->middle);
2728 length += mmo_internal_3_length (abfd, trie->right);
2773 mmo_beb128_out (abfd, serno, marker) in mmo_beb128_out() argument
2774 bfd *abfd; in mmo_beb128_out()
2779 mmo_beb128_out (abfd, serno >> 7, 0);
2780 mmo_write_byte (abfd, marker | (serno & 0x7f));
2786 mmo_internal_3_dump (abfd, trie) in mmo_internal_3_dump() argument
2787 bfd *abfd; in mmo_internal_3_dump()
2832 mmo_write_byte (abfd, control);
2834 mmo_internal_3_dump (abfd, trie->left);
2838 mmo_write_byte (abfd, trie->symchar);
2843 mmo_write_byte (abfd, trie->sym.value);
2846 mmo_write_byte (abfd, 0);
2847 mmo_write_byte (abfd, 0);
2865 mmo_write_byte (abfd, (value >> ((byte_n - 1) * 8)) & 0xff);
2871 mmo_beb128_out (abfd, trie->sym.serno, 128);
2873 mmo_internal_3_dump (abfd, trie->middle);
2875 mmo_internal_3_dump (abfd, trie->right);
2881 mmo_write_symbols_and_terminator (abfd) in mmo_write_symbols_and_terminator() argument
2882 bfd *abfd; in mmo_write_symbols_and_terminator()
2884 int count = bfd_get_symcount (abfd);
2887 asymbol **orig_table = bfd_get_outsymbols (abfd);
2895 asymbol *fakemain = bfd_make_empty_symbol (abfd);
2898 fakemain->value = bfd_get_start_address (abfd);
2911 table = bfd_alloc (abfd, (count + 1) * sizeof (asymbol *));
2937 != bfd_get_start_address (abfd))
2943 bfd_vma vma_start = bfd_get_start_address (abfd);
2951 bfd_get_filename (abfd), vmas_main, vmas_start);
3015 if (! mmo_internal_add_3_sym (abfd, &root, &sym))
3029 trie_len = (mmo_internal_3_length (abfd, &root) + 3)/4;
3041 bfd_get_filename (abfd), trie_len);
3047 sym.value = bfd_get_start_address (abfd);
3056 if (! mmo_internal_add_3_sym (abfd, &root, &sym))
3064 trie_len = (mmo_internal_3_length (abfd, &root) + 3)/4;
3068 abfd->tdata.mmo_data->byte_no = 0;
3071 bfd_put_32 (abfd, (LOP << 24) | (LOP_STAB << 16), buf);
3072 if (bfd_bwrite (buf, 4, abfd) != 4)
3076 mmo_internal_3_dump (abfd, &root);
3078 if (trie_len != (abfd->tdata.mmo_data->byte_no + 3)/4)
3086 bfd_get_filename (abfd), trie_len,
3087 (abfd->tdata.mmo_data->byte_no + 3)/4);
3094 if ((abfd->tdata.mmo_data->byte_no % 4) != 0
3095 || abfd->tdata.mmo_data->have_error)
3097 memset (abfd->tdata.mmo_data->buf + (abfd->tdata.mmo_data->byte_no % 4),
3098 0, 4 - (abfd->tdata.mmo_data->byte_no % 4));
3100 if (abfd->tdata.mmo_data->have_error
3101 || bfd_bwrite (abfd->tdata.mmo_data->buf, 4, abfd) != 4)
3105 bfd_put_32 (abfd, (LOP << 24) | (LOP_END << 16) | trie_len, buf);
3106 return bfd_bwrite (buf, 4, abfd) == 4;
3114 mmo_write_section_unless_reg_contents (abfd, sec, p) in mmo_write_section_unless_reg_contents() argument
3115 bfd *abfd; in mmo_write_section_unless_reg_contents()
3133 if (bfd_get_section_flags (abfd, sec) & SEC_HAS_CONTENTS)
3141 bfd_get_filename (abfd), sec->name);
3150 infop->retval = mmo_internal_write_section (abfd, sec);
3157 mmo_write_object_contents (abfd) in mmo_write_object_contents() argument
3158 bfd *abfd; in mmo_write_object_contents()
3163 if (! mmo_internal_write_header (abfd))
3169 bfd_map_over_sections (abfd, mmo_write_section_unless_reg_contents,
3192 bfd_get_filename (abfd));
3198 bfd_get_filename (abfd),
3204 bfd_get_filename (abfd),
3211 if (! mmo_internal_write_post (abfd, z, sec))
3215 if (! mmo_internal_write_post (abfd, 255, NULL))
3218 return mmo_write_symbols_and_terminator (abfd);
3225 mmo_get_reloc_upper_bound (abfd, sec) in mmo_get_reloc_upper_bound() argument
3226 bfd *abfd ATTRIBUTE_UNUSED; in mmo_get_reloc_upper_bound()
3236 mmo_canonicalize_reloc (abfd, section, relptr, symbols) in mmo_canonicalize_reloc() argument
3237 bfd *abfd ATTRIBUTE_UNUSED; in mmo_canonicalize_reloc()