]> git.neil.brown.name Git - history.git/commitdiff
kbuild: Fix kallsyms on 64 bit archs
authorKai Germaschewski <kai@tp1.ruhr-uni-bochum.de>
Mon, 30 Dec 2002 16:14:32 +0000 (10:14 -0600)
committerKai Germaschewski <kai@tp1.ruhr-uni-bochum.de>
Mon, 30 Dec 2002 16:14:32 +0000 (10:14 -0600)
The generated .tmp_kallsyms.S needs to use .long / .quad for
32/64 bit archs. To know which arch we're compiling for, we
use the preprocessor and BITS_PER_LONG from <asm/types.h>.

Unfortunately, asm/types.h was not safe to include from assembler
files, so lots of #ifndef __ASSEMBLY__ needed to be added - should
be fine now, untested for != i386, though.

20 files changed:
include/asm-alpha/types.h
include/asm-arm/types.h
include/asm-cris/types.h
include/asm-i386/types.h
include/asm-ia64/types.h
include/asm-m68k/types.h
include/asm-m68knommu/types.h
include/asm-mips/types.h
include/asm-mips64/types.h
include/asm-parisc/types.h
include/asm-ppc/types.h
include/asm-ppc64/types.h
include/asm-s390/types.h
include/asm-s390x/types.h
include/asm-sh/types.h
include/asm-sparc/types.h
include/asm-sparc64/types.h
include/asm-v850/types.h
include/asm-x86_64/types.h
scripts/kallsyms.c

index cc8a6dfe1978e9c9f029f61342d54d21797e763d..f5716139ec8987216d954858dfe6229ecd542488 100644 (file)
@@ -9,6 +9,8 @@
  * need to be careful to avoid a name clashes.
  */
 
+#ifndef __ASSEMBLY__
+
 typedef unsigned int umode_t;
 
 /*
@@ -28,11 +30,17 @@ typedef unsigned int __u32;
 typedef __signed__ long __s64;
 typedef unsigned long __u64;
 
+#endif /* __ASSEMBLY__ */
+
 /*
  * These aren't exported outside the kernel to avoid name space clashes
  */
 #ifdef __KERNEL__
 
+#define BITS_PER_LONG 64
+
+#ifndef __ASSEMBLY__
+
 typedef signed char s8;
 typedef unsigned char u8;
 
@@ -45,10 +53,9 @@ typedef unsigned int u32;
 typedef signed long s64;
 typedef unsigned long u64;
 
-#define BITS_PER_LONG 64
-
 typedef u64 dma_addr_t;
 typedef u64 dma64_addr_t;
 
+#endif /* __ASSEMBLY__ */
 #endif /* __KERNEL__ */
 #endif /* _ALPHA_TYPES_H */
index 7b66b95e545154018471934428457f2639def5df..22992ee0627ac3fb5c87bfa4c297184b8bfd1628 100644 (file)
@@ -1,6 +1,8 @@
 #ifndef __ASM_ARM_TYPES_H
 #define __ASM_ARM_TYPES_H
 
+#ifndef __ASSEMBLY__
+
 typedef unsigned short umode_t;
 
 /*
@@ -22,11 +24,17 @@ typedef __signed__ long long __s64;
 typedef unsigned long long __u64;
 #endif
 
+#endif /* __ASSEMBLY__ */
+
 /*
  * These aren't exported outside the kernel to avoid name space clashes
  */
 #ifdef __KERNEL__
 
+#define BITS_PER_LONG 32
+
+#ifndef __ASSEMBLY__
+
 typedef signed char s8;
 typedef unsigned char u8;
 
@@ -39,13 +47,13 @@ typedef unsigned int u32;
 typedef signed long long s64;
 typedef unsigned long long u64;
 
-#define BITS_PER_LONG 32
-
 /* Dma addresses are 32-bits wide.  */
 
 typedef u32 dma_addr_t;
 typedef u32 dma64_addr_t;
 
+#endif /* __ASSEMBLY__ */
+
 #endif /* __KERNEL__ */
 
 #endif
index 787ff7b1d86e9aaf913a6e9168b98b869af4152e..25425c09ddbced27e93f0a121c67235d03335b48 100644 (file)
@@ -1,6 +1,8 @@
 #ifndef _ETRAX_TYPES_H
 #define _ETRAX_TYPES_H
 
