Skip to contentSkip to conversation

arch/x86/kernel/test_nx.c compile error

DISCUSSION Adrian Bunk 3 participants 7 messages Jan 30, 2008 x86

lore
Share & tools
lore
#0 lore raw

<-- snip -->

...
CC [M] arch/x86/kernel/test_nx.o
{standard input}: Assembler messages:
{standard input}:58: Error: cannot represent relocation type BFD_RELOC_64 {standard input}:59: Error: cannot represent relocation type BFD_RELOC_64 make[2]: *** [arch/x86/kernel/test_nx.o] Error 1
make[1]: *** [arch/x86/kernel] Error 2
make: *** [sub-make] Error 2

$ gcc --version
gcc (GCC) 4.2.3 20080114 (prerelease) (Debian 4.2.2-7)
...
$ as --version
GNU assembler (GNU Binutils for Debian) 2.18.0.20080103
...

<-- snip -->

cu
Adrian

Signature · 4 lines
       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed
#1 lore raw
Quoted 8 lines · Adrian Bunk

...
CC [M] arch/x86/kernel/test_nx.o
{standard input}: Assembler messages:
{standard input}:58: Error: cannot represent relocation type BFD_RELOC_64 {standard input}:59: Error: cannot represent relocation type BFD_RELOC_64 make[2]: *** [arch/x86/kernel/test_nx.o] Error 1
make[1]: *** [arch/x86/kernel] Error 2
make: *** [sub-make] Error 2

does the patch below help?

Ingo

-------------->
Subject: x86: fix arch/x86/kernel/test_nx.c modular build bug
From: Ingo Molnar <[email protected]>

fix this modular build bug:

Quoted 6 lines

CC [M] arch/x86/kernel/test_nx.o
{standard input}: Assembler messages:
{standard input}:58: Error: cannot represent relocation type BFD_RELOC_64 {standard input}:59: Error: cannot represent relocation type BFD_RELOC_64 make[2]: *** [arch/x86/kernel/test_nx.o] Error 1
make[1]: *** [arch/x86/kernel] Error 2

---
 arch/x86/kernel/test_nx.c |    5 +++++
 1 file changed, 5 insertions(+)
