Lines Matching defs:statep

53 elf_i386_open_outfile (struct ld_state *statep,
60 return old_open_outfile (statep, EM_386, ELFCLASS32, ELFDATA2LSB);
67 elf_i386_relocate_section (struct ld_state *statep __attribute__ ((unused)),
197 elf_i386_initialize_plt (struct ld_state *statep, Elf_Scn *scn)
215 data->d_size = (1 + statep->nplt) * PLT_ENTRY_SIZE;
221 statep->nplt_used = 1;
226 elf_i386_initialize_pltrel (struct ld_state *statep, Elf_Scn *scn)
236 size_t size = statep->nplt * sizeof (Elf32_Rel);
246 elf_i386_initialize_got (struct ld_state *statep, Elf_Scn *scn)
249 assert (statep->ngot != 0);
257 size_t size = statep->ngot * sizeof (Elf32_Addr);
267 elf_i386_initialize_gotplt (struct ld_state *statep, Elf_Scn *scn)
270 assert (statep->nplt != 0);
281 size_t size = (3 + statep->nplt) * sizeof (Elf32_Addr);
362 elf_i386_finalize_plt (struct ld_state *statep, size_t nsym,
365 if (unlikely (statep->nplt + statep->ngot == 0))
372 const bool build_dso = statep->file_type == dso_file_type;
375 scn = elf_getscn (statep->outelf, statep->gotpltscnidx);
388 xelf_getshdr (elf_getscn (statep->outelf, statep->dynamicscnidx), shdr);
394 scn = elf_getscn (statep->outelf, statep->pltscnidx);
399 Elf_Data *dynsymdata = elf_getdata (elf_getscn (statep->outelf,
400 statep->dynsymscnidx), NULL);
404 if (statep->symscnidx != 0)
406 symdata = elf_getdata (elf_getscn (statep->outelf, statep->symscnidx),
412 scn = elf_getscn (statep->outelf, statep->pltscnidx);
419 scn = elf_getscn (statep->outelf, statep->pltrelscnidx);
429 shdr->sh_link = statep->dynsymscnidx;
430 shdr->sh_info = statep->gotpltscnidx;
486 assert(nsym - statep->nplt + (pltidx - 1) == idx);
487 ((Elf32_Sym *) symdata->d_buf)[nsym - statep->nplt
523 elf_i386_rel_type (struct ld_state *statep __attribute__ ((__unused__)))
531 elf_i386_count_relocations (struct ld_state *statep, struct scninfo *scninfo)
567 || statep->file_type == dso_file_type)
570 ++statep->nrel_got;
575 ++statep->ngot;
581 statep->need_got = true;
589 if (statep->file_type == dso_file_type)
594 statep->dt_flags |= DF_TEXTREL;
607 ++statep->ncopy;
612 else if (statep->file_type == dso_file_type
629 && !statep->statically)
637 --statep->nunresolved;
639 --statep->nunresolved_nonweak;
640 CDBL_LIST_DEL (statep->unresolved, sym);
643 ++statep->nplt;
644 ++statep->nfrom_dso;
645 CDBL_LIST_ADD_REAR (statep->from_dso, sym);
650 if (statep->file_type != executable_file_type)
660 if (statep->file_type == dso_file_type)
670 if (statep->file_type != executable_file_type
719 elf_i386_create_relocations (struct ld_state *statep,
723 Elf_Scn *pltscn = elf_getscn (statep->outelf, statep->pltscnidx);
728 Elf_Scn *gotscn = elf_getscn (statep->outelf, statep->gotscnidx);
731 if (statep->need_got)
737 Elf_Scn *gotpltscn = elf_getscn (statep->outelf, statep->gotpltscnidx);
742 Elf_Scn *reldynscn = elf_getscn (statep->outelf, statep->reldynscnidx);
747 size_t ngotconst = statep->nrel_got;
749 struct scninfo *first = statep->rellist->next;
830 && statep->file_type != dso_file_type
850 assert (nreldyn <= statep->nrel_got);
855 Elf_Scn *symscn = elf_getscn (statep->outelf,
856 statep->dynsymscnidx);
862 sym->st_shndx = statep->copy_section->outscnndx;
868 symidx = statep->dblindirect[symidx];
869 symscn = elf_getscn (statep->outelf,
870 statep->symscnidx);
875 sym->st_shndx = statep->copy_section->outscnndx;
883 else if (statep->file_type == dso_file_type
903 assert (nreldyn <= statep->nrel_got);
914 assert (thisgotidx < statep->nrel_got);
922 rel2->r_offset = gotaddr + ((thisgotidx - statep->ngot)
928 else if (statep->file_type != dso_file_type)
931 assert (thisgotidx < statep->ngot);
941 assert (thisgotidx < statep->nrel_got);
948 (thisgotidx - statep->ngot)
1087 elf_i386_ld_init (struct ld_state *statep)
1090 old_open_outfile = statep->callbacks.open_outfile;
1091 statep->callbacks.open_outfile = elf_i386_open_outfile;
1093 statep->callbacks.relocate_section = elf_i386_relocate_section;
1095 statep->callbacks.initialize_plt = elf_i386_initialize_plt;
1096 statep->callbacks.initialize_pltrel = elf_i386_initialize_pltrel;
1098 statep->callbacks.initialize_got = elf_i386_initialize_got;
1099 statep->callbacks.initialize_gotplt = elf_i386_initialize_gotplt;
1101 statep->callbacks.finalize_plt = elf_i386_finalize_plt;
1103 statep->callbacks.rel_type = elf_i386_rel_type;
1105 statep->callbacks.count_relocations = elf_i386_count_relocations;
1107 statep->callbacks.create_relocations = elf_i386_create_relocations;