Home | History | Annotate | Download | only in bfd

Lines Matching refs:vars

408 #define SIZEOF_ILF_SYMS		 (NUM_ILF_SYMS * sizeof (* vars.sym_cache))
409 #define SIZEOF_ILF_SYM_TABLE (NUM_ILF_SYMS * sizeof (* vars.sym_table))
410 #define SIZEOF_ILF_NATIVE_SYMS (NUM_ILF_SYMS * sizeof (* vars.native_syms))
411 #define SIZEOF_ILF_SYM_PTR_TABLE (NUM_ILF_SYMS * sizeof (* vars.sym_ptr_table))
412 #define SIZEOF_ILF_EXT_SYMS (NUM_ILF_SYMS * sizeof (* vars.esym_table))
413 #define SIZEOF_ILF_RELOCS (NUM_ILF_RELOCS * sizeof (* vars.reltab))
414 #define SIZEOF_ILF_INT_RELOCS (NUM_ILF_RELOCS * sizeof (* vars.int_reltab))
454 pe_ILF_make_a_symbol_reloc (pe_ILF_vars * vars,
463 entry = vars->reltab + vars->relcount;
464 internal = vars->int_reltab + vars->relcount;
468 entry->howto = bfd_reloc_type_lookup (vars->abfd, reloc);
475 vars->relcount ++;
477 BFD_ASSERT (vars->relcount <= NUM_ILF_RELOCS);
483 pe_ILF_make_a_reloc (pe_ILF_vars * vars,
488 pe_ILF_make_a_symbol_reloc (vars, address, reloc, sec->symbol_ptr_ptr,
489 coff_section_data (vars->abfd, sec)->i);
495 pe_ILF_save_relocs (pe_ILF_vars * vars,
499 if (coff_section_data (vars->abfd, sec) == NULL)
503 coff_section_data (vars->abfd, sec)->relocs = vars->int_reltab;
504 coff_section_data (vars->abfd, sec)->keep_relocs = TRUE;
506 sec->relocation = vars->reltab;
507 sec->reloc_count = vars->relcount;
510 vars->reltab += vars->relcount;
511 vars->int_reltab += vars->relcount;
512 vars->relcount = 0;
514 BFD_ASSERT ((bfd_byte *) vars->int_reltab < (bfd_byte *) vars->string_table);
520 pe_ILF_make_a_symbol (pe_ILF_vars * vars,
537 if (vars->magic == THUMBPEMAGIC)
548 BFD_ASSERT (vars->sym_index < NUM_ILF_SYMS);
550 sym = vars->sym_ptr;
551 ent = vars->native_ptr;
552 esym = vars->esym_ptr;
555 sprintf (vars->string_ptr, "%s%s", prefix, symbol_name);
561 H_PUT_32 (vars->abfd, vars->string_ptr - vars->string_table,
563 H_PUT_16 (vars->abfd, section->target_index, esym->e_scnum);
575 sym->symbol.the_bfd = vars->abfd;
576 sym->symbol.name = vars->string_ptr;
581 * vars->table_ptr = vars->sym_index;
582 * vars->sym_ptr_ptr = sym;
585 vars->sym_index ++;
586 vars->sym_ptr ++;
587 vars->sym_ptr_ptr ++;
588 vars->table_ptr ++;
589 vars->native_ptr ++;
590 vars->esym_ptr ++;
591 vars->string_ptr += strlen (symbol_name) + strlen (prefix) + 1;
593 BFD_ASSERT (vars->string_ptr < vars->end_string_ptr);
599 pe_ILF_make_a_section (pe_ILF_vars * vars,
607 sec = bfd_make_section_old_way (vars->abfd, name);
613 bfd_set_section_flags (vars->abfd, sec, flags | extra_flags);
615 (void) bfd_set_section_alignment (vars->abfd, sec, 2);
618 BFD_ASSERT (vars->data + size < vars->bim->buffer + vars->bim->size);
622 bfd_set_section_size (vars->abfd, sec, (bfd_size_type) size);
623 sec->contents = vars->data;
624 sec->target_index = vars->sec_index ++;
626 /* Advance data pointer in the vars structure. */
627 vars->data += size;
634 vars->data --;
637 sec->used_by_bfd = (struct coff_section_tdata *) vars->data;
638 vars->data += sizeof (struct coff_section_tdata);
640 BFD_ASSERT (vars->data <= vars->bim->buffer + vars->bim->size);
643 pe_ILF_make_a_symbol (vars, "", name, sec, BSF_LOCAL);
646 coff_section_data (vars->abfd, sec)->i = vars->sym_index - 1;
742 pe_ILF_vars vars;
793 vars.bim
794 = (struct bfd_in_memory *) bfd_malloc ((bfd_size_type) sizeof (*vars.bim));
795 if (vars.bim == NULL)
799 vars.bim->buffer = ptr;
800 vars.bim->size = ILF_DATA_SIZE;
806 vars.sym_cache = (coff_symbol_type *) ptr;
807 vars.sym_ptr = (coff_symbol_type *) ptr;
808 vars.sym_index = 0;
811 vars.sym_table = (unsigned int *) ptr;
812 vars.table_ptr = (unsigned int *) ptr;
815 vars.native_syms = (combined_entry_type *) ptr;
816 vars.native_ptr = (combined_entry_type *) ptr;
819 vars.sym_ptr_table = (coff_symbol_type **) ptr;
820 vars.sym_ptr_ptr = (coff_symbol_type **) ptr;
823 vars.esym_table = (SYMENT *) ptr;
824 vars.esym_ptr = (SYMENT *) ptr;
827 vars.reltab = (arelent *) ptr;
828 vars.relcount = 0;
831 vars.int_reltab = (struct internal_reloc *) ptr;
834 vars.string_table = (char *) ptr;
835 vars.string_ptr = (char *) ptr + STRING_SIZE_SIZE;
837 vars.end_string_ptr = (char *) ptr;
841 vars.data = ptr;
842 vars.abfd = abfd;
843 vars.sec_index = 0;
844 vars.magic = magic;
853 id4 = pe_ILF_make_a_section (& vars, ".idata$4", SIZEOF_IDATA4, 0);
854 id5 = pe_ILF_make_a_section (& vars, ".idata$5", SIZEOF_IDATA5, 0);
881 id6 = pe_ILF_make_a_section (& vars, ".idata$6", SIZEOF_IDATA6, 0);
925 pe_ILF_make_a_reloc (&vars, (bfd_vma) 0, BFD_RELOC_RVA, id6);
926 pe_ILF_save_relocs (&vars, id4);
928 pe_ILF_make_a_reloc (&vars, (bfd_vma) 0, BFD_RELOC_RVA, id6);
929 pe_ILF_save_relocs (&vars, id5);
952 text = pe_ILF_make_a_section (& vars, ".text", jtab[i].size, SEC_CODE);
960 pe_ILF_make_a_symbol (& vars, "__imp_", symbol_name, id5, 0);
961 imp_sym = vars.sym_ptr_ptr - 1;
962 imp_index = vars.sym_index - 1;
968 pe_ILF_make_a_symbol_reloc (&vars, (bfd_vma) 0, BFD_RELOC_HI16_S,
971 pe_ILF_make_a_reloc (&vars, (bfd_vma) 0, BFD_RELOC_LO16, text);
972 pe_ILF_make_a_symbol_reloc (&vars, (bfd_vma) 4, BFD_RELOC_LO16,
978 pe_ILF_make_a_symbol_reloc (&vars, (bfd_vma) jtab[i].offset,
982 pe_ILF_save_relocs (& vars, text);
1010 if (vars.magic == THUMBPEMAGIC)
1018 abfd->iostream = (void *) vars.bim;
1029 pe_ILF_make_a_symbol (& vars, "", symbol_name, text,
1037 pe_ILF_make_a_symbol (& vars, "__IMPORT_DESCRIPTOR_", source_dll, NULL, 0);
1052 obj_symbols (abfd) = vars.sym_cache;
1053 bfd_get_symcount (abfd) = vars.sym_index;
1055 obj_raw_syments (abfd) = vars.native_syms;
1056 obj_raw_syment_count (abfd) = vars.sym_index;
1058 obj_coff_external_syms (abfd) = (void *) vars.esym_table;
1061 obj_convert (abfd) = vars.sym_table;
1062 obj_conv_table_size (abfd) = vars.sym_index;
1064 obj_coff_strings (abfd) = vars.string_table;
1072 if (vars.bim->buffer != NULL)
1073 free (vars.bim->buffer);
1074 free (vars.bim);