+#ifndef __ASSEMBLY__
+
 typedef unsigned short umode_t;
 
 /*
@@ -22,11 +24,17 @@ typedef __signed__ long long __s64;
 typedef unsigned long long __u64;
 #endif
 
+#endif /* __ASSEMBLY__ */
+
 /*
  * These aren't exported outside the kernel to avoid name space clashes
  */
 #ifdef __KERNEL__
 
+#define BITS_PER_LONG 32
+
+#ifndef __ASSEMBLY__
+
 typedef signed char s8;
 typedef unsigned char u8;
 
@@ -39,12 +47,12 @@ typedef unsigned int u32;
 typedef signed long long s64;
 typedef unsigned long long u64;
 
-#define BITS_PER_LONG 32
-
 /* Dma addresses are 32-bits wide, just like our other addresses.  */
  
 typedef u32 dma_addr_t;
 
+#endif /* __ASSEMBLY__ */
+
 #endif /* __KERNEL__ */
 
 #endif
index 6175dba50238afff6e9c3ceb8ae5fab0b46d3a13..b0d0952712842affa3492a1e82c02c29f62ae339 100644 (file)
@@ -1,6 +1,8 @@
 #ifndef _I386_TYPES_H
 #define _I386_TYPES_H
 
+#ifndef __ASSEMBLY__
+
 typedef unsigned short umode_t;
 
 /*
@@ -22,11 +24,17 @@ typedef __signed__ long long __s64;
 typedef unsigned long long __u64;
 #endif
 
+#endif /* __ASSEMBLY__ */
+
 /*
  * These aren't exported outside the kernel to avoid name space clashes
  */
 #ifdef __KERNEL__
 
+#define BITS_PER_LONG 32
+
+#ifndef __ASSEMBLY__
+
 #include <linux/config.h>
 
 typedef signed char s8;
@@ -41,8 +49,6 @@ typedef unsigned int u32;
 typedef signed long long s64;
 typedef unsigned long long u64;
 
-#define BITS_PER_LONG 32
-
 /* DMA addresses come in generic and 64-bit flavours.  */
 
 #ifdef CONFIG_HIGHMEM
@@ -57,6 +63,8 @@ typedef u64 sector_t;
 #define HAVE_SECTOR_T
 #endif
 
+#endif /* __ASSEMBLY__ */
+
 #endif /* __KERNEL__ */
 
 #endif
index 52d0b3b47c81a8921a467f04dd2f03dbf5d5463f..cbdc4247a4c90b13d0360105fe98861afcb55732 100644 (file)
 #ifdef __ASSEMBLY__
 # define __IA64_UL(x)          (x)
 # define __IA64_UL_CONST(x)    x
+
+# ifdef __KERNEL__
+#  define BITS_PER_LONG 64
+# endif
+
 #else
 # define __IA64_UL(x)          ((unsigned long)(x))
 # define __IA64_UL_CONST(x)    x##UL
index 92104425be80337fc18e8a76a54ebf6b7798382e..b5a1febc97d41d2658d6d25552d788ed3f1ce6ca 100644 (file)
@@ -9,6 +9,8 @@
  * need to be careful to avoid a name clashes.
  */
 
+#ifndef __ASSEMBLY__
+
 typedef unsigned short umode_t;
 
 /*
@@ -30,11 +32,17 @@ typedef __signed__ long long __s64;
 typedef unsigned long long __u64;
 #endif
 
+#endif /* __ASSEMBLY__ */
+
 /*
  * These aren't exported outside the kernel to avoid name space clashes
  */
 #ifdef __KERNEL__
 
+#define BITS_PER_LONG 32
+
+#ifndef __ASSEMBLY__
+
 typedef signed char s8;
 typedef unsigned char u8;
 
@@ -47,13 +55,13 @@ typedef unsigned int u32;
 typedef signed long long s64;
 typedef unsigned long long u64;
 
-#define BITS_PER_LONG 32
-
 /* DMA addresses are always 32-bits wide */
 
 typedef u32 dma_addr_t;
 typedef u32 dma64_addr_t;
 
+#endif /* __ASSEMBLY__ */
+
 #endif /* __KERNEL__ */
 
 #endif /* _M68K_TYPES_H */
index 74d147dd6ba8e55f02f460ff993adbedc07ec2b9..e1153959754ec5dbf2d6a8a4f3945c82d5e09128 100644 (file)
@@ -9,6 +9,8 @@
  * need to be careful to avoid a name clashes.
  */
 
+#ifndef __ASSEMBLY__
+
 typedef unsigned short umode_t;
 
 /*
@@ -30,11 +32,17 @@ typedef __signed__ long long __s64;
 typedef unsigned long long __u64;
 #endif
 
+#endif /* __ASSEMBLY__ */
+
 /*
  * These aren't exported outside the kernel to avoid name space clashes
  */
 #ifdef __KERNEL__
 
