0001
0002 #ifndef _ASM_ARM_MODULE_H
0003 #define _ASM_ARM_MODULE_H
0004
0005 #include <asm-generic/module.h>
0006 #include <asm/unwind.h>
0007
0008 #ifdef CONFIG_ARM_UNWIND
0009 #define ELF_SECTION_UNWIND 0x70000001
0010 #endif
0011
0012 #define PLT_ENT_STRIDE L1_CACHE_BYTES
0013 #define PLT_ENT_COUNT (PLT_ENT_STRIDE / sizeof(u32))
0014 #define PLT_ENT_SIZE (sizeof(struct plt_entries) / PLT_ENT_COUNT)
0015
0016 struct plt_entries {
0017 u32 ldr[PLT_ENT_COUNT];
0018 u32 lit[PLT_ENT_COUNT];
0019 };
0020
0021 struct mod_plt_sec {
0022 struct elf32_shdr *plt;
0023 struct plt_entries *plt_ent;
0024 int plt_count;
0025 };
0026
0027 struct mod_arch_specific {
0028 #ifdef CONFIG_ARM_UNWIND
0029 struct list_head unwind_list;
0030 struct unwind_table *init_table;
0031 #endif
0032 #ifdef CONFIG_ARM_MODULE_PLTS
0033 struct mod_plt_sec core;
0034 struct mod_plt_sec init;
0035 #endif
0036 };
0037
0038 struct module;
0039 u32 get_module_plt(struct module *mod, unsigned long loc, Elf32_Addr val);
0040
0041 #ifdef CONFIG_THUMB2_KERNEL
0042 #define HAVE_ARCH_KALLSYMS_SYMBOL_VALUE
0043 static inline unsigned long kallsyms_symbol_value(const Elf_Sym *sym)
0044 {
0045 if (ELF_ST_TYPE(sym->st_info) == STT_FUNC)
0046 return sym->st_value & ~1;
0047
0048 return sym->st_value;
0049 }
0050 #endif
0051
0052 #endif