Lines Matching defs:shdr
48 Elf64_Shdr *shdr;
117 Elf64_Shdr *shdr;
351 symtab->shdr->sh_size += sizeof(*sym);
400 sec->shdr = elf64_getshdr(sec->scn);
401 if (!sec->shdr)
418 sec->shdr->sh_name = str_off;
419 sec->shdr->sh_type = SHT_STRTAB;
420 sec->shdr->sh_flags = SHF_STRINGS;
421 sec->shdr->sh_offset = 0;
422 sec->shdr->sh_link = 0;
423 sec->shdr->sh_info = 0;
424 sec->shdr->sh_addralign = 1;
425 sec->shdr->sh_size = sec->sec_sz = 0;
426 sec->shdr->sh_entsize = 0;
439 sec->shdr = elf64_getshdr(sec->scn);
440 if (!sec->shdr)
458 sec->shdr->sh_name = str_off;
459 sec->shdr->sh_type = SHT_SYMTAB;
460 sec->shdr->sh_flags = 0;
461 sec->shdr->sh_offset = 0;
462 sec->shdr->sh_link = linker->strtab_sec_idx;
466 sec->shdr->sh_info = 0;
467 sec->shdr->sh_addralign = 8;
468 sec->shdr->sh_entsize = sizeof(Elf64_Sym);
608 Elf64_Shdr *shdr = sec->shdr;
612 if (shdr->sh_type == SHT_STRTAB)
616 if (shdr->sh_type == SHT_LLVM_ADDRSIG)
620 if (shdr->sh_type == SHT_PROGBITS && shdr->sh_size == 0 &&
672 Elf64_Shdr *shdr;
735 shdr = elf64_getshdr(scn);
736 if (!shdr) {
742 sec_name = elf_strptr(obj->elf, obj->shstrs_sec_idx, shdr->sh_name);
761 sec->shdr = shdr;
770 switch (shdr->sh_type) {
784 obj->btf = btf__new(data->d_buf, shdr->sh_size);
795 obj->btf_ext = btf_ext__new(data->d_buf, shdr->sh_size);
855 if (sec->shdr->sh_addralign && !is_pow_of_2(sec->shdr->sh_addralign)) {
857 sec->sec_idx, (long long unsigned)sec->shdr->sh_addralign,
861 if (sec->shdr->sh_addralign != sec->data->d_align) {
863 sec->sec_idx, (long long unsigned)sec->shdr->sh_addralign,
868 if (sec->shdr->sh_size != sec->data->d_size) {
870 sec->sec_idx, (long long unsigned)sec->shdr->sh_size,
875 switch (sec->shdr->sh_type) {
884 if (sec->shdr->sh_flags & SHF_EXECINSTR) {
885 if (sec->shdr->sh_size % sizeof(struct bpf_insn) != 0) {
887 sec->sec_idx, (long long unsigned)sec->shdr->sh_size,
904 sec->sec_idx, sec->sec_name, (size_t)sec->shdr->sh_type, obj->filename);
918 if (sec->shdr->sh_entsize != sizeof(Elf64_Sym))
920 if (sec->shdr->sh_size % sec->shdr->sh_entsize != 0)
923 if (!sec->shdr->sh_link || sec->shdr->sh_link >= obj->sec_cnt) {
925 sec->sec_idx, (size_t)sec->shdr->sh_link, obj->filename);
928 link_sec = &obj->secs[sec->shdr->sh_link];
929 if (link_sec->shdr->sh_type != SHT_STRTAB) {
931 sec->sec_idx, (size_t)sec->shdr->sh_link, obj->filename);
935 n = sec->shdr->sh_size / sec->shdr->sh_entsize;
992 if (sec->shdr->sh_entsize != sizeof(Elf64_Rel))
994 if (sec->shdr->sh_size % sec->shdr->sh_entsize != 0)
998 if (sec->shdr->sh_link != obj->symtab_sec_idx) {
1000 sec->sec_idx, (size_t)sec->shdr->sh_link, obj->filename);
1005 if (!sec->shdr->sh_info || sec->shdr->sh_info >= obj->sec_cnt) {
1007 sec->sec_idx, (size_t)sec->shdr->sh_info, obj->filename);
1010 link_sec = &obj->secs[sec->shdr->sh_info];
1025 if (link_sec->shdr->sh_type != SHT_PROGBITS && link_sec->shdr->sh_type != SHT_NOBITS) {
1027 sec->sec_idx, (size_t)sec->shdr->sh_info, obj->filename);
1032 n = sec->shdr->sh_size / sec->shdr->sh_entsize;
1046 if (!sym_idx || sym_idx * sizeof(Elf64_Sym) >= sym_sec->shdr->sh_size) {
1052 if (link_sec->shdr->sh_flags & SHF_EXECINSTR) {
1145 Elf64_Shdr *shdr;
1162 shdr = elf64_getshdr(scn);
1163 if (!shdr)
1167 dst_sec->shdr = shdr;
1175 shdr->sh_name = name_off;
1176 shdr->sh_type = src_sec->shdr->sh_type;
1177 shdr->sh_flags = src_sec->shdr->sh_flags;
1178 shdr->sh_size = 0;
1183 shdr->sh_link = 0;
1184 shdr->sh_info = 0;
1185 shdr->sh_addralign = src_sec->shdr->sh_addralign;
1186 shdr->sh_entsize = src_sec->shdr->sh_entsize;
1217 if (dst->shdr->sh_type != src->shdr->sh_type) {
1221 if (dst->shdr->sh_flags != src->shdr->sh_flags) {
1225 if (dst->shdr->sh_entsize != src->shdr->sh_entsize) {
1235 if (dst_sec->sec_sz != src_sec->shdr->sh_size)
1246 return (sec->shdr->sh_type == SHT_PROGBITS) &&
1247 (sec->shdr->sh_flags & SHF_EXECINSTR);
1285 dst_align = dst->shdr->sh_addralign;
1286 src_align = src->shdr->sh_addralign;
1295 dst_final_sz = dst_align_sz + src->shdr->sh_size;
1297 if (src->shdr->sh_type != SHT_NOBITS) {
1318 memcpy(dst->raw_data + dst_align_sz, src->data->d_buf, src->shdr->sh_size);
1322 exec_sec_bswap(dst->raw_data + dst_align_sz, src->shdr->sh_size);
1326 dst->shdr->sh_size = dst_final_sz;
1329 dst->shdr->sh_addralign = dst_align;
1344 return sec->shdr->sh_type == SHT_PROGBITS || sec->shdr->sh_type == SHT_NOBITS;
1351 return sec->shdr->sh_type == SHT_REL;
1410 int i, n = symtab->shdr->sh_size / symtab->shdr->sh_entsize, err;
1411 int str_sec_idx = symtab->shdr->sh_link;
2209 /* shdr->sh_info points to relocatable section */
2210 src_linked_sec = &obj->secs[src_sec->shdr->sh_info];
2229 /* shdr->sh_link points to SYMTAB */
2230 dst_sec->shdr->sh_link = linker->symtab_sec_idx;
2232 /* shdr->sh_info points to relocated section */
2234 dst_sec->shdr->sh_info = dst_linked_sec->sec_idx;
2243 n = src_sec->shdr->sh_size / src_sec->shdr->sh_entsize;
2260 if (src_linked_sec->shdr->sh_flags & SHF_EXECINSTR) {
2292 int i, n = symtab->shdr->sh_size / symtab->shdr->sh_entsize;
2293 int str_sec_idx = symtab->shdr->sh_link;
2337 if (sec->shdr)
2338 t->size = sec->shdr->sh_size;
2774 sec->shdr->sh_size = strs_sz;
2823 Elf64_Shdr *shdr;
2836 shdr = elf64_getshdr(scn);
2837 if (!shdr)
2840 shdr->sh_name = name_off;
2841 shdr->sh_type = SHT_PROGBITS;
2842 shdr->sh_flags = 0;
2843 shdr->sh_size = raw_sz;
2844 shdr->sh_link = 0;
2845 shdr->sh_info = 0;
2846 shdr->sh_addralign = align;
2847 shdr->sh_entsize = 0;