Lines Matching full:section
111 * Find !section symbol where @offset is after it.
130 struct section *find_section_by_name(const struct elf *elf, const char *name) in find_section_by_name()
132 struct section *sec; in find_section_by_name()
142 static struct section *find_section_by_index(struct elf *elf, in find_section_by_index()
145 struct section *sec; in find_section_by_index()
147 elf_hash_for_each_possible(section, sec, hash, idx) { in find_section_by_index()
167 struct symbol *find_symbol_by_offset(struct section *sec, unsigned long offset) in find_symbol_by_offset()
180 struct symbol *find_func_by_offset(struct section *sec, unsigned long offset) in find_func_by_offset()
193 struct symbol *find_symbol_containing(const struct section *sec, unsigned long offset) in find_symbol_containing()
209 int find_symbol_hole_containing(const struct section *sec, unsigned long offset) in find_symbol_hole_containing()
230 * If there is no symbol in the section, the first node will be NULL, in find_symbol_hole_containing()
231 * in which case, -1 is returned to skip the whole section. in find_symbol_hole_containing()
246 struct symbol *find_func_containing(struct section *sec, unsigned long offset) in find_func_containing()
271 struct reloc *find_reloc_by_dest_range(const struct elf *elf, struct section *sec, in find_reloc_by_dest_range()
275 struct section *rsec; in find_reloc_by_dest_range()
301 struct reloc *find_reloc_by_dest(const struct elf *elf, struct section *sec, unsigned long offset) in find_reloc_by_dest()
306 static bool is_dwarf_section(struct section *sec) in is_dwarf_section()
314 struct section *sec; in read_sections()
328 if (!elf_alloc_hash(section, sections_nr) || in read_sections()
375 elf_hash_add(section, &sec->hash, sec->idx); in read_sections()
389 ERROR("section entry mismatch"); in read_sections()
439 struct section *symtab, *symtab_shndx, *sec; in read_symbols()
498 ERROR("couldn't find section for symbol %s", sym->name); in read_symbols()
596 static int elf_update_symbol(struct elf *elf, struct section *symtab, in elf_update_symbol()
597 struct section *symtab_shndx, struct symbol *sym) in elf_update_symbol()
705 /* setup extended section index magic and write the symbol */ in elf_update_symbol()
729 struct section *symtab, *symtab_shndx; in __elf_create_symbol()
793 elf_create_section_symbol(struct elf *elf, struct section *sec) in elf_create_section_symbol()
818 static int elf_add_string(struct elf *elf, struct section *strtab, char *str);
849 static struct reloc *elf_init_reloc(struct elf *elf, struct section *rsec, in elf_init_reloc()
885 struct reloc *elf_init_reloc_text_sym(struct elf *elf, struct section *sec, in elf_init_reloc_text_sym()
888 struct section *insn_sec, in elf_init_reloc_text_sym()
901 * Due to how weak functions work, we must use section based in elf_init_reloc_text_sym()
917 struct reloc *elf_init_reloc_data_sym(struct elf *elf, struct section *sec, in elf_init_reloc_data_sym()
935 struct section *rsec; in read_relocs()
950 ERROR("can't find base section for reloc section %s", rsec->name); in read_relocs()
1048 static int elf_add_string(struct elf *elf, struct section *strtab, char *str) in elf_add_string()
1057 ERROR("can't find .strtab section"); in elf_add_string()
1085 struct section *elf_create_section(struct elf *elf, const char *name, in elf_create_section()
1088 struct section *sec, *shstrtab; in elf_create_section()
1144 /* Add section name to .shstrtab (or .strtab for Clang) */ in elf_create_section()
1149 ERROR("can't find .shstrtab or .strtab section"); in elf_create_section()
1157 elf_hash_add(section, &sec->hash, sec->idx); in elf_create_section()
1165 static struct section *elf_create_rela_section(struct elf *elf, in elf_create_rela_section()
1166 struct section *sec, in elf_create_rela_section()
1169 struct section *rsec; in elf_create_rela_section()
1204 struct section *elf_create_section_pair(struct elf *elf, const char *name, in elf_create_section_pair()
1208 struct section *sec; in elf_create_section_pair()
1220 int elf_write_insn(struct elf *elf, struct section *sec, in elf_write_insn()
1227 ERROR("write to unexpected data for section: %s", sec->name); in elf_write_insn()
1242 * A) adhere to the section header and truncate the data, or
1243 * B) ignore the section header and write out all the data you've got?
1247 static int elf_truncate_section(struct elf *elf, struct section *sec) in elf_truncate_section()
1261 /* get next data descriptor for the relevant section */ in elf_truncate_section()
1266 ERROR("end of section data but non-zero size left\n"); in elf_truncate_section()
1294 struct section *sec; in elf_write()
1297 /* Update changed relocation sections and section headers: */ in elf_write()
1309 /* Note this also flags the section dirty */ in elf_write()
1319 /* Make sure the new section header entries get updated properly. */ in elf_write()