linux模块加载

EXPORT_SYMBOL(schedule);


#if defined(MODVERSIONS) || !defined(CONFIG_MODVERSIONS)

#define EXPORT_SYMBOL(var)  __EXPORT_SYMBOL(var, __MODULE_STRING(var))


#define __MODULE_STRING_1(x) #x

#define __MODULE_STRING(x) __MODULE_STRING_1(x)

变成:

__EXPORT_SYMBOL(schedule, “schedule”);

#define __EXPORT_SYMBOL(sym, str) \
const char __kstrtab_##sym[] \
__attribute__((section(".kstrtab"))) = str; \
const struct module_symbol __ksymtab_##sym \
__attribute__((section("__ksymtab"))) = \

{ (unsigned long)&sym, __kstrtab_##sym }


const char __kstrtab_schedule[]  __attribute__((section(".kstrtab"))) = “schedule”;

const struct module_symbol __ksymtab_schedule   __attribute__((section("__ksymtab"))) 

={ (unsigned long)&schedule, __kstrtab_schedule }


{
  . = 0xC0000000 + 0x100000;
  _text = .; /* Text and read-only data */
  .text : {
*(.text)
*(.fixup)
*(.gnu.warning)
} = 0x9090
  .text.lock : { *(.text.lock) } /* out-of-line lock text */


  _etext = .; /* End of text section */


  .rodata : { *(.rodata) *(.rodata.*) }
  .kstrtab : { *(.kstrtab) }


  . = ALIGN(16); /* Exception table */
  __start___ex_table = .;
  __ex_table : { *(__ex_table) }
  __stop___ex_table = .;


  __start___ksymtab = .; /* Kernel symbol table */
  __ksymtab : { *(__ksymtab) }
  __stop___ksymtab = .;


  .data : { /* Data */
*(.data)
CONSTRUCTORS
}


  _edata = .; /* End of data section */


  . = ALIGN(8192); /* init_task */
  .data.init_task : { *(.data.init_task) }


  . = ALIGN(4096); /* Init code and data */
  __init_begin = .;
  .text.init : { *(.text.init) }
  .data.init : { *(.data.init) }
  . = ALIGN(16);
  __setup_start = .;
  .setup.init : { *(.setup.init) }
  __setup_end = .;
  __initcall_start = .;
  .initcall.init : { *(.initcall.init) }
  __initcall_end = .;
  . = ALIGN(4096);
  __init_end = .;


  . = ALIGN(4096);
  .data.page_aligned : { *(.data.idt) }


  . = ALIGN(32);
  .data.cacheline_aligned : { *(.data.cacheline_aligned) }


  __bss_start = .; /* BSS */
  .bss : {
*(.bss)
}
  _end = . ;

}



  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值