Linux加载ko出现unknown relocation: 38 的解决办法
来源:互联网 发布:北京北大软件上班 编辑:程序博客网 时间:2024/05/04 19:19
Kernel module build with GCOV profiling fails to load with thefollowing error: $ insmod test_module.ko test_module: unknown relocation: 38 insmod: can't insert 'test_module.ko': invalid module formatThis happens because constructor pointers in the .init_array sectionhave not supported R_ARM_TARGET1 relocation type.Documentation (ELF for the ARM Architecture) says: "The relocation must be processed either in the same way as R_ARM_REL32 or as R_ARM_ABS32: a virtual platform must specify which method is used."Since kernel expects to see absolute addresses in .init_array R_ARM_TARGET1relocation type should be treated the same way as R_ARM_ABS32.Signed-off-by: Andrey Ryabinin <a.ryabinin@samsung.com>--- arch/arm/include/asm/elf.h | 1 + arch/arm/kernel/module.c | 1 + 2 files changed, 2 insertions(+)diff --git a/arch/arm/include/asm/elf.h b/arch/arm/include/asm/elf.hindex f4b46d3..afb9caf 100644--- a/arch/arm/include/asm/elf.h+++ b/arch/arm/include/asm/elf.h@@ -50,6 +50,7 @@ typedef struct user_fp elf_fpregset_t; #define R_ARM_ABS322 #define R_ARM_CALL28 #define R_ARM_JUMP2429+#define R_ARM_TARGET138 #define R_ARM_V4BX40 #define R_ARM_PREL3142 #define R_ARM_MOVW_ABS_NC43diff --git a/arch/arm/kernel/module.c b/arch/arm/kernel/module.cindex 45e4781..6a4dffe 100644--- a/arch/arm/kernel/module.c+++ b/arch/arm/kernel/module.c@@ -91,6 +91,7 @@ apply_relocate(Elf32_Shdr *sechdrs, const char *strtab, unsigned int symindex, break; case R_ARM_ABS32:+case R_ARM_TARGET1: *(u32 *)loc += sym->st_value; break; -- 1.8.5.5
0 0
- Linux加载ko出现unknown relocation: 38 的解决办法
- linux加载ko时出现Unknown symbol 错误(调用了EXPORT_SYMBOL出来的函数)
- linux ko 导出函数 出现unknown symbols
- linux驱动模块加载出错insmod: error inserting './usb_driver.ko': -1 Unknown symbol in module
- linux ko文件自动加载
- 让 Linux 启动时加载自己的驱动模块 .ko
- 让 Linux 启动时加载自己的驱动模块 .ko
- centos扩容,出现unknown device的物理卷的解决办法
- Linux 出现unknown host
- windows xp USB出现Unknown Device的解决办法(转)
- 开机出现 Grub error: unknown file system 的解决办法
- hbase中出现unknown table错误的解决办法
- virtualbox挂载时出现 mount: unknown filesystem type 'vboxsf' 的解决办法
- ubuntu 12.04出现insmod: error inserting 'hello.ko': -1 Device or resource busy的解决办法
- linux下出现ping:unknown host www.baidu.com问题时的解决办法——ubuntu下局域网络的配置
- linux下出现ping:unknown host www.baidu.com问题时的解决办法——ubuntu下局域网络的配置
- linux下出现ping:unknown host www.baidu.com问题时的解决办法——ubuntu下局域网络的配置
- linux下出现ping:unknown host www.baidu.com问题时的解决办法——ubuntu下局域网络的配置
- 通讯录
- 从接收机的角度播放epg节目
- ASP.NET和ASP.NET MVC的区别
- C学习之回调函数
- Maven 的安装和配置
- Linux加载ko出现unknown relocation: 38 的解决办法
- 《移动游戏开发精要》书评【跟我一样小白的,推荐这本书哦】
- 记录工作时常用命令
- Salesforce开发入门
- JPA整合Spring
- Android-GPS详解
- 延迟显示子菜单方法
- Android Zxing 二维码添加 开 关 灯 的功能
- Java NIO系列教程(十二) Java NIO与IO