Lines Matching refs:fdef
430 def_file_free (def_file *fdef) in def_file_free() argument
434 if (!fdef) in def_file_free()
436 if (fdef->name) in def_file_free()
437 free (fdef->name); in def_file_free()
438 if (fdef->description) in def_file_free()
439 free (fdef->description); in def_file_free()
441 if (fdef->section_defs) in def_file_free()
443 for (i = 0; i < fdef->num_section_defs; i++) in def_file_free()
445 if (fdef->section_defs[i].name) in def_file_free()
446 free (fdef->section_defs[i].name); in def_file_free()
447 if (fdef->section_defs[i].class) in def_file_free()
448 free (fdef->section_defs[i].class); in def_file_free()
450 free (fdef->section_defs); in def_file_free()
453 if (fdef->exports) in def_file_free()
455 for (i = 0; i < fdef->num_exports; i++) in def_file_free()
457 if (fdef->exports[i].internal_name in def_file_free()
458 && fdef->exports[i].internal_name != fdef->exports[i].name) in def_file_free()
459 free (fdef->exports[i].internal_name); in def_file_free()
460 if (fdef->exports[i].name) in def_file_free()
461 free (fdef->exports[i].name); in def_file_free()
462 if (fdef->exports[i].its_name) in def_file_free()
463 free (fdef->exports[i].its_name); in def_file_free()
465 free (fdef->exports); in def_file_free()
468 if (fdef->imports) in def_file_free()
470 for (i = 0; i < fdef->num_imports; i++) in def_file_free()
472 if (fdef->imports[i].internal_name in def_file_free()
473 && fdef->imports[i].internal_name != fdef->imports[i].name) in def_file_free()
474 free (fdef->imports[i].internal_name); in def_file_free()
475 if (fdef->imports[i].name) in def_file_free()
476 free (fdef->imports[i].name); in def_file_free()
477 if (fdef->imports[i].its_name) in def_file_free()
478 free (fdef->imports[i].its_name); in def_file_free()
480 free (fdef->imports); in def_file_free()
483 while (fdef->modules) in def_file_free()
485 def_file_module *m = fdef->modules; in def_file_free()
487 fdef->modules = fdef->modules->next; in def_file_free()
491 while (fdef->aligncomms) in def_file_free()
493 def_file_aligncomm *c = fdef->aligncomms; in def_file_free()
495 fdef->aligncomms = fdef->aligncomms->next; in def_file_free()
500 free (fdef); in def_file_free()
505 def_file_print (FILE *file, def_file *fdef) in def_file_print() argument
509 fprintf (file, ">>>> def_file at 0x%08x\n", fdef); in def_file_print()
510 if (fdef->name) in def_file_print()
511 fprintf (file, " name: %s\n", fdef->name ? fdef->name : "(unspecified)"); in def_file_print()
512 if (fdef->is_dll != -1) in def_file_print()
513 fprintf (file, " is dll: %s\n", fdef->is_dll ? "yes" : "no"); in def_file_print()
514 if (fdef->base_address != (bfd_vma) -1) in def_file_print()
517 fprintf_vma (file, fdef->base_address); in def_file_print()
520 if (fdef->description) in def_file_print()
521 fprintf (file, " description: `%s'\n", fdef->description); in def_file_print()
522 if (fdef->stack_reserve != -1) in def_file_print()
523 fprintf (file, " stack reserve: 0x%08x\n", fdef->stack_reserve); in def_file_print()
524 if (fdef->stack_commit != -1) in def_file_print()
525 fprintf (file, " stack commit: 0x%08x\n", fdef->stack_commit); in def_file_print()
526 if (fdef->heap_reserve != -1) in def_file_print()
527 fprintf (file, " heap reserve: 0x%08x\n", fdef->heap_reserve); in def_file_print()
528 if (fdef->heap_commit != -1) in def_file_print()
529 fprintf (file, " heap commit: 0x%08x\n", fdef->heap_commit); in def_file_print()
531 if (fdef->num_section_defs > 0) in def_file_print()
535 for (i = 0; i < fdef->num_section_defs; i++) in def_file_print()
538 fdef->section_defs[i].name, fdef->section_defs[i].class); in def_file_print()
539 if (fdef->section_defs[i].flag_read) in def_file_print()
541 if (fdef->section_defs[i].flag_write) in def_file_print()
543 if (fdef->section_defs[i].flag_execute) in def_file_print()
545 if (fdef->section_defs[i].flag_shared) in def_file_print()
551 if (fdef->num_exports > 0) in def_file_print()
555 for (i = 0; i < fdef->num_exports; i++) in def_file_print()
558 fdef->exports[i].name, fdef->exports[i].internal_name, in def_file_print()
559 fdef->exports[i].ordinal); in def_file_print()
560 if (fdef->exports[i].flag_private) in def_file_print()
562 if (fdef->exports[i].flag_constant) in def_file_print()
564 if (fdef->exports[i].flag_noname) in def_file_print()
566 if (fdef->exports[i].flag_data) in def_file_print()
572 if (fdef->num_imports > 0) in def_file_print()
576 for (i = 0; i < fdef->num_imports; i++) in def_file_print()
579 fdef->imports[i].internal_name, in def_file_print()
580 fdef->imports[i].module, in def_file_print()
581 fdef->imports[i].name, in def_file_print()
582 fdef->imports[i].ordinal); in def_file_print()
586 if (fdef->version_major != -1) in def_file_print()
587 fprintf (file, " version: %d.%d\n", fdef->version_major, fdef->version_minor); in def_file_print()
589 fprintf (file, "<<<< def_file at 0x%08x\n", fdef); in def_file_print()
675 def_file_add_export (def_file *fdef, in def_file_add_export() argument
684 int max_exports = ROUND_UP(fdef->num_exports, 32); in def_file_add_export()
693 pos = find_export_in_list (fdef->exports, fdef->num_exports, in def_file_add_export()
698 return (fdef->exports + pos); in def_file_add_export()
700 if (fdef->num_exports >= max_exports) in def_file_add_export()
702 max_exports = ROUND_UP(fdef->num_exports + 1, 32); in def_file_add_export()
703 if (fdef->exports) in def_file_add_export()
704 fdef->exports = xrealloc (fdef->exports, in def_file_add_export()
707 fdef->exports = xmalloc (max_exports * sizeof (def_file_export)); in def_file_add_export()
710 e = fdef->exports + pos; in def_file_add_export()
711 if (pos != fdef->num_exports) in def_file_add_export()
712 memmove (&e[1], e, (sizeof (def_file_export) * (fdef->num_exports - pos))); in def_file_add_export()
718 fdef->num_exports++; in def_file_add_export()
723 def_get_module (def_file *fdef, const char *name) in def_get_module() argument
727 for (s = fdef->modules; s; s = s->next) in def_get_module()
735 def_stash_module (def_file *fdef, const char *name) in def_stash_module() argument
739 if ((s = def_get_module (fdef, name)) != NULL) in def_stash_module()
742 s->next = fdef->modules; in def_stash_module()
743 fdef->modules = s; in def_stash_module()
820 def_file_add_import (def_file *fdef, in def_file_add_import() argument
830 int max_imports = ROUND_UP (fdef->num_imports, 16); in def_file_add_import()
834 pos = find_import_in_list (fdef->imports, fdef->num_imports, in def_file_add_import()
839 return fdef->imports + pos; in def_file_add_import()
841 if (fdef->num_imports >= max_imports) in def_file_add_import()
843 max_imports = ROUND_UP (fdef->num_imports+1, 16); in def_file_add_import()
845 if (fdef->imports) in def_file_add_import()
846 fdef->imports = xrealloc (fdef->imports, in def_file_add_import()
849 fdef->imports = xmalloc (max_imports * sizeof (def_file_import)); in def_file_add_import()
851 i = fdef->imports + pos; in def_file_add_import()
852 if (pos != fdef->num_imports) in def_file_add_import()
853 memmove (&i[1], i, (sizeof (def_file_import) * (fdef->num_imports - pos))); in def_file_add_import()
858 i->module = def_stash_module (fdef, module); in def_file_add_import()
865 fdef->num_imports++; in def_file_add_import()