Lines Matching full:section
134 struct section *find_section_by_name(const struct elf *elf, const char *name) in find_section_by_name()
136 struct section *sec; in find_section_by_name()
146 static struct section *find_section_by_index(struct elf *elf, in find_section_by_index()
149 struct section *sec; in find_section_by_index()
151 elf_hash_for_each_possible(section, sec, hash, idx) { in find_section_by_index()
171 struct symbol *find_symbol_by_offset(struct section *sec, unsigned long offset) in find_symbol_by_offset()
184 struct symbol *find_func_by_offset(struct section *sec, unsigned long offset) in find_func_by_offset()
197 struct symbol *find_symbol_containing(const struct section *sec, unsigned long offset) in find_symbol_containing()
228 int find_symbol_hole_containing(const struct section *sec, unsigned long offset) in find_symbol_hole_containing()
249 * If there is no symbol in the section, the first node will be NULL, in find_symbol_hole_containing()
250 * in which case, -1 is returned to skip the whole section. in find_symbol_hole_containing()
265 struct symbol *find_func_containing(struct section *sec, unsigned long offset) in find_func_containing()
319 struct reloc *find_reloc_by_dest_range(const struct elf *elf, struct section *sec, in find_reloc_by_dest_range()
323 struct section *rsec; in find_reloc_by_dest_range()
349 struct reloc *find_reloc_by_dest(const struct elf *elf, struct section *sec, unsigned long offset) in find_reloc_by_dest()
354 static bool is_dwarf_section(struct section *sec) in is_dwarf_section()
362 struct section *sec; in read_sections()
376 if (!elf_alloc_hash(section, sections_nr) || in read_sections()
423 elf_hash_add(section, &sec->hash, sec->idx); in read_sections()
437 ERROR("section entry mismatch"); in read_sections()
542 struct section *symtab, *symtab_shndx, *sec; in read_symbols()
604 ERROR("couldn't find section for symbol %s", sym->name); in read_symbols()
685 struct section *symtab, *sec; in mark_group_syms()
732 static int elf_update_symbol(struct elf *elf, struct section *symtab, in elf_update_symbol()
733 struct section *symtab_shndx, struct symbol *sym) in elf_update_symbol()
840 /* setup extended section index magic and write the symbol */ in elf_update_symbol()
862 struct section *sec, unsigned int bind, in elf_create_symbol()
866 struct section *symtab, *symtab_shndx; in elf_create_symbol()
893 ERROR("no NULL section"); in elf_create_symbol()
967 struct symbol *elf_create_section_symbol(struct elf *elf, struct section *sec) in elf_create_section_symbol()
980 struct reloc *elf_init_reloc(struct elf *elf, struct section *rsec, in elf_init_reloc()
1015 struct reloc *elf_init_reloc_text_sym(struct elf *elf, struct section *sec, in elf_init_reloc_text_sym()
1018 struct section *insn_sec, in elf_init_reloc_text_sym()
1031 * Due to how weak functions work, we must use section based in elf_init_reloc_text_sym()
1045 struct reloc *elf_init_reloc_data_sym(struct elf *elf, struct section *sec, in elf_init_reloc_data_sym()
1063 struct section *rsec; in read_relocs()
1078 ERROR("can't find base section for reloc section %s", rsec->name); in read_relocs()
1191 struct section *null, *symtab, *strtab, *shstrtab; in elf_create_file()
1264 if (!elf_alloc_hash(section, 1000) || in elf_create_file()
1322 unsigned int elf_add_string(struct elf *elf, struct section *strtab, const char *str) in elf_add_string()
1329 ERROR("can't find .strtab section"); in elf_add_string()
1346 void *elf_add_data(struct elf *elf, struct section *sec, const void *data, size_t size) in elf_add_data()
1388 struct section *elf_create_section(struct elf *elf, const char *name, in elf_create_section()
1393 struct section *sec, *shstrtab; in elf_create_section()
1397 ERROR("section '%s' already exists", name); in elf_create_section()
1409 /* don't actually create the section, just the data structures */ in elf_create_section()
1456 /* Add section name to .shstrtab (or .strtab for Clang) */ in elf_create_section()
1474 elf_hash_add(section, &sec->hash, sec->idx); in elf_create_section()
1481 static int elf_alloc_reloc(struct elf *elf, struct section *rsec) in elf_alloc_reloc()
1589 struct section *elf_create_rela_section(struct elf *elf, struct section *sec, in elf_create_rela_section()
1592 struct section *rsec; in elf_create_rela_section()
1630 struct reloc *elf_create_reloc(struct elf *elf, struct section *sec, in elf_create_reloc()
1635 struct section *rsec = sec->rsec; in elf_create_reloc()
1657 struct section *elf_create_section_pair(struct elf *elf, const char *name, in elf_create_section_pair()
1661 struct section *sec; in elf_create_section_pair()
1674 int elf_write_insn(struct elf *elf, struct section *sec, in elf_write_insn()
1681 ERROR("write to unexpected data for section: %s", sec->name); in elf_write_insn()
1696 * A) adhere to the section header and truncate the data, or
1697 * B) ignore the section header and write out all the data you've got?
1701 static int elf_truncate_section(struct elf *elf, struct section *sec) in elf_truncate_section()
1715 /* get next data descriptor for the relevant section */ in elf_truncate_section()
1719 ERROR("end of section data but non-zero size left\n"); in elf_truncate_section()
1747 struct section *sec; in elf_write()
1750 /* Update changed relocation sections and section headers: */ in elf_write()
1762 /* Note this also flags the section dirty */ in elf_write()
1772 /* Make sure the new section header entries get updated properly. */ in elf_write()