+#define BITS_PER_LONG 32
+
+#ifndef __ASSEMBLY__
+
 typedef signed char s8;
 typedef unsigned char u8;
 
@@ -47,12 +55,12 @@ typedef unsigned int u32;
 typedef signed long long s64;
 typedef unsigned long long u64;
 
-#define BITS_PER_LONG 32
-
 /* Dma addresses are 32-bits wide.  */
 
 typedef u32 dma_addr_t;
 
+#endif /* __ASSEMBLY__ */
+
 #endif /* __KERNEL__ */
 
 #endif /* _M68K_TYPES_H */
index 638f75163c36e577a4fb1b218ba8eba12dc162bc..d4796beca3f57e25b3fb39ebc3bade4b89497b1d 100644 (file)
@@ -10,6 +10,8 @@
 #ifndef _ASM_TYPES_H
 #define _ASM_TYPES_H
 
+#ifndef __ASSEMBLY__
+
 typedef unsigned short umode_t;
 
 /*
@@ -40,11 +42,17 @@ typedef unsigned long long __u64;
  
 #endif
 
+#endif /* __ASSEMBLY__ */
+
 /*
  * These aren't exported outside the kernel to avoid name space clashes
  */
 #ifdef __KERNEL__
 
+#define BITS_PER_LONG _MIPS_SZLONG
+
+#ifndef __ASSEMBLY__
+
 typedef __signed char s8;
 typedef unsigned char u8;
 
@@ -68,10 +76,10 @@ typedef unsigned long long u64;
 
 #endif
 
-#define BITS_PER_LONG _MIPS_SZLONG
-
 typedef unsigned long dma_addr_t;
 
+#endif /* __ASSEMBLY__ */
+
 #endif /* __KERNEL__ */
 
 #endif /* _ASM_TYPES_H */
index 26dd2a505a7221fe26880668ad9821ea5d98dc94..5cba0f4857f1e1370b03a289e265d6802d3b833b 100644 (file)
@@ -9,6 +9,8 @@
 #ifndef _ASM_TYPES_H
 #define _ASM_TYPES_H
 
+#ifndef __ASSEMBLY__
+
 typedef unsigned int umode_t;
 
 /*
@@ -39,11 +41,17 @@ typedef unsigned long long __u64;
  
 #endif
 
+#endif /* __ASSEMBLY__ */
+
 /*
  * These aren't exported outside the kernel to avoid name space clashes
  */
 #ifdef __KERNEL__
 
+#define BITS_PER_LONG _MIPS_SZLONG
+
+#ifndef __ASSEMBLY__
+
 typedef __signed char s8;
 typedef unsigned char u8;
 
@@ -67,10 +75,10 @@ typedef unsigned long long u64;
 
 #endif
 
-#define BITS_PER_LONG _MIPS_SZLONG
-
 typedef unsigned long dma_addr_t;
 
+#endif /* __ASSEMBLY__ */
+
 #endif /* __KERNEL__ */
 
 #endif /* _ASM_TYPES_H */
index 86fb267f2ab73744d3049381c69aa4889ce42acb..d21b9d0d63eabc37485671c951a7fc2dee470775 100644 (file)
@@ -1,6 +1,8 @@
 #ifndef _PARISC_TYPES_H
 #define _PARISC_TYPES_H
 
+#ifndef __ASSEMBLY__
+
 typedef unsigned short umode_t;
 
 /*
@@ -22,11 +24,21 @@ typedef __signed__ long long __s64;
 typedef unsigned long long __u64;
 #endif
 
+#endif /* __ASSEMBLY__ */
+
 /*
  * These aren't exported outside the kernel to avoid name space clashes
  */
 #ifdef __KERNEL__
 
+#ifdef __LP64__
+#define BITS_PER_LONG 64
+#else
+#define BITS_PER_LONG 32
+#endif
+
+#ifndef __ASSEMBLY__
+
 typedef signed char s8;
 typedef unsigned char u8;
 
@@ -39,17 +51,13 @@ typedef unsigned int u32;
 typedef signed long long s64;
 typedef unsigned long long u64;
 
-#ifdef __LP64__
-#define BITS_PER_LONG 64
-#else
-#define BITS_PER_LONG 32
-#endif
-
 /* Dma addresses are 32-bits wide.  */
 
 typedef u32 dma_addr_t;
 typedef u64 dma64_addr_t;
 
