I'm compiling linux-4.19(gcc-8.2 bintutils-2.31), however it always fails with errors like:
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
I've tried below solutions, but these didn't work.
-fPIC
flag to the driverThe problem is not the relocation, it is the following warning (should appear before the error)
WARNING: EXPORT symbol "gsi_write_channel_scratch" [vmlinux] version generation failed, symbol will not be versioned.
If you read more about genksyms here you'll understand that it complains because it can't parse something before the place it complains about. In this particular case the issue is a __packed
return type (which it doesn't understand). __packed
is only useful when declaring structs and unions. I guess it makes sense for function arguments to serve as documentation, but it's not necessary.
So just drop __packed
from the previous function __gsi_update_mhi_channel_scratch
return type and you're set.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With