Lines Matching refs:vars

406 #define SIZEOF_ILF_SYMS		 (NUM_ILF_SYMS * sizeof (* vars.sym_cache))
407 #define SIZEOF_ILF_SYM_TABLE (NUM_ILF_SYMS * sizeof (* vars.sym_table))
408 #define SIZEOF_ILF_NATIVE_SYMS (NUM_ILF_SYMS * sizeof (* vars.native_syms))
409 #define SIZEOF_ILF_SYM_PTR_TABLE (NUM_ILF_SYMS * sizeof (* vars.sym_ptr_table))
410 #define SIZEOF_ILF_EXT_SYMS (NUM_ILF_SYMS * sizeof (* vars.esym_table))
411 #define SIZEOF_ILF_RELOCS (NUM_ILF_RELOCS * sizeof (* vars.reltab))
412 #define SIZEOF_ILF_INT_RELOCS (NUM_ILF_RELOCS * sizeof (* vars.int_reltab))
452 pe_ILF_make_a_symbol_reloc (pe_ILF_vars * vars, in pe_ILF_make_a_symbol_reloc() argument
461 entry = vars->reltab + vars->relcount; in pe_ILF_make_a_symbol_reloc()
462 internal = vars->int_reltab + vars->relcount; in pe_ILF_make_a_symbol_reloc()
466 entry->howto = bfd_reloc_type_lookup (vars->abfd, reloc); in pe_ILF_make_a_symbol_reloc()
473 vars->relcount ++; in pe_ILF_make_a_symbol_reloc()
475 BFD_ASSERT (vars->relcount <= NUM_ILF_RELOCS); in pe_ILF_make_a_symbol_reloc()
481 pe_ILF_make_a_reloc (pe_ILF_vars * vars, in pe_ILF_make_a_reloc() argument
486 pe_ILF_make_a_symbol_reloc (vars, address, reloc, sec->symbol_ptr_ptr, in pe_ILF_make_a_reloc()
487 coff_section_data (vars->abfd, sec)->i); in pe_ILF_make_a_reloc()
493 pe_ILF_save_relocs (pe_ILF_vars * vars, in pe_ILF_save_relocs() argument
497 if (coff_section_data (vars->abfd, sec) == NULL) in pe_ILF_save_relocs()
501 coff_section_data (vars->abfd, sec)->relocs = vars->int_reltab; in pe_ILF_save_relocs()
502 coff_section_data (vars->abfd, sec)->keep_relocs = TRUE; in pe_ILF_save_relocs()
504 sec->relocation = vars->reltab; in pe_ILF_save_relocs()
505 sec->reloc_count = vars->relcount; in pe_ILF_save_relocs()
508 vars->reltab += vars->relcount; in pe_ILF_save_relocs()
509 vars->int_reltab += vars->relcount; in pe_ILF_save_relocs()
510 vars->relcount = 0; in pe_ILF_save_relocs()
512 BFD_ASSERT ((bfd_byte *) vars->int_reltab < (bfd_byte *) vars->string_table); in pe_ILF_save_relocs()
518 pe_ILF_make_a_symbol (pe_ILF_vars * vars, in pe_ILF_make_a_symbol() argument
535 if (vars->magic == THUMBPEMAGIC) in pe_ILF_make_a_symbol()
546 BFD_ASSERT (vars->sym_index < NUM_ILF_SYMS); in pe_ILF_make_a_symbol()
548 sym = vars->sym_ptr; in pe_ILF_make_a_symbol()
549 ent = vars->native_ptr; in pe_ILF_make_a_symbol()
550 esym = vars->esym_ptr; in pe_ILF_make_a_symbol()
553 sprintf (vars->string_ptr, "%s%s", prefix, symbol_name); in pe_ILF_make_a_symbol()
559 H_PUT_32 (vars->abfd, vars->string_ptr - vars->string_table, in pe_ILF_make_a_symbol()
561 H_PUT_16 (vars->abfd, section->target_index, esym->e_scnum); in pe_ILF_make_a_symbol()
573 sym->symbol.the_bfd = vars->abfd; in pe_ILF_make_a_symbol()
574 sym->symbol.name = vars->string_ptr; in pe_ILF_make_a_symbol()
579 * vars->table_ptr = vars->sym_index; in pe_ILF_make_a_symbol()
580 * vars->sym_ptr_ptr = sym; in pe_ILF_make_a_symbol()
583 vars->sym_index ++; in pe_ILF_make_a_symbol()
584 vars->sym_ptr ++; in pe_ILF_make_a_symbol()
585 vars->sym_ptr_ptr ++; in pe_ILF_make_a_symbol()
586 vars->table_ptr ++; in pe_ILF_make_a_symbol()
587 vars->native_ptr ++; in pe_ILF_make_a_symbol()
588 vars->esym_ptr ++; in pe_ILF_make_a_symbol()
589 vars->string_ptr += strlen (symbol_name) + strlen (prefix) + 1; in pe_ILF_make_a_symbol()
591 BFD_ASSERT (vars->string_ptr < vars->end_string_ptr); in pe_ILF_make_a_symbol()
597 pe_ILF_make_a_section (pe_ILF_vars * vars, in pe_ILF_make_a_section() argument
605 sec = bfd_make_section_old_way (vars->abfd, name); in pe_ILF_make_a_section()
611 bfd_set_section_flags (vars->abfd, sec, flags | extra_flags); in pe_ILF_make_a_section()
613 (void) bfd_set_section_alignment (vars->abfd, sec, 2); in pe_ILF_make_a_section()
616 BFD_ASSERT (vars->data + size < vars->bim->buffer + vars->bim->size); in pe_ILF_make_a_section()
620 bfd_set_section_size (vars->abfd, sec, (bfd_size_type) size); in pe_ILF_make_a_section()
621 sec->contents = vars->data; in pe_ILF_make_a_section()
622 sec->target_index = vars->sec_index ++; in pe_ILF_make_a_section()
625 vars->data += size; in pe_ILF_make_a_section()
632 vars->data --; in pe_ILF_make_a_section()
635 sec->used_by_bfd = (struct coff_section_tdata *) vars->data; in pe_ILF_make_a_section()
636 vars->data += sizeof (struct coff_section_tdata); in pe_ILF_make_a_section()
638 BFD_ASSERT (vars->data <= vars->bim->buffer + vars->bim->size); in pe_ILF_make_a_section()
641 pe_ILF_make_a_symbol (vars, "", name, sec, BSF_LOCAL); in pe_ILF_make_a_section()
644 coff_section_data (vars->abfd, sec)->i = vars->sym_index - 1; in pe_ILF_make_a_section()
740 pe_ILF_vars vars; in pe_ILF_build_a_bfd() local
791 vars.bim in pe_ILF_build_a_bfd()
792 = (struct bfd_in_memory *) bfd_malloc ((bfd_size_type) sizeof (*vars.bim)); in pe_ILF_build_a_bfd()
793 if (vars.bim == NULL) in pe_ILF_build_a_bfd()
797 vars.bim->buffer = ptr; in pe_ILF_build_a_bfd()
798 vars.bim->size = ILF_DATA_SIZE; in pe_ILF_build_a_bfd()
804 vars.sym_cache = (coff_symbol_type *) ptr; in pe_ILF_build_a_bfd()
805 vars.sym_ptr = (coff_symbol_type *) ptr; in pe_ILF_build_a_bfd()
806 vars.sym_index = 0; in pe_ILF_build_a_bfd()
809 vars.sym_table = (unsigned int *) ptr; in pe_ILF_build_a_bfd()
810 vars.table_ptr = (unsigned int *) ptr; in pe_ILF_build_a_bfd()
813 vars.native_syms = (combined_entry_type *) ptr; in pe_ILF_build_a_bfd()
814 vars.native_ptr = (combined_entry_type *) ptr; in pe_ILF_build_a_bfd()
817 vars.sym_ptr_table = (coff_symbol_type **) ptr; in pe_ILF_build_a_bfd()
818 vars.sym_ptr_ptr = (coff_symbol_type **) ptr; in pe_ILF_build_a_bfd()
821 vars.esym_table = (SYMENT *) ptr; in pe_ILF_build_a_bfd()
822 vars.esym_ptr = (SYMENT *) ptr; in pe_ILF_build_a_bfd()
825 vars.reltab = (arelent *) ptr; in pe_ILF_build_a_bfd()
826 vars.relcount = 0; in pe_ILF_build_a_bfd()
829 vars.int_reltab = (struct internal_reloc *) ptr; in pe_ILF_build_a_bfd()
832 vars.string_table = (char *) ptr; in pe_ILF_build_a_bfd()
833 vars.string_ptr = (char *) ptr + STRING_SIZE_SIZE; in pe_ILF_build_a_bfd()
835 vars.end_string_ptr = (char *) ptr; in pe_ILF_build_a_bfd()
839 vars.data = ptr; in pe_ILF_build_a_bfd()
840 vars.abfd = abfd; in pe_ILF_build_a_bfd()
841 vars.sec_index = 0; in pe_ILF_build_a_bfd()
842 vars.magic = magic; in pe_ILF_build_a_bfd()
851 id4 = pe_ILF_make_a_section (& vars, ".idata$4", SIZEOF_IDATA4, 0); in pe_ILF_build_a_bfd()
852 id5 = pe_ILF_make_a_section (& vars, ".idata$5", SIZEOF_IDATA5, 0); in pe_ILF_build_a_bfd()
879 id6 = pe_ILF_make_a_section (& vars, ".idata$6", SIZEOF_IDATA6, 0); in pe_ILF_build_a_bfd()
923 pe_ILF_make_a_reloc (&vars, (bfd_vma) 0, BFD_RELOC_RVA, id6); in pe_ILF_build_a_bfd()
924 pe_ILF_save_relocs (&vars, id4); in pe_ILF_build_a_bfd()
926 pe_ILF_make_a_reloc (&vars, (bfd_vma) 0, BFD_RELOC_RVA, id6); in pe_ILF_build_a_bfd()
927 pe_ILF_save_relocs (&vars, id5); in pe_ILF_build_a_bfd()
950 text = pe_ILF_make_a_section (& vars, ".text", jtab[i].size, SEC_CODE); in pe_ILF_build_a_bfd()
958 pe_ILF_make_a_symbol (& vars, "__imp_", symbol_name, id5, 0); in pe_ILF_build_a_bfd()
959 imp_sym = vars.sym_ptr_ptr - 1; in pe_ILF_build_a_bfd()
960 imp_index = vars.sym_index - 1; in pe_ILF_build_a_bfd()
966 pe_ILF_make_a_symbol_reloc (&vars, (bfd_vma) 0, BFD_RELOC_HI16_S, in pe_ILF_build_a_bfd()
969 pe_ILF_make_a_reloc (&vars, (bfd_vma) 0, BFD_RELOC_LO16, text); in pe_ILF_build_a_bfd()
970 pe_ILF_make_a_symbol_reloc (&vars, (bfd_vma) 4, BFD_RELOC_LO16, in pe_ILF_build_a_bfd()
976 pe_ILF_make_a_symbol_reloc (&vars, (bfd_vma) jtab[i].offset, in pe_ILF_build_a_bfd()
980 pe_ILF_save_relocs (& vars, text); in pe_ILF_build_a_bfd()
1008 if (vars.magic == THUMBPEMAGIC) in pe_ILF_build_a_bfd()
1016 abfd->iostream = (void *) vars.bim; in pe_ILF_build_a_bfd()
1027 pe_ILF_make_a_symbol (& vars, "", symbol_name, text, in pe_ILF_build_a_bfd()
1035 pe_ILF_make_a_symbol (& vars, "__IMPORT_DESCRIPTOR_", source_dll, NULL, 0); in pe_ILF_build_a_bfd()
1050 obj_symbols (abfd) = vars.sym_cache; in pe_ILF_build_a_bfd()
1051 bfd_get_symcount (abfd) = vars.sym_index; in pe_ILF_build_a_bfd()
1053 obj_raw_syments (abfd) = vars.native_syms; in pe_ILF_build_a_bfd()
1054 obj_raw_syment_count (abfd) = vars.sym_index; in pe_ILF_build_a_bfd()
1056 obj_coff_external_syms (abfd) = (void *) vars.esym_table; in pe_ILF_build_a_bfd()
1059 obj_convert (abfd) = vars.sym_table; in pe_ILF_build_a_bfd()
1060 obj_conv_table_size (abfd) = vars.sym_index; in pe_ILF_build_a_bfd()
1062 obj_coff_strings (abfd) = vars.string_table; in pe_ILF_build_a_bfd()
1070 if (vars.bim->buffer != NULL) in pe_ILF_build_a_bfd()
1071 free (vars.bim->buffer); in pe_ILF_build_a_bfd()
1072 free (vars.bim); in pe_ILF_build_a_bfd()