arch/x86/kernel/test_nx.c +5 -0
Index: linux-x86.q/arch/x86/kernel/test_nx.c
===================================================================
@@ -91,8 +91,13 @@ static noinline int test_address(void *a
 		".previous\n"
 		".section __ex_table,\"a\"\n"
 		"       .align 8\n"
+#ifdef CONFIG_X86_32
+		"	.long 0b\n"
+		"	.long 2b\n"
+#endif
 		"	.quad 0b\n"
 		"	.quad 2b\n"
+#else
 		".previous\n"
 		: [rslt] "=r" (result)
 		: [fake_code] "r" (address), [zero] "r" (0UL), "0" (result)
#2 lore raw
Quoted 1 line · Ingo Molnar

does the patch below help?

uhm, the one below instead.

Ingo

------------>
Subject: x86: fix arch/x86/kernel/test_nx.c modular build bug
From: Ingo Molnar <[email protected]>

fix this modular build bug:

Quoted 6 lines

CC [M] arch/x86/kernel/test_nx.o
{standard input}: Assembler messages:
{standard input}:58: Error: cannot represent relocation type BFD_RELOC_64 {standard input}:59: Error: cannot represent relocation type BFD_RELOC_64 make[2]: *** [arch/x86/kernel/test_nx.o] Error 1
make[1]: *** [arch/x86/kernel] Error 2

---
 arch/x86/kernel/test_nx.c |    5 +++++
 1 file changed, 5 insertions(+)
arch/x86/kernel/test_nx.c +5 -0
Index: linux-x86.q/arch/x86/kernel/test_nx.c
===================================================================
@@ -91,8 +91,13 @@ static noinline int test_address(void *a
 		".previous\n"
 		".section __ex_table,\"a\"\n"
 		"       .align 8\n"
+#ifdef CONFIG_X86_32
+		"	.long 0b\n"
+		"	.long 2b\n"
+#endif
 		"	.quad 0b\n"
 		"	.quad 2b\n"
+#else
 		".previous\n"
 		: [rslt] "=r" (result)
 		: [fake_code] "r" (address), [zero] "r" (0UL), "0" (result)
#3 lore raw
Quoted 3 lines · Ingo Molnar
Quoted 1 line

does the patch below help?

uhm, the one below instead.

or this ...

Ingo

------------->
Subject: x86: fix arch/x86/kernel/test_nx.c modular build bug
From: Ingo Molnar <[email protected]>

fix this modular build bug:

Quoted 6 lines

CC [M] arch/x86/kernel/test_nx.o
{standard input}: Assembler messages:
{standard input}:58: Error: cannot represent relocation type BFD_RELOC_64 {standard input}:59: Error: cannot represent relocation type BFD_RELOC_64 make[2]: *** [arch/x86/kernel/test_nx.o] Error 1
make[1]: *** [arch/x86/kernel] Error 2

---
 arch/x86/kernel/test_nx.c |    5 +++++
 1 file changed, 5 insertions(+)
arch/x86/kernel/test_nx.c +5 -0
Index: linux-x86.q/arch/x86/kernel/test_nx.c
===================================================================
@@ -91,8 +91,13 @@ static noinline int test_address(void *a
 		".previous\n"
 		".section __ex_table,\"a\"\n"
 		"       .align 8\n"
+#ifdef CONFIG_X86_32
+		"	.long 0b\n"
+		"	.long 2b\n"
+#else
 		"	.quad 0b\n"
 		"	.quad 2b\n"
+#endif
 		".previous\n"
 		: [rslt] "=r" (result)
 		: [fake_code] "r" (address), [zero] "r" (0UL), "0" (result)
#4 lore raw
In reply to Ingo Molnar
Quoted 34 lines · Ingo Molnar
Quoted 1 line · Ingo Molnar

does the patch below help?

uhm, the one below instead.

Ingo

------------>
Subject: x86: fix arch/x86/kernel/test_nx.c modular build bug
From: Ingo Molnar <[email protected]>

fix this modular build bug:

Quoted 6 lines

CC [M] arch/x86/kernel/test_nx.o
{standard input}: Assembler messages:
{standard input}:58: Error: cannot represent relocation type BFD_RELOC_64 {standard input}:59: Error: cannot represent relocation type BFD_RELOC_64 make[2]: *** [arch/x86/kernel/test_nx.o] Error 1
make[1]: *** [arch/x86/kernel] Error 2

---
 arch/x86/kernel/test_nx.c |    5 +++++
 1 file changed, 5 insertions(+)

Index: linux-x86.q/arch/x86/kernel/test_nx.c
===================================================================

arch/x86/kernel/test_nx.c +0 -0
@@ -91,8 +91,13 @@ static noinline int test_address(void *a
 		".previous\n"

arch/x86/kernel/test_nx.c static noinline int test_address(void *a · line 100

Quoted 10 lines
arch/x86/kernel/test_nx.c +5 -0
 		".section __ex_table,\"a\"\n"
 		"       .align 8\n"
+#ifdef CONFIG_X86_32
+		"	.long 0b\n"
+		"	.long 2b\n"
+#endif
 		"	.quad 0b\n"
 		"	.quad 2b\n"
+#else
...

You don't test whether your patches compile? ;-)

After the obvious fix it compiled.

Why wasn't this issue found before it entered Linus' tree?

cu
Adrian

Signature · 4 lines
       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed
#6 lore raw
In reply to Ingo Molnar
Quoted 9 lines · Ingo Molnar

Index: linux-x86.q/arch/x86/kernel/test_nx.c
===================================================================

arch/x86/kernel/test_nx.c +0 -0
@@ -91,8 +91,13 @@ static noinline int test_address(void *a
 		".previous\n"
 		".section __ex_table,\"a\"\n"
 		"       .align 8\n"

arch/x86/kernel/test_nx.c static noinline int test_address(void *a · line 103

Quoted 10 lines
arch/x86/kernel/test_nx.c +5 -0
+#ifdef CONFIG_X86_32
+		"	.long 0b\n"
+		"	.long 2b\n"
+#endif
 		"	.quad 0b\n"
 		"	.quad 2b\n"
+#else
 		".previous\n"
 		: [rslt] "=r" (result)
 		: [fake_code] "r" (address), [zero] "r" (0UL), "0" (result)

#include <asm/asm>

		...
		_ASM_PTR "0b\n"
		_ASM_PTR "2b\n"
		...

... then you don't need any #ifdef at all..

#5 lore raw
In reply to Adrian Bunk
Quoted 10 lines · Adrian Bunk

arch/x86/kernel/test_nx.c static noinline int test_address(void *a · line 100

Quoted 8 lines
arch/x86/kernel/test_nx.c +5 -0
+#ifdef CONFIG_X86_32
+		"	.long 0b\n"
+		"	.long 2b\n"
+#endif
 		"	.quad 0b\n"
 		"	.quad 2b\n"
+#else
...

You don't test whether your patches compile? ;-)

i did - but i didnt test whether i sent you the right, fixed one :-)

Quoted 3 lines

After the obvious fix it compiled.

Why wasn't this issue found before it entered Linus' tree?

because it was a relatively late patch and TEST_NX is dependent on a modular build - which i dont test that often. I found and fixed a mirror image bug in test_rodata.c.

Ingo