我正在编译Linux4.19(gcc-8.2 bintutils-2.31),但是它总是失败,错误如下:
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
我尝试了下面的解决方案,但这些都没有奏效。
-fPIC
标志发布于 2021-02-17 22:15:47
问题不是重新定位,而是以下警告(应该出现在错误之前)
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
,就可以设置了。
https://stackoverflow.com/questions/58689931
复制相似问题