windows-drivers-rs icon indicating copy to clipboard operation
windows-drivers-rs copied to clipboard

rust-lld.exe is not compatible with (kernel-mode) driver

Open seritools opened this issue 7 months ago • 1 comments

Not sure if this would be in scope for the repo, but would be nice to have documented somewhere.

I wasn't able to get a valid kernel driver binary going. Even the minimal return 0 DriverEntry example resulted in:

PS C:\driver> sc start drivertest
[SC] StartService FAILED 998:

Invalid access to memory location.

It turns out I had a linker override set in my .cargo\config.toml:

[target.x86_64-pc-windows-msvc]
linker = "rust-lld.exe"

This which works fine for user-mode rust application, but apparently doesn't support all the linker args for kernel drivers correctly.

seritools avatar Jul 03 '24 13:07 seritools