rust-for-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* drivers/char/rust_example fails to load
@ 2021-03-22  0:13 Joshua Abraham
  2021-03-22  1:01 ` Miguel Ojeda
  0 siblings, 1 reply; 7+ messages in thread
From: Joshua Abraham @ 2021-03-22  0:13 UTC (permalink / raw)
  To: ojeda, alex.gaynor, rust-for-linux, linux-kernel

I am building Rust-for-Linux at commit
e9b9c0ef1e7040a3c3dc2232d5fd64999eba61a0 with "make CC=clang-11" and
the built kernel fails to load rust_example.ko with the following
error:

[ 1653.507602] module: rust_example: Unknown rela relocation: 9

Looking at elf.h shows this relocation is type GOTPCREL:
#define R_X86_64_GOTPCREL 9 /* 32 bit signed PC relative offset to GOT */

Sure enough rust_example.ko contains a few of these entries, and no
other kernel module does:
000000000a51 008800000009 R_X86_64_GOTPCREL 0000000000000000
_RNvXsb_NtCshGpAVYOtgW - 4
000000000f15  008700000009 R_X86_64_GOTPCREL 0000000000000000
_RNvXs2_NtNtNtCshGpAVY - 4
000000001307 005300000009 R_X86_64_GOTPCREL 0000000000000000
_RNvXs6_NtNtNtCshGpAVY - 4

I assume that this is an issue with my rust toolchain, however I'm
reporting it here since it might be helpful to update documentation or
(unlikely) add support for this relocation type in the kernel.

Host/environment info:
$ uname -a
Linux pop-os 5.8.0-7642-generic #47~1614007149~20.04~82fb226-Ubuntu
SMP Tue Feb 23 02:56:27 UTC
$ rustup show active-toolchain
nightly-x86_64-unknown-linux-gnu (default)
$ rustc --version
rustc 1.52.0-nightly (61edfd591 2021-03-20)
$ clang-11 --version
Ubuntu clang version 11.0.0-2~ubuntu20.04.1
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin


-- 
Respectfully,
Josh Abraham

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-03-23  1:25 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-22  0:13 drivers/char/rust_example fails to load Joshua Abraham
2021-03-22  1:01 ` Miguel Ojeda
2021-03-22  2:53   ` Joshua Abraham
2021-03-22  6:53     ` drivers/char/rust_example fails to load 2021-03-20 builds Geert Stappers
2021-03-22  8:22       ` Adam Bratschi-Kaye
2021-03-22 12:20     ` drivers/char/rust_example fails to load Miguel Ojeda
2021-03-23  1:24       ` Miguel Ojeda

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).