+#endif /* __ASSEMBLY__ */
+
 #endif /* __KERNEL__ */
 
 #endif
index 26dd36dec19787de7f202db996da32828bf12060..3c74a27697d50b564ba83ca5a3a107a2cbc8371b 100644 (file)
@@ -21,10 +21,22 @@ typedef struct {
        __u32 u[4];
 } __attribute((aligned(16))) __vector128;
 
+/*
+ * XXX allowed outside of __KERNEL__ for now, until glibc gets
+ * a proper set of asm headers of its own.  -- paulus
+ */
+typedef unsigned short umode_t;
+
+#endif /* __ASSEMBLY__ */
+
 #ifdef __KERNEL__
 /*
  * These aren't exported outside the kernel to avoid name space clashes
  */
+#define BITS_PER_LONG 32
+
+#ifndef __ASSEMBLY__
+
 typedef signed char s8;
 typedef unsigned char u8;
 
@@ -39,8 +51,6 @@ typedef unsigned long long u64;
 
 typedef __vector128 vector128;
 
-#define BITS_PER_LONG 32
-
 /* DMA addresses are 32-bits wide */
 typedef u32 dma_addr_t;
 typedef u64 dma64_addr_t;
@@ -50,14 +60,8 @@ typedef u64 sector_t;
 #define HAVE_SECTOR_T
 #endif
 
-#endif /* __KERNEL__ */
-
-/*
- * XXX allowed outside of __KERNEL__ for now, until glibc gets
- * a proper set of asm headers of its own.  -- paulus
- */
-typedef unsigned short umode_t;
-
 #endif /* __ASSEMBLY__ */
 
+#endif /* __KERNEL__ */
+
 #endif
index a2a362bd5a715afe107af1a1cf69003d42549f45..08b5757e3d0741e2b701f848754a124ab657ee7a 100644 (file)
@@ -39,10 +39,16 @@ typedef struct {
        __u32 u[4];
 } __attribute((aligned(16))) __vector128;
 
+#endif /* __ASSEMBLY__ */
+
 #ifdef __KERNEL__
 /*
  * These aren't exported outside the kernel to avoid name space clashes
  */
+#define BITS_PER_LONG 64
+
+#ifndef __ASSEMBLY__
+
 typedef signed char s8;
 typedef unsigned char u8;
 
@@ -57,12 +63,11 @@ typedef unsigned long u64;
 
 typedef __vector128 vector128;
 
-#define BITS_PER_LONG 64
-
 typedef u32 dma_addr_t;
 typedef u64 dma64_addr_t;
 
-#endif /* __KERNEL__ */
 #endif /* __ASSEMBLY__ */
 
+#endif /* __KERNEL__ */
+
 #endif /* _PPC64_TYPES_H */
index 0f4c3fdf5a93bf8d73231c20e1d99bf474f4f758..dc52bf8a7acb65b95c441eeb051706d624189816 100644 (file)
@@ -9,6 +9,8 @@
 #ifndef _S390_TYPES_H
 #define _S390_TYPES_H
 
+#ifndef __ASSEMBLY__
+
 typedef unsigned short umode_t;
 
 /*
@@ -34,11 +36,18 @@ typedef unsigned long long __u64;
 */
 typedef __u32  addr_t; 
 typedef __s32  saddr_t;
+
+#endif /* __ASSEMBLY__ */
+
 /*
  * These aren't exported outside the kernel to avoid name space clashes
  */
 #ifdef __KERNEL__
 
+#define BITS_PER_LONG 32
+
+#ifndef __ASSEMBLY__
+
 typedef signed char s8;
 typedef unsigned char u8;
 
@@ -51,8 +60,6 @@ typedef unsigned int u32;
 typedef signed long long s64;
 typedef unsigned long long u64;
 
