2005-09-30 18:11:16

by Shaun Jackman

[permalink] [raw]
Subject: Building a 64-bit module on i386

Hello,

I'm running the Debian i386 architecture on a amd64-k8 running an
amd64-k8 Linux kernel. I'm trying to compile a module (fuse
inicdentally) for my 64-bit kernel. I'm compiling the module using
ARCH=x86_64 CC='gcc-3.4 -m64'. This method compiles all the object
files, but modpost fails:
Building modules, stage 2.
scripts/mod/modpost -i
/usr/src/kernel-headers-2.6.11-9-amd64-k8/Module.symvers
/home/sjackman/src/modules/usr_src/modules/fuse/kernel/fuse.o
modpost: /home/sjackman/src/modules/usr_src/modules/fuse/kernel/fuse.o
no symtab?

Some debugging of modpost shows that in parse_elf, hdr->e_shnum is 0,
whereas readelf says that it is 20. Any suggestions?

Please cc me in your reply. Cheers,
Shaun

$ uname -a
Linux jinx.pathway.internal 2.6.11-9-amd64-k8 #1 Mon Jun 27 22:07:27
MDT 2005 x86_64 GNU/Linux
$ readelf -h fuse.o
ELF Header:
Magic: 7f 45 4c 46 02 01 01 00 00 00 00 00 00 00 00 00
Class: ELF64
Data: 2's complement, little endian
Version: 1 (current)
OS/ABI: UNIX - System V
ABI Version: 0
Type: REL (Relocatable file)
Machine: Advanced Micro Devices X86-64
Version: 0x1
Entry point address: 0x0
Start of program headers: 0 (bytes into file)
Start of section headers: 23432 (bytes into file)
Flags: 0x0
Size of this header: 64 (bytes)
Size of program headers: 0 (bytes)
Number of program headers: 0
Size of section headers: 64 (bytes)
Number of section headers: 20
Section header string table index: 17