Hi All,

I have the following 64-bit linking problem with a device driver:

$ gcc -D_KERNEL -m64 -mcmodel=kernel -mno-red-zone -ffreestanding 
-nodefaultlibs -c driver-test.c
$ ld -r -o driver-test driver-test.o
[b]ld: Relocatable linking with relocations from format elf64-x86-64 
(driver-test.o) to format elf32-i386 (driver-test) is not supported[/b]

I am running a 64-bit OpenSolaris 2008.11. Even though 32-bit drivers compile 
fine, they cannot be loaded:

$ gcc -D_KERNEL -ffreestanding -nodefaultlibs -c driver-test.c
$ ld -r -o driver-test driver-test.o
$ cp driver-test /tmp
$ cat driver-test.conf 
name="driver-test" parent="pseudo";
$ cp driver-test.conf /tmp
$ ln -s /tmp/driver-test /usr/kernel/drv/driver-test
$ ln -s /tmp/driver-test.conf /usr/kernel/drv/driver-test.conf
$ add_drv driver-test
No 64-bit version of (driver-test) found; 32-bit version of this driver exists.
[b]32-bit driver (driver-test) not loadable on 64-bit kernel.[/b]
System configuration files modified but driver-test driver not loaded or 
attached.

Forcing ld to output in 64-bit format gives more puzzling results:

$ ld --oformat elf64-x86-64 -r -o driver-test driver-test.o
[b]ld: Relocatable linking with relocations from format elf64-x86-64 
(driver-test.o) to format elf64-x86-64 (driver-test) is not supported[/b]


I followed the "Device Driver Tutorial" book as closely as possible. Google did 
not turn up anything useful. Any help would be appreciated. Thanks!

Cheers,
Rouslan
-- 
This message posted from opensolaris.org

Reply via email to