Lines Matching refs:statep
45 elf_i386_open_outfile (struct ld_state *statep, in elf_i386_open_outfile() argument
52 return old_open_outfile (statep, EM_386, ELFCLASS32, ELFDATA2LSB); in elf_i386_open_outfile()
59 elf_i386_relocate_section (struct ld_state *statep __attribute__ ((unused)), in elf_i386_relocate_section() argument
189 elf_i386_initialize_plt (struct ld_state *statep, Elf_Scn *scn) in elf_i386_initialize_plt() argument
207 data->d_size = (1 + statep->nplt) * PLT_ENTRY_SIZE; in elf_i386_initialize_plt()
213 statep->nplt_used = 1; in elf_i386_initialize_plt()
218 elf_i386_initialize_pltrel (struct ld_state *statep, Elf_Scn *scn) in elf_i386_initialize_pltrel() argument
228 size_t size = statep->nplt * sizeof (Elf32_Rel); in elf_i386_initialize_pltrel()
238 elf_i386_initialize_got (struct ld_state *statep, Elf_Scn *scn) in elf_i386_initialize_got() argument
241 assert (statep->ngot != 0); in elf_i386_initialize_got()
249 size_t size = statep->ngot * sizeof (Elf32_Addr); in elf_i386_initialize_got()
259 elf_i386_initialize_gotplt (struct ld_state *statep, Elf_Scn *scn) in elf_i386_initialize_gotplt() argument
262 assert (statep->nplt != 0); in elf_i386_initialize_gotplt()
273 size_t size = (3 + statep->nplt) * sizeof (Elf32_Addr); in elf_i386_initialize_gotplt()
354 elf_i386_finalize_plt (struct ld_state *statep, size_t nsym, in elf_i386_finalize_plt() argument
357 if (unlikely (statep->nplt + statep->ngot == 0)) in elf_i386_finalize_plt()
364 const bool build_dso = statep->file_type == dso_file_type; in elf_i386_finalize_plt()
367 scn = elf_getscn (statep->outelf, statep->gotpltscnidx); in elf_i386_finalize_plt()
380 xelf_getshdr (elf_getscn (statep->outelf, statep->dynamicscnidx), shdr); in elf_i386_finalize_plt()
386 scn = elf_getscn (statep->outelf, statep->pltscnidx); in elf_i386_finalize_plt()
391 Elf_Data *dynsymdata = elf_getdata (elf_getscn (statep->outelf, in elf_i386_finalize_plt()
392 statep->dynsymscnidx), NULL); in elf_i386_finalize_plt()
396 if (statep->symscnidx != 0) in elf_i386_finalize_plt()
398 symdata = elf_getdata (elf_getscn (statep->outelf, statep->symscnidx), in elf_i386_finalize_plt()
404 scn = elf_getscn (statep->outelf, statep->pltscnidx); in elf_i386_finalize_plt()
411 scn = elf_getscn (statep->outelf, statep->pltrelscnidx); in elf_i386_finalize_plt()
421 shdr->sh_link = statep->dynsymscnidx; in elf_i386_finalize_plt()
422 shdr->sh_info = statep->gotpltscnidx; in elf_i386_finalize_plt()
478 assert(nsym - statep->nplt + (pltidx - 1) == idx); in elf_i386_finalize_plt()
479 ((Elf32_Sym *) symdata->d_buf)[nsym - statep->nplt in elf_i386_finalize_plt()
515 elf_i386_rel_type (struct ld_state *statep __attribute__ ((__unused__))) in elf_i386_rel_type() argument
523 elf_i386_count_relocations (struct ld_state *statep, struct scninfo *scninfo) in elf_i386_count_relocations() argument
559 || statep->file_type == dso_file_type) in elf_i386_count_relocations()
562 ++statep->nrel_got; in elf_i386_count_relocations()
567 ++statep->ngot; in elf_i386_count_relocations()
573 statep->need_got = true; in elf_i386_count_relocations()
581 if (statep->file_type == dso_file_type) in elf_i386_count_relocations()
586 statep->dt_flags |= DF_TEXTREL; in elf_i386_count_relocations()
599 ++statep->ncopy; in elf_i386_count_relocations()
604 else if (statep->file_type == dso_file_type in elf_i386_count_relocations()
621 && !statep->statically) in elf_i386_count_relocations()
629 --statep->nunresolved; in elf_i386_count_relocations()
631 --statep->nunresolved_nonweak; in elf_i386_count_relocations()
632 CDBL_LIST_DEL (statep->unresolved, sym); in elf_i386_count_relocations()
635 ++statep->nplt; in elf_i386_count_relocations()
636 ++statep->nfrom_dso; in elf_i386_count_relocations()
637 CDBL_LIST_ADD_REAR (statep->from_dso, sym); in elf_i386_count_relocations()
642 if (statep->file_type != executable_file_type) in elf_i386_count_relocations()
652 if (statep->file_type == dso_file_type) in elf_i386_count_relocations()
662 if (statep->file_type != executable_file_type in elf_i386_count_relocations()
711 elf_i386_create_relocations (struct ld_state *statep, in elf_i386_create_relocations() argument
715 Elf_Scn *pltscn = elf_getscn (statep->outelf, statep->pltscnidx); in elf_i386_create_relocations()
720 Elf_Scn *gotscn = elf_getscn (statep->outelf, statep->gotscnidx); in elf_i386_create_relocations()
723 if (statep->need_got) in elf_i386_create_relocations()
729 Elf_Scn *gotpltscn = elf_getscn (statep->outelf, statep->gotpltscnidx); in elf_i386_create_relocations()
734 Elf_Scn *reldynscn = elf_getscn (statep->outelf, statep->reldynscnidx); in elf_i386_create_relocations()
739 size_t ngotconst = statep->nrel_got; in elf_i386_create_relocations()
741 struct scninfo *first = statep->rellist->next; in elf_i386_create_relocations()
822 && statep->file_type != dso_file_type in elf_i386_create_relocations()
842 assert (nreldyn <= statep->nrel_got); in elf_i386_create_relocations()
847 Elf_Scn *symscn = elf_getscn (statep->outelf, in elf_i386_create_relocations()
848 statep->dynsymscnidx); in elf_i386_create_relocations()
854 sym->st_shndx = statep->copy_section->outscnndx; in elf_i386_create_relocations()
860 symidx = statep->dblindirect[symidx]; in elf_i386_create_relocations()
861 symscn = elf_getscn (statep->outelf, in elf_i386_create_relocations()
862 statep->symscnidx); in elf_i386_create_relocations()
867 sym->st_shndx = statep->copy_section->outscnndx; in elf_i386_create_relocations()
875 else if (statep->file_type == dso_file_type in elf_i386_create_relocations()
895 assert (nreldyn <= statep->nrel_got); in elf_i386_create_relocations()
906 assert (thisgotidx < statep->nrel_got); in elf_i386_create_relocations()
914 rel2->r_offset = gotaddr + ((thisgotidx - statep->ngot) in elf_i386_create_relocations()
920 else if (statep->file_type != dso_file_type) in elf_i386_create_relocations()
923 assert (thisgotidx < statep->ngot); in elf_i386_create_relocations()
933 assert (thisgotidx < statep->nrel_got); in elf_i386_create_relocations()
940 (thisgotidx - statep->ngot) in elf_i386_create_relocations()
1079 elf_i386_ld_init (struct ld_state *statep) in elf_i386_ld_init() argument
1082 old_open_outfile = statep->callbacks.open_outfile; in elf_i386_ld_init()
1083 statep->callbacks.open_outfile = elf_i386_open_outfile; in elf_i386_ld_init()
1085 statep->callbacks.relocate_section = elf_i386_relocate_section; in elf_i386_ld_init()
1087 statep->callbacks.initialize_plt = elf_i386_initialize_plt; in elf_i386_ld_init()
1088 statep->callbacks.initialize_pltrel = elf_i386_initialize_pltrel; in elf_i386_ld_init()
1090 statep->callbacks.initialize_got = elf_i386_initialize_got; in elf_i386_ld_init()
1091 statep->callbacks.initialize_gotplt = elf_i386_initialize_gotplt; in elf_i386_ld_init()
1093 statep->callbacks.finalize_plt = elf_i386_finalize_plt; in elf_i386_ld_init()
1095 statep->callbacks.rel_type = elf_i386_rel_type; in elf_i386_ld_init()
1097 statep->callbacks.count_relocations = elf_i386_count_relocations; in elf_i386_ld_init()
1099 statep->callbacks.create_relocations = elf_i386_create_relocations; in elf_i386_ld_init()