Lines Matching refs:stash
301 /* Section VMAs at the time the stash was built. */
418 struct dwarf2_debug *stash;
896 struct dwarf2_debug *stash = unit->stash;
911 if (! read_section (unit->abfd, &stash->debug_sections[debug_str],
930 struct dwarf2_debug *stash = unit->stash;
945 if (! read_section (unit->abfd, &stash->debug_sections[debug_line_str],
967 struct dwarf2_debug *stash = unit->stash;
981 if (stash->alt.bfd_ptr == NULL)
1000 stash->alt.bfd_ptr = debug_bfd;
1003 if (! read_section (unit->stash->alt.bfd_ptr,
1004 stash->debug_sections + debug_str_alt,
1005 stash->alt.syms, offset,
1006 &stash->alt.dwarf_str_buffer,
1007 &stash->alt.dwarf_str_size))
1010 str = (char *) stash->alt.dwarf_str_buffer + offset;
1024 struct dwarf2_debug *stash = unit->stash;
1026 if (stash->alt.bfd_ptr == NULL)
1045 stash->alt.bfd_ptr = debug_bfd;
1048 if (! read_section (unit->stash->alt.bfd_ptr,
1049 stash->debug_sections + debug_info_alt,
1050 stash->alt.syms, offset,
1051 &stash->alt.dwarf_info_buffer,
1052 &stash->alt.dwarf_info_size))
1055 return stash->alt.dwarf_info_buffer + offset;
1177 read_abbrevs (bfd *abfd, uint64_t offset, struct dwarf2_debug *stash,
1199 if (! read_section (abfd, &stash->debug_sections[debug_abbrev],
1404 struct dwarf2_debug *stash = unit->stash;
1409 if (stash == NULL)
1412 if (!read_section (unit->abfd, &stash->debug_sections[debug_addr],
1441 struct dwarf2_debug *stash = unit->stash;
1447 if (stash == NULL)
1450 if (!read_section (unit->abfd, &stash->debug_sections[debug_str],
1455 if (!read_section (unit->abfd, &stash->debug_sections[debug_str_offsets],
2713 struct dwarf2_debug *stash = unit->stash;
2728 if (! read_section (abfd, &stash->debug_sections[debug_line],
3193 struct dwarf2_debug *stash = unit->stash;
3196 return read_section (unit->abfd, &stash->debug_sections[debug_ranges],
3206 struct dwarf2_debug *stash = unit->stash;
3209 return read_section (unit->abfd, &stash->debug_sections[debug_rnglists],
3525 bool first_time = unit->stash->alt.dwarf_info_buffer == NULL;
3529 unit->stash->alt.info_ptr = unit->stash->alt.dwarf_info_buffer;
3538 info_ptr_end = (unit->stash->alt.dwarf_info_buffer
3539 + unit->stash->alt.dwarf_info_size);
3540 if (unit->stash->alt.all_comp_units)
3541 unit = unit->stash->alt.all_comp_units;
3563 u = stash_comp_unit (unit->stash, &unit->stash->f);
3574 u = stash_comp_unit (unit->stash, &unit->stash->alt);
4390 parse_comp_unit (struct dwarf2_debug *stash,
4493 abbrevs = read_abbrevs (abfd, abbrev_offset, stash, file);
4527 unit->stash = stash;
4717 unit->stash->inliner_chain = *function_ptr;
4796 comp_unit_hash_info (struct dwarf2_debug *stash,
4805 BFD_ASSERT (stash
4826 info in the stash. */
4846 info in the stash. */
4946 _bfd_dwarf2_stash_syms (struct dwarf2_debug *stash, bfd *abfd,
4949 if (stash->f.bfd_ptr != abfd)
4955 *syms = stash->f.syms;
4959 for (s = abfd->sections, d = stash->f.bfd_ptr->sections;
4969 *syms = stash->f.syms;
4976 /* Unset vmas for adjusted sections in STASH. */
4979 unset_sections (struct dwarf2_debug *stash)
4984 i = stash->adjusted_section_count;
4985 p = stash->adjusted_sections;
5001 place_sections (bfd *orig_bfd, struct dwarf2_debug *stash)
5008 if (stash->adjusted_section_count != 0)
5010 i = stash->adjusted_section_count;
5011 p = stash->adjusted_sections;
5017 debug_info_name = stash->debug_sections[debug_info].uncompressed_name;
5042 if (abfd == stash->f.bfd_ptr)
5044 abfd = stash->f.bfd_ptr;
5048 stash->adjusted_section_count = -1;
5058 stash->adjusted_sections = p;
5059 stash->adjusted_section_count = i;
5099 if (abfd == stash->f.bfd_ptr)
5101 abfd = stash->f.bfd_ptr;
5105 if (orig_bfd != stash->f.bfd_ptr)
5106 set_debug_vma (orig_bfd, stash->f.bfd_ptr);
5198 stash_maybe_update_info_hash_tables (struct dwarf2_debug *stash)
5203 if (stash->f.all_comp_units == stash->hash_units_head)
5206 if (stash->hash_units_head)
5207 each = stash->hash_units_head->prev_unit;
5209 each = stash->f.last_comp_unit;
5213 if (!comp_unit_hash_info (stash, each, stash->funcinfo_hash_table,
5214 stash->varinfo_hash_table))
5216 stash->info_hash_status = STASH_INFO_HASH_DISABLED;
5222 stash->hash_units_head = stash->f.all_comp_units;
5229 stash_verify_info_hash_table (struct dwarf2_debug *stash)
5237 for (each_unit = stash->f.all_comp_units;
5247 node = lookup_info_hash_table (stash->funcinfo_hash_table,
5265 node = lookup_info_hash_table (stash->varinfo_hash_table,
5285 stash_maybe_enable_info_hash_tables (bfd *abfd, struct dwarf2_debug *stash)
5287 BFD_ASSERT (stash->info_hash_status == STASH_INFO_HASH_OFF);
5289 if (stash->info_hash_count++ < STASH_INFO_HASH_TRIGGER)
5296 stash->funcinfo_hash_table = create_info_hash_table (abfd);
5297 stash->varinfo_hash_table = create_info_hash_table (abfd);
5298 if (!stash->funcinfo_hash_table || !stash->varinfo_hash_table)
5301 stash->info_hash_status = STASH_INFO_HASH_DISABLED;
5307 if (stash_maybe_update_info_hash_tables (stash))
5308 stash->info_hash_status = STASH_INFO_HASH_ON;
5312 info hash tables of a stash. If there is a match, the function returns
5317 stash_find_line_fast (struct dwarf2_debug *stash,
5323 BFD_ASSERT (stash->info_hash_status == STASH_INFO_HASH_ON);
5326 return info_hash_lookup_funcinfo (stash->funcinfo_hash_table, sym, addr,
5328 return info_hash_lookup_varinfo (stash->varinfo_hash_table, sym, addr,
5335 save_section_vma (const bfd *abfd, struct dwarf2_debug *stash)
5342 stash->sec_vma = bfd_malloc (sizeof (*stash->sec_vma) * abfd->section_count);
5343 if (stash->sec_vma == NULL)
5345 stash->sec_vma_count = abfd->section_count;
5351 stash->sec_vma[i] = s->output_section->vma + s->output_offset;
5353 stash->sec_vma[i] = s->vma;
5358 /* Compare current section VMAs against those at the time the stash
5360 errors early in the link process, the debug info stash will be
5366 section_vma_same (const bfd *abfd, const struct dwarf2_debug *stash)
5372 when the stash was created and now, then we cannot trust the
5374 if (abfd->section_count != stash->sec_vma_count)
5387 if (vma != stash->sec_vma[i])
5407 struct dwarf2_debug *stash = (struct dwarf2_debug *) *pinfo;
5409 if (stash != NULL)
5411 if (stash->orig_bfd_id == abfd->id
5412 && section_vma_same (abfd, stash))
5416 if (stash->f.dwarf_info_size != 0)
5418 if (do_place && !place_sections (abfd, stash))
5426 memset (stash, 0, sizeof (*stash));
5430 stash = (struct dwarf2_debug *) bfd_zalloc (abfd, sizeof (*stash));
5431 if (! stash)
5433 *pinfo = stash;
5435 stash->orig_bfd_id = abfd->id;
5436 stash->debug_sections = debug_sections;
5437 stash->f.syms = symbols;
5438 if (!save_section_vma (abfd, stash))
5441 stash->f.abbrev_offsets = htab_create_alloc (10, hash_abbrev, eq_abbrev,
5443 if (!stash->f.abbrev_offsets)
5446 stash->alt.abbrev_offsets = htab_create_alloc (10, hash_abbrev, eq_abbrev,
5448 if (!stash->alt.abbrev_offsets)
5451 stash->f.trie_root = alloc_trie_leaf (abfd);
5452 if (!stash->f.trie_root)
5455 stash->alt.trie_root = alloc_trie_leaf (abfd);
5456 if (!stash->alt.trie_root)
5473 Note that at this point the stash has been allocated, but
5496 stash->f.syms = symbols;
5497 stash->close_on_cleanup = true;
5499 stash->f.bfd_ptr = debug_bfd;
5502 && !place_sections (abfd, stash))
5508 one large stash. We do this in two passes - in the first pass we
5511 reallocing the data as we add sections to the stash.) */
5517 if (! read_section (debug_bfd, &stash->debug_sections[debug_info],
5519 &stash->f.dwarf_info_buffer, &total_size))
5541 stash->f.dwarf_info_buffer = (bfd_byte *) bfd_malloc (total_size);
5542 if (stash->f.dwarf_info_buffer == NULL)
5555 (debug_bfd, msec, stash->f.dwarf_info_buffer + total_size,
5563 stash->f.info_ptr = stash->f.dwarf_info_buffer;
5564 stash->f.dwarf_info_size = total_size;
5568 unset_sections (stash);
5575 stash_comp_unit (struct dwarf2_debug *stash, struct dwarf2_debug_file *file)
5616 struct comp_unit *each = parse_comp_unit (stash, file,
5689 struct dwarf2_debug *stash;
5695 stash = (struct dwarf2_debug *) *pinfo;
5697 if (stash == NULL || symbols == NULL)
5713 for (unit = stash->f.all_comp_units; unit; unit = unit->next_unit)
5802 struct dwarf2_debug *stash;
5822 stash = (struct dwarf2_debug *) *pinfo;
5824 if (stash->alt.bfd_ptr == NULL && alt_filename != NULL)
5838 stash->alt.bfd_ptr = alt_bfd;
5892 (or that an error occured while setting up the stash). */
5893 if (! stash->f.info_ptr)
5896 stash->inliner_chain = NULL;
5904 if (stash->info_hash_status == STASH_INFO_HASH_OFF)
5905 stash_maybe_enable_info_hash_tables (abfd, stash);
5909 if (stash->info_hash_status == STASH_INFO_HASH_ON)
5910 stash_maybe_update_info_hash_tables (stash);
5912 if (stash->info_hash_status == STASH_INFO_HASH_ON)
5914 found = stash_find_line_fast (stash, symbol, addr,
5921 stash->f.all_comp_units; each; each = each->next_unit)
5933 struct trie_node *trie = stash->f.trie_root;
5975 prev_each = &stash->f.all_comp_units_without_ranges;
5996 while ((each = stash_comp_unit (stash, &stash->f)) != NULL)
6035 _bfd_dwarf2_stash_syms (stash, abfd, &sec, &syms);
6060 unset_sections (stash);
6072 struct dwarf2_debug *stash;
6074 stash = (struct dwarf2_debug *) *pinfo;
6075 if (stash)
6077 struct funcinfo *func = stash->inliner_chain;
6084 stash->inliner_chain = func->caller_func;
6095 struct dwarf2_debug *stash = (struct dwarf2_debug *) *pinfo;
6099 if (abfd == NULL || stash == NULL)
6102 if (stash->varinfo_hash_table)
6103 bfd_hash_table_free (&stash->varinfo_hash_table->base);
6104 if (stash->funcinfo_hash_table)
6105 bfd_hash_table_free (&stash->funcinfo_hash_table->base);
6107 file = &stash->f;
6159 if (file == &stash->alt)
6161 file = &stash->alt;
6163 free (stash->sec_vma);
6164 free (stash->adjusted_sections);
6165 if (stash->close_on_cleanup)
6166 bfd_close (stash->f.bfd_ptr);
6167 if (stash->alt.bfd_ptr)
6168 bfd_close (stash->alt.bfd_ptr);