Skip to contentSkip to conversation

openrisc: Fix conflicting types for _exext and _stext

PATCH In review Joel Stanley 3 participants 3 messages Dec 13, 2017 Openrisc architecture

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 openrisc: Fix conflicting types for _exext and _stext

The printk tree in linux-next has a patch "symbol lookup: introduce dereference_symbol_descriptor()" that includes sections.h in kallsyms.h, so arch/openrisc/kernel/traps.c gets a second extern definition for _etext and _stext.

Remove the local definitions and include sections.h directly in preparation for the kallsyms.h change.

This fixes the following (future) build error:

CC arch/openrisc/kernel/traps.o
arch/openrisc/kernel/traps.c:43:13: error: conflicting types for ‘_etext’

 extern char _etext, _stext;
             ^
In file included from ./arch/openrisc/include/generated/asm/sections.h:1:0,
                 from ./include/linux/kallsyms.h:15,
                 from arch/openrisc/kernel/traps.c:35:
./include/asm-generic/sections.h:35:32: note: previous declaration of ‘_etext’ was here
 extern char _text[], _stext[], _etext[];
                                ^
---
 arch/openrisc/kernel/traps.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
arch/openrisc/kernel/traps.c +1 -2
index 4085d72fa5ae..5fb6d512502d 100644
@@ -39,8 +39,7 @@
 #include <asm/io.h>
 #include <asm/pgtable.h>
 #include <asm/unwinder.h>
-
-extern char _etext, _stext;
+#include <asm/sections.h>
 
 int kstack_depth_to_print = 0x180;
 int lwa_flag;
Signature · 1 line
2.14.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 21 lines · Joel Stanley

The printk tree in linux-next has a patch "symbol lookup: introduce dereference_symbol_descriptor()" that includes sections.h in kallsyms.h, so arch/openrisc/kernel/traps.c gets a second extern definition for _etext and _stext.

Remove the local definitions and include sections.h directly in preparation for the kallsyms.h change.

This fixes the following (future) build error:

CC arch/openrisc/kernel/traps.o
arch/openrisc/kernel/traps.c:43:13: error: conflicting types for ‘_etext’

 extern char _etext, _stext;
             ^
In file included from ./arch/openrisc/include/generated/asm/sections.h:1:0,
                 from ./include/linux/kallsyms.h:15,
                 from arch/openrisc/kernel/traps.c:35:
./include/asm-generic/sections.h:35:32: note: previous declaration of ‘_etext’ was here
 extern char _text[], _stext[], _etext[];
                                ^
Quoted 1 line

FWIW, looks good to me,

	-ss
Quoted 21 lines
---
 arch/openrisc/kernel/traps.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
arch/openrisc/kernel/traps.c +1 -2
index 4085d72fa5ae..5fb6d512502d 100644
@@ -39,8 +39,7 @@
 #include <asm/io.h>
 #include <asm/pgtable.h>
 #include <asm/unwinder.h>
-
-extern char _etext, _stext;
+#include <asm/sections.h>
 
 int kstack_depth_to_print = 0x180;
 int lwa_flag;
Signature · 1 line
2.14.1
maintainer
#2 lore raw
Quoted 9 lines · Sergey Senozhatsky
Quoted 8 lines · Joel Stanley

The printk tree in linux-next has a patch "symbol lookup: introduce dereference_symbol_descriptor()" that includes sections.h in kallsyms.h, so arch/openrisc/kernel/traps.c gets a second extern definition for _etext and _stext.

Remove the local definitions and include sections.h directly in preparation for the kallsyms.h change.

Quoted 6 lines
Quoted 6 lines

This fixes the following (future) build error:

CC arch/openrisc/kernel/traps.o
arch/openrisc/kernel/traps.c:43:13: error: conflicting types for ‘_etext’

 extern char _etext, _stext;
             ^

Oh man, why would this have been like this?

Quoted 11 lines
Quoted 8 lines

In file included from ./arch/openrisc/include/generated/asm/sections.h:1:0,

                 from ./include/linux/kallsyms.h:15,
                 from arch/openrisc/kernel/traps.c:35:
./include/asm-generic/sections.h:35:32: note: previous declaration of ‘_etext’ was here
 extern char _text[], _stext[], _etext[];
                                ^

FWIW, looks good to me,

Thanks. Applied for 4.16.

-Stafford

Quoted 23 lines
	-ss
Quoted 21 lines
---
 arch/openrisc/kernel/traps.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
arch/openrisc/kernel/traps.c +1 -2
index 4085d72fa5ae..5fb6d512502d 100644
@@ -39,8 +39,7 @@
 #include <asm/io.h>
 #include <asm/pgtable.h>
 #include <asm/unwinder.h>
-
-extern char _etext, _stext;
+#include <asm/sections.h>
 
 int kstack_depth_to_print = 0x180;
 int lwa_flag;
Signature · 1 line
2.14.1