首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >如何修复“危险迁移:无支持的迁移”

如何修复“危险迁移:无支持的迁移”
EN

Stack Overflow用户
提问于 2019-11-04 08:54:35
回答 1查看 6.1K关注 0票数 5

我正在编译Linux4.19(gcc-8.2 bintutils-2.31),但是它总是失败,错误如下:

代码语言:javascript
运行
复制
aarch64-oe-linux-ld.bfd: drivers/platform/gsi/gsi.o: relocation R_AARCH64_ABS32 against `__crc_gsi_write_channel_scratch' can not be used when making a shared object
aarch64-oe-linux-ld.bfd: drivers/platform/gsi/gsi.o:/usr/src/kernel/drivers/platform/gsi/gsi.c:4383:(.data+0x0): dangerous relocation: unsupported relocation
aarch64-oe-linux-ld.bfd: drivers/platform/gsi/gsi.o:(.data+0x28): dangerous relocation: unsupported relocation
aarch64-oe-linux-ld.bfd: drivers/platform/gsi/gsi.o:(.data+0x50): dangerous relocation: unsupported relocation
aarch64-oe-linux-ld.bfd: drivers/platform/gsi/gsi.o:(__verbose+0x0): dangerous relocation: unsupported relocation
aarch64-oe-linux-ld.bfd: drivers/platform/gsi/gsi.o:(__verbose+0x8): dangerous relocation: unsupported relocation

我尝试了下面的解决方案,但这些都没有奏效。

  1. 向驱动程序中添加-fPIC标志
  2. 使用gcc-7.3 (binutils-2.31)
  3. 使用二进制-2.33 (gcc-8.2)
EN

回答 1

Stack Overflow用户

发布于 2021-02-17 22:15:47

问题不是重新定位,而是以下警告(应该出现在错误之前)

代码语言:javascript
运行
复制
WARNING: EXPORT symbol "gsi_write_channel_scratch" [vmlinux] version generation failed, symbol will not be versioned.

如果你读到更多关于genksyms 这里的文章,你就会明白它会抱怨,因为它不能在它抱怨的地方之前解析一些东西。在这种情况下,问题是__packed返回类型(它不理解)。__packed只在声明结构和联合时才有用。我想函数参数作为文档使用是有意义的,但是没有必要。

因此,只需从前面的函数__packed返回类型中删除__gsi_update_mhi_channel_scratch,就可以设置了。

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/58689931

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档