Home | History | Annotate | Download | only in src

Lines Matching defs:shdr

539   assert (SCNINFO_SHDR (fileinfo->scninfo[newgrpid].shdr).sh_type
541 assert (SCNINFO_SHDR (oldp->file->scninfo[oldgrpid].shdr).sh_type
668 SCNINFO_SHDR (fileinfo->scninfo[shndx].shdr).sh_name);
693 SCNINFO_SHDR (oldfile->scninfo[shndx].shdr).sh_name);
844 SCNINFO_SHDR (fileinfo->scninfo[shndx].shdr).sh_name));
882 XElf_Shdr *shdr = &SCNINFO_SHDR (fileinfo->scninfo[idx].shdr);
888 elf_strptr (fileinfo->elf, fileinfo->shstrndx, shdr->sh_name));
894 shdr->sh_name))
896 && ((shdr->sh_type != SHT_RELA && shdr->sh_type != SHT_REL)
900 SCNINFO_SHDR (fileinfo->scninfo[shdr->sh_info].shdr).sh_name)))))
922 XElf_Shdr *shdr = &SCNINFO_SHDR (scninfo->shdr);
924 if (unlikely (scninfo->shdr == NULL))
926 if (unlikely (scninfo->shdr.sh_type == SHT_NULL))
930 shdr = xelf_getshdr (scninfo->scn, scninfo->shdr);
932 xelf_getshdr_copy (scninfo->scn, shdr, scninfo->shdr);
934 if (unlikely (shdr == NULL))
941 if (unlikely (shdr->sh_link != 0))
944 mark_section_used (&scninfo->fileinfo->scninfo[shdr->sh_link],
945 shdr->sh_link, &ignore);
949 if (unlikely (shdr->sh_info != 0) && (shdr->sh_flags & SHF_INFO_LINK))
952 mark_section_used (&scninfo->fileinfo->scninfo[shdr->sh_info],
953 shdr->sh_info, &ignore);
956 if (unlikely (shdr->sh_flags & SHF_GROUP) && ld_state.gc_sections)
972 XElf_Shdr *shdr = &SCNINFO_SHDR (scninfo->shdr);
986 || (shdr->sh_flags & SHF_ALLOC) != 0
987 || shdr->sh_type == SHT_NOTE
988 || (shdr->sh_type == SHT_PROGBITS
991 shdr->sh_name), ".comment") == 0))
996 if ((shdr->sh_flags & SHF_GROUP) && grpscn == NULL)
1004 search.name = elf_strptr (fileinfo->elf, fileinfo->shstrndx, shdr->sh_name);
1005 search.type = shdr->sh_type;
1006 search.flags = shdr->sh_flags;
1007 search.entsize = shdr->sh_entsize;
1020 if (unlikely (shdr->sh_flags & SHF_GROUP))
1041 if (SCNINFO_SHDR (runp->shdr).sh_flags & SHF_GROUP)
1069 shdr->sh_flags);
1070 queued->align = MAX (queued->align, shdr->sh_addralign);
1080 queued->type = shdr->sh_type;
1081 queued->flags = shdr->sh_flags;
1082 queued->align = shdr->sh_addralign;
1083 queued->entsize = shdr->sh_entsize;
1089 ld_state.need_tls |= (shdr->sh_flags & SHF_TLS) != 0;
1139 XElf_Shdr *shdr;
1141 if (fileinfo->scninfo[cnt].shdr == NULL)
1143 if (fileinfo->scninfo[cnt].shdr.sh_type == SHT_NULL)
1147 shdr = xelf_getshdr (fileinfo->scninfo[cnt].scn,
1148 fileinfo->scninfo[cnt].shdr);
1150 xelf_getshdr_copy (fileinfo->scninfo[cnt].scn, shdr,
1151 fileinfo->scninfo[cnt].shdr);
1153 if (shdr == NULL)
1162 shdr = &SCNINFO_SHDR (fileinfo->scninfo[cnt].shdr);
1167 has_merge_sections |= (shdr->sh_flags & SHF_MERGE) != 0;
1168 has_tls_symbols |= (shdr->sh_flags & SHF_TLS) != 0;
1174 if (unlikely (shdr->sh_type == SHT_SYMTAB)
1175 || unlikely (shdr->sh_type == SHT_DYNSYM))
1177 if (shdr->sh_type == SHT_SYMTAB)
1181 fileinfo->nsymtab = shdr->sh_size / shdr->sh_entsize;
1182 fileinfo->nlocalsymbols = shdr->sh_info;
1183 fileinfo->symstridx = shdr->sh_link;
1189 fileinfo->ndynsymtab = shdr->sh_size / shdr->sh_entsize;
1190 fileinfo->dynsymstridx = shdr->sh_link;
1195 if (secttype == shdr->sh_type)
1199 symstridx = shdr->sh_link;
1200 nsymbols = shdr->sh_size / shdr->sh_entsize;
1201 nlocalsymbols = shdr->sh_info;
1204 else if (unlikely (shdr->sh_type == SHT_SYMTAB_SHNDX))
1209 else if (unlikely (shdr->sh_type == SHT_GNU_versym))
1214 else if (unlikely (shdr->sh_type == SHT_GNU_verdef))
1223 fileinfo->nverdef = nversions = shdr->sh_info;
1233 else if (unlikely (shdr->sh_type == SHT_GNU_verneed))
1238 else if (unlikely (shdr->sh_type == SHT_DYNAMIC))
1243 else if (unlikely (shdr->sh_type == SHT_GROUP))
1263 symscn = elf_getscn (fileinfo->elf, shdr->sh_link);
1273 xelf_getsym (symdata, shdr->sh_info, sym);
1296 symbol->symidx = shdr->sh_info;
1307 shdr->sh_name),
1318 shdr->sh_name),
1333 shdr->sh_name),
1344 else if (! SECTION_TYPE_P (&ld_state, shdr->sh_type)
1345 && unlikely ((shdr->sh_flags & SHF_OS_NONCONFORMING) != 0))
1353 shdr->sh_name),
1354 (int) shdr->sh_type);
1361 && likely (shdr->sh_type == SHT_PROGBITS
1362 || shdr->sh_type == SHT_RELA
1363 || shdr->sh_type == SHT_REL
1364 || shdr->sh_type == SHT_NOTE
1365 || shdr->sh_type == SHT_NOBITS
1366 || shdr->sh_type == SHT_INIT_ARRAY
1367 || shdr->sh_type == SHT_FINI_ARRAY
1368 || shdr->sh_type == SHT_PREINIT_ARRAY))
1371 if (shdr->sh_type == SHT_PROGBITS
1372 && (shdr->sh_flags & SHF_EXECINSTR) == 0
1374 shdr->sh_name),
1429 && ((SCNINFO_SHDR (fileinfo->scninfo[shndx].shdr).sh_flags
1631 if (SCNINFO_SHDR (fileinfo->scninfo[shndx].shdr).sh_flags
2751 compute_copy_reloc_offset (XElf_Shdr *shdr)
2770 XElf_Off symalign = MAX (SCNINFO_SHDR (runp->file->scninfo[runp->scndx].shdr).sh_addralign, 1);
2783 shdr->sh_type = SHT_NOBITS;
2784 shdr->sh_size = offset;
2785 shdr->sh_addralign = maxalign;
2790 compute_common_symbol_offset (XElf_Shdr *shdr)
2815 shdr->sh_type = SHT_NOBITS;
2816 shdr->sh_size = offset;
2817 shdr->sh_addralign = maxalign;
2914 newp->type = SCNINFO_SHDR (found->shdr).sh_type;
2917 newp->flags = SCNINFO_SHDR (found->shdr).sh_flags & ~SHF_GROUP;
2922 newp->entsize = SCNINFO_SHDR (found->shdr).sh_entsize;
2944 if (queued->type != SCNINFO_SHDR (found->shdr).sh_type)
2947 if (queued->flags != SCNINFO_SHDR (found->shdr).sh_flags)
2952 SCNINFO_SHDR (found->shdr).sh_flags
3055 si->shdr = (XElf_Shdr *) (si + 1);
3062 compute_copy_reloc_offset (&SCNINFO_SHDR (si->shdr));
3085 si->shdr = (XElf_Shdr *) (si + 1);
3092 compute_common_symbol_offset (&SCNINFO_SHDR (si->shdr));
3176 XElf_Shdr_vardef (shdr);
3221 xelf_getshdr (scn, shdr);
3222 if (shdr == NULL)
3242 SCNINFO_SHDR (runp->shdr).sh_name),
3291 xelf_getshdr (scn, shdr);
3292 if (shdr == NULL)
3302 shdr->sh_type = head->type;
3303 shdr->sh_flags = head->flags;
3304 shdr->sh_addralign = head->align;
3305 shdr->sh_entsize = head->entsize;
3306 assert (shdr->sh_entsize != 0 || (shdr->sh_flags & SHF_MERGE) == 0);
3307 (void) xelf_update_shdr (scn, shdr);
3425 XElf_Shdr_vardef (shdr);
3427 xelf_getshdr (elf_getscn (ld_state.outelf, 1), shdr);
3428 assert (shdr != NULL);
3430 val = shdr->sh_offset;
3909 XElf_Shdr_vardef (shdr);
3917 xelf_getshdr (hashscn, shdr);
3919 if (shdr == NULL || hashdata == NULL)
3924 shdr->sh_link = ld_state.dynsymscnidx;
3925 (void) xelf_update_shdr (hashscn, shdr);
4056 XElf_Shdr_vardef (shdr);
4068 xelf_getshdr (hashscn, shdr);
4070 if (shdr == NULL || hashdata == NULL)
4075 shdr->sh_link = ld_state.dynsymscnidx;
4076 (void) xelf_update_shdr (hashscn, shdr);
4165 GElf_Shdr *shdr = gelf_getshdr (scn, &shdr_mem);
4166 assert (shdr != NULL);
4168 if (SECTION_STRIP_P (shdr, elf_strptr (ld_state.outelf, shstrndx,
4169 shdr->sh_name), true))
4174 if (shdr->sh_type == SHT_NOBITS)
4319 XElf_Shdr_vardef (shdr);
4836 if (SCNINFO_SHDR (head->last->shdr).sh_entsize == 1
4906 else if (likely (SCNINFO_SHDR (head->last->shdr).sh_entsize
4994 = ebl_gstrtabinit (SCNINFO_SHDR (head->last->shdr).sh_entsize,
5097 assert (SCNINFO_SHDR (runp->shdr).sh_type == SHT_NOBITS);
5102 outdata->d_size = SCNINFO_SHDR (runp->shdr).sh_size;
5103 outdata->d_align = SCNINFO_SHDR (runp->shdr).sh_addralign;
5597 xelf_getshdr (strscn, shdr);
5598 if (data == NULL || shdr == NULL)
5607 shdr->sh_type = SHT_STRTAB;
5608 assert (shdr->sh_entsize == 0);
5610 if (unlikely (xelf_update_shdr (strscn, shdr) == 0))
5943 xelf_getshdr (versymscn, shdr);
5944 assert (shdr != NULL);
5946 shdr->sh_link = ld_state.dynsymscnidx;
5948 (void) xelf_update_shdr (versymscn, shdr);
5990 xelf_getshdr (verneedscn, shdr);
5992 if (shdr == NULL || verneeddata == NULL)
6030 shdr->sh_link = ld_state.dynstrscnidx;
6031 shdr->sh_info = ld_state.nverdeffile;
6032 (void) xelf_update_shdr (verneedscn, shdr);
6042 xelf_getshdr (dynsymscn, shdr);
6044 shdr->sh_info = 1;
6046 shdr->sh_link = ld_state.dynstrscnidx;
6048 (void) xelf_update_shdr (dynsymscn, shdr);
6059 xelf_getshdr (symscn, shdr);
6060 if (shdr == NULL)
6065 shdr->sh_type = SHT_SYMTAB;
6066 shdr->sh_link = ld_state.strscnidx;
6067 shdr->sh_info = nsym_local;
6068 shdr->sh_entsize = xelf_fsize (ld_state.outelf, ELF_T_SYM, 1);
6070 (void) xelf_update_shdr (symscn, shdr);
6119 xelf_getshdr (scn, shdr);
6120 assert (shdr != NULL);
6122 shdr->sh_name = ebl_strtaboffset (ld_state.allsections[cnt]->nameent);
6124 if (xelf_update_shdr (scn, shdr) == 0)
6134 xelf_getshdr (scn, shdr);
6136 assert (shdr != NULL);
6138 shdr->sh_name = ebl_strtaboffset (symtab_ent);
6140 (void) xelf_update_shdr (scn, shdr);
6146 xelf_getshdr (scn, shdr);
6148 assert (shdr != NULL);
6150 shdr->sh_name = ebl_strtaboffset (xndx_ent);
6152 (void) xelf_update_shdr (scn, shdr);
6158 xelf_getshdr (scn, shdr);
6160 assert (shdr != NULL);
6162 shdr->sh_name = ebl_strtaboffset (strtab_ent);
6164 (void) xelf_update_shdr (scn, shdr);
6168 xelf_getshdr (shstrtab_scn, shdr);
6169 if (shdr == NULL)
6174 shdr->sh_name = ebl_strtaboffset (shstrtab_ent);
6175 shdr->sh_type = SHT_STRTAB;
6177 if (unlikely (xelf_update_shdr (shstrtab_scn, shdr) == 0))
6188 xelf_getshdr (scn, shdr);
6189 assert (shdr != NULL);
6191 shdr->sh_name = ebl_strtaboffset (groups->nameent);
6192 shdr->sh_type = SHT_GROUP;
6193 shdr->sh_flags = 0;
6194 shdr->sh_link = ld_state.symscnidx;
6195 shdr->sh_entsize = sizeof (Elf32_Word);
6207 shdr->sh_info = ld_state.dblindirect[si];
6209 (void) xelf_update_shdr (scn, shdr);
6276 xelf_getshdr (scn, shdr);
6277 assert (shdr != NULL);
6281 XElf_Addr addr = shdr->sh_offset;
6335 shdr->sh_addr = addr;
6338 (void) xelf_update_shdr (scn, shdr);
6344 if (unlikely (shdr->sh_flags & SHF_TLS))
6349 tls_offset = shdr->sh_offset;
6351 if (tls_end < addr + shdr->sh_size)
6352 tls_end = addr + shdr->sh_size;
6353 if (shdr->sh_type != SHT_NOBITS)
6354 tls_filesize += shdr->sh_size;
6355 if (shdr->sh_addralign > tls_align)
6356 tls_align = shdr->sh_addralign;
6366 segment->addr = addr - shdr->sh_offset;
6370 segment->offset = shdr->sh_offset;
6375 segment->align = MAX (segment->align, shdr->sh_addralign);
6382 if (shdr->sh_type != SHT_NOBITS
6383 || (shdr->sh_flags & SHF_TLS) == 0)
6385 memsize = (shdr->sh_offset - segment->offset
6386 + shdr->sh_size);
6387 if (nobits_size != 0 && shdr->sh_type != SHT_NOTE)
6390 if (shdr->sh_type == SHT_NOBITS)
6391 nobits_size += shdr->sh_size;
6400 XElf_Off oldoff = shdr->sh_offset;
6407 xelf_getshdr (scn, shdr);
6408 assert (shdr != NULL);
6412 assert (oldoff <= shdr->sh_offset);
6413 addr += shdr->sh_offset - oldoff;
6597 xelf_getshdr (scn, shdr);
6598 assert (shdr != NULL);
6600 shdr->sh_link = ld_state.dynsymscnidx;
6602 (void) xelf_update_shdr (scn, shdr);
6615 ld_state.interpscnidx), shdr);
6616 assert (shdr != NULL);
6634 phdr->p_offset = shdr->sh_offset;
6635 phdr->p_vaddr = shdr->sh_addr;
6637 phdr->p_filesz = shdr->sh_size;
6650 xelf_getshdr (outscn, shdr);
6651 assert (shdr != NULL);
6655 phdr->p_offset = shdr->sh_offset;
6656 phdr->p_vaddr = shdr->sh_addr;
6658 phdr->p_filesz = shdr->sh_size;
6661 phdr->p_align = shdr->sh_addralign;
6667 shdr->sh_link = ld_state.dynstrscnidx;
6668 (void) xelf_update_shdr (outscn, shdr);
6738 shdr);
6739 assert (shdr != NULL);
6741 shdr->sh_addr);
6746 shdr);
6747 assert (shdr != NULL);
6749 shdr->sh_addr);
6756 shdr);
6757 assert (shdr != NULL);
6759 shdr->sh_addr);
6762 shdr->sh_size);
6769 ld_state.gotpltscnidx), shdr);
6770 assert (shdr != NULL);
6774 DT_PLTGOT, shdr->sh_addr);
6777 ld_state.pltrelscnidx), shdr);
6778 assert (shdr != NULL);
6780 DT_PLTRELSZ, shdr->sh_size);
6783 DT_JMPREL, shdr->sh_addr);
6793 ld_state.reldynscnidx), shdr);
6794 assert (shdr != NULL);
6796 rel, shdr->sh_addr);
6803 rel + 1, shdr->sh_size);
6819 ld_state.verneedscnidx), shdr);
6820 assert (shdr != NULL);
6822 DT_VERNEED, shdr->sh_addr);
6831 ld_state.versymscnidx), shdr);
6832 assert (shdr != NULL);
6834 DT_VERSYM, shdr->sh_addr);
6875 xelf_getshdr (outscn, shdr);
6877 assert (shdr != NULL);
6880 shdr->sh_link = ld_state.symscnidx;
6885 shdr->sh_info =
6886 rellist->scninfo->fileinfo->scninfo[SCNINFO_SHDR (rellist->scninfo->shdr).sh_info].outscnndx;
6894 (void) xelf_update_shdr (outscn, shdr);
6922 xelf_getshdr (scn, shdr);
6923 if (unlikely (shdr == NULL))
6928 shdr->sh_link = shstrtab_ndx;
6930 (void) xelf_update_shdr (scn, shdr);