• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/src/router/busybox-1.x/modutils/

Lines Matching defs:sec

616 				    struct obj_section *sec);
628 static void *obj_extend_section(struct obj_section *sec, unsigned long more);
2179 obj_insert_section_load_order(struct obj_file *f, struct obj_section *sec)
2182 int prio = obj_load_order_prio(sec);
2186 sec->load_next = *p;
2187 *p = sec;
2196 struct obj_section *sec;
2198 f->sections = xrealloc(f->sections, (newidx + 1) * sizeof(sec));
2199 f->sections[newidx] = sec = arch_new_section();
2201 memset(sec, 0, sizeof(*sec));
2202 sec->header.sh_type = SHT_PROGBITS;
2203 sec->header.sh_flags = SHF_WRITE | SHF_ALLOC;
2204 sec->header.sh_size = size;
2205 sec->header.sh_addralign = align;
2206 sec->name = name;
2207 sec->idx = newidx;
2209 sec->contents = xmalloc(size);
2211 obj_insert_section_load_order(f, sec);
2213 return sec;
2222 struct obj_section *sec;
2224 f->sections = xrealloc(f->sections, (newidx + 1) * sizeof(sec));
2225 f->sections[newidx] = sec = arch_new_section();
2227 memset(sec, 0, sizeof(*sec));
2228 sec->header.sh_type = SHT_PROGBITS;
2229 sec->header.sh_flags = SHF_WRITE | SHF_ALLOC;
2230 sec->header.sh_size = size;
2231 sec->header.sh_addralign = align;
2232 sec->name = name;
2233 sec->idx = newidx;
2235 sec->contents = xmalloc(size);
2237 sec->load_next = f->load_order;
2238 f->load_order = sec;
2240 f->load_order_search_start = &sec->load_next;
2242 return sec;
2245 static void *obj_extend_section(struct obj_section *sec, unsigned long more)
2247 unsigned long oldsize = sec->header.sh_size;
2249 sec->contents = xrealloc(sec->contents, sec->header.sh_size += more);
2251 return sec->contents + oldsize;
2360 struct obj_section *sec;
2364 sec = obj_find_section(f, ".modinfo");
2365 if (sec == NULL)
2367 p = sec->contents;
2368 ep = p + sec->header.sh_size;
2779 struct obj_section *sec;
2781 sec = obj_create_alloced_section_first(f, ".this", tgt_sizeof_long,
2783 memset(sec->contents, 0, sizeof(struct new_module));
2786 ELF_ST_INFO(STB_LOCAL, STT_OBJECT), sec->idx, 0,
2789 obj_string_patch(f, sec->idx, offsetof(struct new_module, name),
2799 struct obj_section *sec;
2807 sec = obj_find_section(f, "__ksymtab");
2808 if (sec && !(sec->header.sh_flags & SHF_ALLOC)) {
2809 *((char *)(sec->name)) = 'x'; /* override const */
2810 sec = NULL;
2812 if (!sec)
2813 sec = obj_create_alloced_section(f, "__ksymtab",
2815 if (!sec)
2817 sec->header.sh_flags |= SHF_ALLOC;
2819 sec->header.sh_addralign = tgt_sizeof_void_p;
2820 ofs = sec->header.sh_size;
2821 obj_symbol_patch(f, sec->idx, ofs, sym);
2822 obj_string_patch(f, sec->idx, ofs + tgt_sizeof_void_p, sym->name);
2823 obj_extend_section(sec, 2 * tgt_sizeof_char_p);
2829 struct obj_section *sec;
2838 sec = obj_create_alloced_section(f, ".kmodtab", tgt_sizeof_void_p,
2841 if (!sec)
2845 dep = (struct new_module_ref *) sec->contents;
2849 obj_symbol_patch(f, sec->idx,
2850 (char *) &dep->ref - sec->contents, tm);
2860 sec = obj_create_alloced_section(f, "__ksymtab", tgt_sizeof_void_p, 0);
2879 obj_symbol_patch(f, sec->idx, ofs, sym);
2880 obj_string_patch(f, sec->idx, ofs + tgt_sizeof_void_p,
2887 obj_extend_section(sec, nsyms * 2 * tgt_sizeof_char_p);
2898 struct obj_section *sec;
2903 sec = obj_find_section(f, ".this");
2904 if (!sec || !sec->contents) {
2907 module = (struct new_module *) sec->contents;
2908 m_addr = sec->header.sh_addr;
2914 sec = obj_find_section(f, "__ksymtab");
2915 if (sec && sec->header.sh_size) {
2916 module->syms = sec->header.sh_addr;
2917 module->nsyms = sec->header.sh_size / (2 * tgt_sizeof_char_p);
2921 sec = obj_find_section(f, ".kmodtab");
2922 module->deps = sec->header.sh_addr;
2931 sec = obj_find_section(f, "__ex_table");
2932 if (sec) {
2933 module->ex_table_start = sec->header.sh_addr;
2934 module->ex_table_end = sec->header.sh_addr + sec->header.sh_size;
2937 sec = obj_find_section(f, ".text.init");
2938 if (sec) {
2939 module->runsize = sec->header.sh_addr - m_addr;
2941 sec = obj_find_section(f, ".data.init");
2942 if (sec) {
2944 module->runsize > sec->header.sh_addr - m_addr)
2945 module->runsize = sec->header.sh_addr - m_addr;
2947 sec = obj_find_section(f, ARCHDATA_SEC_NAME);
2948 if (sec && sec->header.sh_size) {
2949 module->archdata_start = (void*)sec->header.sh_addr;
2950 module->archdata_end = module->archdata_start + sec->header.sh_size;
2952 sec = obj_find_section(f, KALLSYMS_SEC_NAME);
2953 if (sec && sec->header.sh_size) {
2954 module->kallsyms_start = (void*)sec->header.sh_addr;
2955 module->kallsyms_end = module->kallsyms_start + sec->header.sh_size;
3099 struct obj_section *sec;
3101 f->sections = xrealloc(f->sections, (i + 1) * sizeof(sec));
3102 f->sections[i] = sec = arch_new_section();
3105 memset(sec, 0, sizeof(*sec));
3106 sec->header.sh_type = SHT_PROGBITS;
3107 sec->header.sh_flags = SHF_WRITE | SHF_ALLOC;
3108 sec->name = ".bss";
3109 sec->idx = i;
3157 struct obj_section *sec;
3161 for (sec = f->load_order; sec; sec = sec->load_next) {
3164 align = sec->header.sh_addralign;
3168 sec->header.sh_addr = dot;
3169 dot += sec->header.sh_size;
3307 struct obj_section *sec;
3310 for (sec = f->load_order; sec; sec = sec->load_next) {
3313 if (sec->contents == 0 || sec->header.sh_size == 0)
3316 secimg = image + (sec->header.sh_addr - base);
3319 memcpy(secimg, sec->contents, sec->header.sh_size);
3391 struct obj_section *sec;
3393 f->sections[i] = sec = arch_new_section();
3394 memset(sec, 0, sizeof(*sec));
3396 sec->header = section_headers[i];
3397 sec->idx = i;
3399 if (sec->header.sh_size) {
3400 switch (sec->header.sh_type) {
3410 sec->contents = NULL;
3417 if (sec->header.sh_size > 0) {
3418 sec->contents = xmalloc(sec->header.sh_size);
3419 fseek(fp, sec->header.sh_offset, SEEK_SET);
3420 if (fread(sec->contents, sec->header.sh_size, 1, fp) != 1) {
3425 sec->contents = NULL;
3440 if (sec->header.sh_type >= SHT_LOPROC) {
3449 (long) sec->header.sh_type);
3460 struct obj_section *sec = f->sections[i];
3461 sec->name = shstrtab + sec->header.sh_name;
3465 struct obj_section *sec = f->sections[i];
3470 if (strcmp(sec->name, ".modinfo") == 0)
3471 sec->header.sh_flags &= ~SHF_ALLOC;
3473 if (sec->header.sh_flags & SHF_ALLOC)
3474 obj_insert_section_load_order(f, sec);
3476 switch (sec->header.sh_type) {
3483 if (sec->header.sh_entsize != sizeof(ElfW(Sym))) {
3485 (unsigned long) sec->header.sh_entsize,
3490 nsym = sec->header.sh_size / sizeof(ElfW(Sym));
3491 strtab = f->sections[sec->header.sh_link]->contents;
3492 sym = (ElfW(Sym) *) sec->contents;
3495 j = f->local_symtab_size = sec->header.sh_info;
3526 if (sec->header.sh_entsize != sizeof(ElfW(RelM))) {
3528 (unsigned long) sec->header.sh_entsize,
3548 struct obj_section* sec;
3550 for (sec = f->load_order; sec; sec = sec->load_next) {
3553 if (sec->contents != NULL)
3556 if (sec->header.sh_size == 0)
3559 sec->contents = imagebase + (sec->header.sh_addr - base);
3560 fseek(fp, sec->header.sh_offset, SEEK_SET);
3561 if (fread(sec->contents, sec->header.sh_size, 1, fp) != 1) {
3594 struct obj_section *sec;
3607 sec = obj_find_section(f, ".modinfo");
3608 if (sec) {
3610 ptr = sec->contents;
3611 endptr = ptr + sec->header.sh_size;
3739 struct obj_section *sec;
3770 sec = obj_find_section(f, ".this");
3771 if (sec) {
3796 sec->idx, sec->header.sh_addr, 0);
3814 sec->idx, sec->header.sh_addr, 0);
3822 sec = obj_find_section(f, section_names[i]);
3823 if (sec && sec->header.sh_size) {
3827 strlen(sec->name)+ /* section name */
3833 symprefix, m_name, sec->name,
3834 (long)sec->header.sh_size);
3836 sec->idx, sec->header.sh_addr, 0);
3847 struct obj_section *sec;
3858 for (sec = f->load_order; sec; sec = sec->load_next) {
3862 for (a = -1, tmp = sec->header.sh_addralign; tmp; ++a)
3868 sec->name,
3869 (long)sec->header.sh_size,
3871 (long)sec->header.sh_addr,
3911 sec = f->sections[sym->secidx];
3913 if (sec->header.sh_type == SHT_NOBITS)
3915 else if (sec->header.sh_flags & SHF_ALLOC) {
3916 if (sec->header.sh_flags & SHF_EXECINSTR)
3918 else if (sec->header.sh_flags & SHF_WRITE)
3923 value = sym->value + sec->header.sh_addr;