config_fb_vesa不设置,不能启动radeon模块的原因分析

来源:互联网 发布:linq for java 编辑:程序博客网 时间:2024/05/22 03:04
/* Allocate and load the module: note that size of section 0 is always
   zero, and we rely on this for optional sections. */
static int load_module(struct load_info *info, const char __user *uargs,
               int flags)
{
    struct module *mod;
    long err;
    char *after_dashes;

    err = module_sig_check(info);
    if (err)
        goto free_copy;

    err = elf_header_check(info);
    if (err)
        goto free_copy;

    /* Figure out module layout, and allocate all the memory. */
    mod = layout_and_allocate(info, flags);
    if (IS_ERR(mod)) {
        err = PTR_ERR(mod);
        goto free_copy;
    }

    /* Reserve our place in the list. */
    err = add_unformed_module(mod);
    if (err)
        goto free_module;

#ifdef CONFIG_MODULE_SIG
    mod->sig_ok = info->sig_ok;
    if (!mod->sig_ok) {
        pr_notice_once("%s: module verification failed: signature "
                   "and/or  required key missing - tainting "
                   "kernel\n", mod->name);
        add_taint_module(mod, TAINT_UNSIGNED_MODULE, LOCKDEP_STILL_OK);
    }
#endif

    /* To avoid stressing percpu allocator, do this once we're unique. */
    err = percpu_modalloc(mod, info);
    if (err)
        goto unlink_mod;

    /* Now module is in final location, initialize linked lists, etc. */
    err = module_unload_init(mod);
    if (err)
        goto unlink_mod;

    /* Now we've got everything in the final locations, we can
     * find optional sections. */
    err = find_module_sections(mod, info);
    if (err)
        goto free_unload;

    err = check_module_license_and_versions(mod);
    if (err)
        goto free_unload;

    /* Set up MODINFO_ATTR fields */
    setup_modinfo(mod, info);

    /* Fix up syms, so that st_value is a pointer to location. */
    err = simplify_symbols(mod, info);
    if (err < 0)
        goto free_modinfo;




/* Change all symbols so that st_value encodes the pointer directly. */
static int simplify_symbols(struct module *mod, const struct load_info *info)
{
    Elf_Shdr *symsec = &info->sechdrs[info->index.sym];
    Elf_Sym *sym = (void *)symsec->sh_addr;
    unsigned long secbase;
    unsigned int i;
    int ret = 0;
    const struct kernel_symbol *ksym;

    for (i = 1; i < symsec->sh_size / sizeof(Elf_Sym); i++) {
        const char *name = info->strtab + sym[i].st_name;

        switch (sym[i].st_shndx) {
        case SHN_COMMON:
            /* Ignore common symbols */
            if (!strncmp(name, "__gnu_lto", 9))
                break;

            /* We compiled with -fno-common.  These are not
               supposed to happen.  */
            pr_debug("Common symbol: %s\n", name);
            printk("%s: please compile with -fno-common\n",
                   mod->name);
            ret = -ENOEXEC;
            break;

        case SHN_ABS:
            /* Don't need to do anything */
            pr_debug("Absolute symbol: 0x%08lx\n",
                   (long)sym[i].st_value);
            break;

        case SHN_UNDEF:
            ksym = resolve_symbol_wait(mod, info, name);
            /* Ok if resolved.  */
            if (ksym && !IS_ERR(ksym)) {
                sym[i].st_value = ksym->value;
                break;
            }

            /* Ok if weak.  */
            if (!ksym && ELF_ST_BIND(sym[i].st_info) == STB_WEAK)
                break;

            pr_warn("%s: Unknown symbol %s (err %li)\n",
                mod->name, name, PTR_ERR(ksym));

            ret = PTR_ERR(ksym) ?: -ENOENT;
            break;

        default:
            /* Divert to percpu allocation if a percpu var. */
            if (sym[i].st_shndx == info->index.pcpu)
                secbase = (unsigned long)mod_percpu(mod);
            else
                secbase = info->sechdrs[sym[i].st_shndx].sh_addr;
            sym[i].st_value += secbase;
            break;
        }
    }

    return ret;
}


 pr_warn("%s: Unknown symbol %s (err %li)\n",
                mod->name, name, PTR_ERR(ksym));


grep -rn "Unknown symbol" ./*
./arch/arm/kernel/unwind.c:160:        pr_warn("unwind: Unknown symbol address %08lx\n", addr);
./arch/mips/kernel/module.c:221:            printk(KERN_WARNING "%s: Unknown symbol %s\n",
./arch/mips/kernel/module-rela.c:132:            printk(KERN_WARNING "%s: Unknown symbol %s\n",
./arch/parisc/kernel/module.c:572:            printk(KERN_WARNING "%s: Unknown symbol %s\n",
./arch/parisc/kernel/module.c:708:            printk(KERN_WARNING "%s: Unknown symbol %s\n",
匹配到二进制文件 ./arch/x86/boot/compressed/vmlinux.bin
./kernel/module.c:1981:            pr_warn("%s: Unknown symbol %s (err %li)\n",
匹配到二进制文件 ./kernel/module.o
匹配到二进制文件 ./kernel/built-in.o
./scripts/kconfig/symbol.c:868: * name to be expanded shall be prefixed by a '$'. Unknown symbol expands to
匹配到二进制文件 ./vmlinux
匹配到二进制文件 ./vmlinux.o

[   21.511318] radeon: Unknown symbol cfb_copyarea (err 0)
[   21.522742] radeon: Unknown symbol cfb_imageblit (err 0)
[   21.522941] radeon: Unknown symbol cfb_fillrect (err 0)



objdump -t vesafb.o >vesafbot.txt

vesafb.o:     文件格式 elf32-i386

SYMBOL TABLE:
00000000 l    df *ABS*    00000000 vesafb.c
00000000 l    d  .text    00000000 .text
00000000 l    d  .data    00000000 .data
00000000 l    d  .bss    00000000 .bss
00000000 l     F .text    0000003a vesafb_pan_display
0000000c l     O .data..read_mostly    00000004 pmi_start
00000000 l    d  .init.text    00000000 .init.text
00000000 l     F .init.text    00000011 vesafb_driver_init
00000000 l     O .data    00000058 vesafb_driver
00000040 l     F .text    0000001a vesafb_remove
00000060 l     F .text    00000039 vesafb_destroy
00000000 l    d  .exit.text    00000000 .exit.text
00000000 l     F .exit.text    0000000f vesafb_driver_exit
000000a0 l     F .text    000001b1 vesafb_setcolreg
00000000 l     O .data..read_mostly    00000004 vga_compat
00000004 l     O .data..read_mostly    00000004 depth
00000014 l     O .data..read_mostly    00000004 pmi_setpal
00000008 l     O .data..read_mostly    00000004 pmi_pal
00000000 l    d  .rodata.str1.1    00000000 .rodata.str1.1
00000000 l    d  .rodata.str1.4    00000000 .rodata.str1.4
00000260 l     F .text    00000952 vesafb_probe
0000001c l     O .data..read_mostly    00000004 inverse
000000c0 l     O .data    00000044 vesafb_fix
00000120 l     O .data    000000a0 vesafb_defined
00000000 l     O .bss    00000004 vram_total
00000004 l     O .bss    00000004 vram_remap
00000010 l     O .data..read_mostly    00000004 ypan
00000018 l     O .data..read_mostly    00000004 mtrr
00000060 l     O .data    00000060 vesafb_ops
00000000 l     O .rodata    0000000c CSWTCH.197
00000000 l    d  .rodata    00000000 .rodata
00000000 l    d  .exitcall.exit    00000000 .exitcall.exit
00000000 l     O .exitcall.exit    00000004 __exitcall_vesafb_driver_exit
00000000 l    d  .initcall6.init    00000000 .initcall6.init
00000000 l     O .initcall6.init    00000004 __initcall_vesafb_driver_init6
00000000 l    d  .data..read_mostly    00000000 .data..read_mostly
00000000 l    d  .note.GNU-stack    00000000 .note.GNU-stack
00000000 l    d  .comment    00000000 .comment
00000000         *UND*    00000000 __platform_driver_register
00000000         *UND*    00000000 unregister_framebuffer
00000000         *UND*    00000000 framebuffer_release
00000000         *UND*    00000000 fb_dealloc_cmap
00000000         *UND*    00000000 iounmap
00000000         *UND*    00000000 iomem_resource
00000000         *UND*    00000000 __release_region
00000000         *UND*    00000000 platform_driver_unregister
00000000         *UND*    00000000 native_io_delay
00000000         *UND*    00000000 fb_get_options
00000000         *UND*    00000000 strsep
00000000         *UND*    00000000 strcmp
00000000         *UND*    00000000 screen_info
00000000         *UND*    00000000 __request_region
00000000         *UND*    00000000 framebuffer_alloc
00000000         *UND*    00000000 kmalloc_caches
00000000         *UND*    00000000 kmem_cache_alloc
00000000         *UND*    00000000 printk
00000000         *UND*    00000000 ioport_resource
00000000         *UND*    00000000 ioremap_wc
00000000         *UND*    00000000 fb_alloc_cmap
00000000         *UND*    00000000 register_framebuffer
00000000         *UND*    00000000 strncmp
00000000         *UND*    00000000 simple_strtoul
00000000         *UND*    00000000 ioremap_cache
00000000         *UND*    00000000 mtrr_add
00000000         *UND*    00000000 ioremap_nocache
00000000         *UND*    00000000 cfb_fillrect
00000000         *UND*    00000000 cfb_copyarea
00000000         *UND*    00000000 cfb_imageblit

0 0
原创粉丝点击