-#define BITS_PER_LONG 32
-
 typedef u32 dma_addr_t;
 
 typedef union {
@@ -68,5 +75,7 @@ typedef u64 sector_t;
 #define HAVE_SECTOR_T
 #endif
 
+#endif /* __ASSEMBLY__ */
+
 #endif                                 /* __KERNEL__                       */
 #endif
index b8436bf5d54f802dbc630931df010570382c254d..2ee9dcb2260b79705b5ebb369b90987f99ad7e6e 100644 (file)
@@ -9,6 +9,8 @@
 #ifndef _S390_TYPES_H
 #define _S390_TYPES_H
 
+#ifndef __ASSEMBLY__
+
 typedef unsigned short umode_t;
 
 /*
@@ -36,11 +38,17 @@ typedef unsigned long __u64;
 typedef unsigned long  addr_t; 
 typedef signed long  saddr_t;
 
+#endif /* __ASSEMBLY__ */
+
 /*
  * These aren't exported outside the kernel to avoid name space clashes
  */
 #ifdef __KERNEL__
 
+#define BITS_PER_LONG 64
+
+#ifndef __ASSEMBLY__
+
 typedef signed char s8;
 typedef unsigned char u8;
 
@@ -53,9 +61,9 @@ typedef unsigned int u32;
 typedef signed long s64;
 typedef unsigned  long u64;
 
-#define BITS_PER_LONG 64
-
 typedef u32 dma_addr_t;
 
+#endif /* __ASSEMBLY__ */
+
 #endif                                 /* __KERNEL__                       */
 #endif
index cb0f9f83af4f0089c28e639cd5083c75307dc851..c65c391e3f5c27f63e6dcfc076a1c6303266f393 100644 (file)
@@ -1,6 +1,8 @@
 #ifndef __ASM_SH_TYPES_H
 #define __ASM_SH_TYPES_H
 
+#ifndef __ASSEMBLY__
+
 typedef unsigned short umode_t;
 
 /*
@@ -22,11 +24,17 @@ typedef __signed__ long long __s64;
 typedef unsigned long long __u64;
 #endif
 
+#endif /* __ASSEMBLY__ */
+
 /*
  * These aren't exported outside the kernel to avoid name space clashes
  */
 #ifdef __KERNEL__
 
+#define BITS_PER_LONG 32
+
+#ifndef __ASSEMBLY__
+
 typedef __signed__ char s8;
 typedef unsigned char u8;
 
@@ -39,12 +47,12 @@ typedef unsigned int u32;
 typedef __signed__ long long s64;
 typedef unsigned long long u64;
 
-#define BITS_PER_LONG 32
-
 /* Dma addresses are 32-bits wide.  */
 
 typedef u32 dma_addr_t;
 
+#endif /* __ASSEMBLY__ */
+
 #endif /* __KERNEL__ */
 
 #endif /* __ASM_SH_TYPES_H */
index 8e726708e1cd411ac0f61b7116dab6a8ed0f0af9..42fc6ed9815690e563fceb6ca1590df9e86f5df4 100644 (file)
@@ -15,6 +15,8 @@
  * need to be careful to avoid a name clashes.
  */
 
+#ifndef __ASSEMBLY__
+
 typedef unsigned short umode_t;
 
 typedef __signed__ char __s8;
@@ -29,8 +31,14 @@ typedef unsigned int __u32;
 typedef __signed__ long long __s64;
 typedef unsigned long long __u64;
 
+#endif /* __ASSEMBLY__ */
+
 #ifdef __KERNEL__
 
+#define BITS_PER_LONG 32
+
+#ifndef __ASSEMBLY__
+
 typedef __signed__ char s8;
 typedef unsigned char u8;
 
@@ -43,11 +51,11 @@ typedef unsigned int u32;
 typedef __signed__ long long s64;
 typedef unsigned long long u64;
 
-#define BITS_PER_LONG 32
-
 typedef u32 dma_addr_t;
 typedef u32 dma64_addr_t;
 
+#endif /* __ASSEMBLY__ */
+
 #endif /* __KERNEL__ */
 
 #endif /* defined(_SPARC_TYPES_H) */
index e993f2af43bc4a1bd025962ef0a0b17deea3950e..d0ee7f105838abadfb8b47504a6d0033d49347b8 100644 (file)
@@ -10,6 +10,8 @@
  * need to be careful to avoid a name clashes.
  */
 
+#ifndef __ASSEMBLY__
+
 typedef unsigned short umode_t;
 
 /*
@@ -29,8 +31,14 @@ typedef unsigned int __u32;
 typedef __signed__ long __s64;
 typedef unsigned long __u64;
 
+#endif /* __ASSEMBLY__ */
+
 #ifdef __KERNEL__
 
+#define BITS_PER_LONG 64
+
+#ifndef __ASSEMBLY__
+
 typedef __signed__ char s8;
 typedef unsigned char u8;
 
@@ -43,13 +51,13 @@ typedef unsigned int u32;
 typedef __signed__ long s64;
 typedef unsigned long u64;
 
-#define BITS_PER_LONG 64
-
 /* Dma addresses come in generic and 64-bit flavours.  */
 
 typedef u32 dma_addr_t;
 typedef u64 dma64_addr_t;
 
+#endif /* __ASSEMBLY__ */
+
 #endif /* __KERNEL__ */
 
 #endif /* defined(_SPARC64_TYPES_H) */
index 6d144379f13e48620a4aa2de33142d96131bfb80..dcef5719687501bc39ceabff1c95e0d978996243 100644 (file)
@@ -32,11 +32,17 @@ typedef __signed__ long long __s64;
 typedef unsigned long long __u64;
 #endif
 
+#endif /* !__ASSEMBLY__ */
+
 /*
  * These aren't exported outside the kernel to avoid name space clashes
  */
 #ifdef __KERNEL__
 
+#define BITS_PER_LONG 32
+
+#ifndef __ASSEMBLY__
+
 typedef signed char s8;
 typedef unsigned char u8;
 
@@ -49,14 +55,12 @@ typedef unsigned int u32;
 typedef signed long long s64;
 typedef unsigned long long u64;
 
-#define BITS_PER_LONG 32
-
 /* Dma addresses are 32-bits wide.  */
 
 typedef u32 dma_addr_t;
 
-#endif /* __KERNEL__ */
-
 #endif /* !__ASSEMBLY__ */
 
+#endif /* __KERNEL__ */
+
 #endif /* __V850_TYPES_H__ */
index 8192e910bb4b756395fb6fa727210e63253c60ec..5b2dc01b79690cd878e878d31c9b9c5b796589d9 100644 (file)
@@ -1,6 +1,8 @@
 #ifndef _X86_64_TYPES_H
 #define _X86_64_TYPES_H
 
+#ifndef __ASSEMBLY__
+
 typedef unsigned short umode_t;
 
 /*
@@ -20,11 +22,17 @@ typedef unsigned int __u32;
 typedef __signed__ long long __s64;
 typedef unsigned long long  __u64;
 
+#endif /* __ASSEMBLY__ */
+
 /*
  * These aren't exported outside the kernel to avoid name space clashes
  */
 #ifdef __KERNEL__
 
+#define BITS_PER_LONG 64
+
+#ifndef __ASSEMBLY__
+
 typedef signed char s8;
 typedef unsigned char u8;
 
@@ -37,8 +45,6 @@ typedef unsigned int u32;
 typedef signed long long s64;
 typedef unsigned long long u64;
 
-#define BITS_PER_LONG 64
-
 typedef u64 dma64_addr_t;
 typedef u64 dma_addr_t;
 
@@ -47,6 +53,8 @@ typedef u64 sector_t;
 #define HAVE_SECTOR_T
 #endif
 
+#endif /* __ASSEMBLY__ */
+
 #endif /* __KERNEL__ */
 
 #endif
index 88bd3c12d1d8764fbc428f9582472fa3bac584be..bb0f57dc1cd4515f6b13d83423c816175a557f01 100644 (file)
@@ -95,10 +95,19 @@ write_src(void)
        int i, valid = 0;
        char *prev;
 
+       printf("#include <asm/types.h>\n");
+       printf("#if BITS_PER_LONG == 64\n");
+       printf("#define PTR .quad\n");
+       printf("#define ALGN .align 8\n");
+       printf("#else\n");
+       printf("#define PTR .long\n");
+       printf("#define ALGN .align 4\n");
+       printf("#endif\n");
+
        printf(".data\n");
 
        printf(".globl kallsyms_addresses\n");
-       printf("\t.align 8\n");
+       printf("\tALGN\n");
        printf("kallsyms_addresses:\n");
        for (i = 0, last_addr = 0; i < cnt; i++) {
                if (!symbol_valid(&table[i]))
@@ -107,20 +116,20 @@ write_src(void)
                if (table[i].addr == last_addr)
                        continue;
 
-               printf("\t.long\t%#llx\n", table[i].addr);
+               printf("\tPTR\t%#llx\n", table[i].addr);
                valid++;
                last_addr = table[i].addr;
        }
        printf("\n");
 
        printf(".globl kallsyms_num_syms\n");
-       printf("\t.align 8\n");
+       printf("\tALGN\n");
        printf("kallsyms_num_syms:\n");
-       printf("\t.long\t%d\n", valid);
+       printf("\tPTR\t%d\n", valid);
        printf("\n");
 
        printf(".globl kallsyms_names\n");
-       printf("\t.align 8\n");
+       printf("\tALGN\n");
        printf("kallsyms_names:\n");
        prev = ""; 
        for (i = 0, last_addr = 0; i < cnt; i++) {