Re: Modutils patch needs some more work?
On Sat, 4 Oct 2003 15:07:23 +0200,
Arnd Bergmann <arnd@arndb.de> wrote:
>On Saturday 04 October 2003 13:26, Tony Hoyle wrote:
>> struct ieee1394_device_id {
>> u32 match_flags;
>> u32 vendor_id;
>> u32 model_id;
>> u32 specifier_id;
>> u32 version;
>> void *driver_data;
>> };
>
>Actually, the problem is a little more tricky. The modutils already handle
>pointers in device_id fields correctly for anything except ieee1394.
>The problem here is padding: on ia32, uint64_t variables are 4 byte aligned,
>while they are 8 byte aligned on amd64 and the compiler there inserts
>an empty word between version and driver_data.
Ignore m previous mail, I had the problem backwards. ia32 uint64_t
variables are defined as long long which defaults to 4 byte alignment
when compiled on a 32 bit machine. The generic fix for that problem is
to compile with the -malign-double flag. That will fix all uses of
long long when compiling for 64 bit.
Please try this patch, with the original definition of
ieee1394_device_id driver_data (i.e. no attribute aligned changes in
the code).
Index: 26.2/depmod/Makefile.in
--- 26.2/depmod/Makefile.in Sat, 29 Mar 2003 10:54:20 +1100 kaos (modutils-2.4/22_Makefile.i 1.1.1.4 644)
+++ 26.2(w)/depmod/Makefile.in Sun, 05 Oct 2003 14:58:00 +1000 kaos (modutils-2.4/22_Makefile.i 1.1.1.4 644)
@@ -29,7 +29,7 @@ endif
ifdef DEFS64
DEFSNOARCH += -DCOMMON_3264
DEFS += -DONLY_32
-DEFS64 += -DONLY_64
+DEFS64 += -DONLY_64 -malign-double
OBJS += depmod_64.o
endif
Index: 26.2/insmod/Makefile.in
--- 26.2/insmod/Makefile.in Sat, 29 Mar 2003 10:54:20 +1100 kaos (modutils-2.4/b/4_Makefile.i 1.2.1.9 644)
+++ 26.2(w)/insmod/Makefile.in Sun, 05 Oct 2003 14:59:02 +1000 kaos (modutils-2.4/b/4_Makefile.i 1.2.1.9 644)
@@ -58,7 +58,7 @@ endif
MODINFOOBJS += modinfo_64.o
DEFSNOARCH += -DCOMMON_3264
DEFS += -DONLY_32
-DEFS64 += -DONLY_64
+DEFS64 += -DONLY_64 -malign-double
DEFS64 += -DTAINT_URL='"$(TAINT_URL)"'
endif
Index: 26.2/obj/Makefile.in
--- 26.2/obj/Makefile.in Sat, 29 Mar 2003 10:54:20 +1100 kaos (modutils-2.4/c/3_Makefile.i 1.1.1.5 644)
+++ 26.2(w)/obj/Makefile.in Sun, 05 Oct 2003 14:59:19 +1000 kaos (modutils-2.4/c/3_Makefile.i 1.1.1.5 644)
@@ -41,7 +41,7 @@ ifdef DEFS64
LIBOBJ_OBJS += obj_kallsyms_64.o obj_common_64.o obj_load_64.o obj_reloc_64.o obj_gpl_license_64.o
DEFSNOARCH += -DCOMMON_3264
DEFS += -DONLY_32
-DEFS64 += -DONLY_64
+DEFS64 += -DONLY_64 -malign-double
endif
%.o: %.c
Reply to: