mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 1/3] xtensa: Replace xtensa-specific _f{data,text} by _s{data,text}
@ 2012-06-10 14:39 Geert Uytterhoeven
  2012-06-10 14:39 ` [PATCH 2/3] xtensa: Use "test -e" instead of bashism "test -a" Geert Uytterhoeven
  2012-06-10 14:39 ` [PATCH 3/3] xtensa: Use the declarations provided by <asm/sections.h> Geert Uytterhoeven
  0 siblings, 2 replies; 3+ messages in thread
From: Geert Uytterhoeven @ 2012-06-10 14:39 UTC (permalink / raw)
  To: Chris Zankel, Andrew Morton
  Cc: linux-kernel, Geert Uytterhoeven, Steven Rostedt

commit a2d063ac216c1618bfc2b4d40b7176adffa63511 ("extable,
core_kernel_data(): Make sure all archs define _sdata") missed xtensa.
Xtensa does have a start of data marker, but calls it _fdata, causing

    kernel/built-in.o:(.text+0x964): undefined reference to `_sdata'

_stext was already defined, but it was duplicated by _fdata.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Steven Rostedt <rostedt@goodmis.org>
---
 arch/xtensa/kernel/vmlinux.lds.S |    3 +--
 arch/xtensa/mm/init.c            |    6 +++---
 2 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/arch/xtensa/kernel/vmlinux.lds.S b/arch/xtensa/kernel/vmlinux.lds.S
index 88ecea3..ee2e208 100644
--- a/arch/xtensa/kernel/vmlinux.lds.S
+++ b/arch/xtensa/kernel/vmlinux.lds.S
@@ -83,7 +83,6 @@ SECTIONS
 
   _text = .;
   _stext = .;
-  _ftext = .;
 
   .text :
   {
@@ -112,7 +111,7 @@ SECTIONS
   EXCEPTION_TABLE(16)
   /* Data section */
 
-  _fdata = .;
+  _sdata = .;
   RW_DATA_SECTION(XCHAL_ICACHE_LINESIZE, PAGE_SIZE, THREAD_SIZE)
   _edata = .;
 
diff --git a/arch/xtensa/mm/init.c b/arch/xtensa/mm/init.c
index ba150e5..c82af58 100644
--- a/arch/xtensa/mm/init.c
+++ b/arch/xtensa/mm/init.c
@@ -29,7 +29,7 @@
 
 /* References to section boundaries */
 
-extern char _ftext, _etext, _fdata, _edata, _rodata_end;
+extern char _stext, _etext, _sdata, _edata, _rodata_end;
 extern char __init_begin, __init_end;
 
 /*
@@ -197,8 +197,8 @@ void __init mem_init(void)
 			reservedpages++;
 	}
 
-	codesize =  (unsigned long) &_etext - (unsigned long) &_ftext;
-	datasize =  (unsigned long) &_edata - (unsigned long) &_fdata;
+	codesize =  (unsigned long) &_etext - (unsigned long) &_stext;
+	datasize =  (unsigned long) &_edata - (unsigned long) &_sdata;
 	initsize =  (unsigned long) &__init_end - (unsigned long) &__init_begin;
 
 	printk("Memory: %luk/%luk available (%ldk kernel code, %ldk reserved, "
-- 
1.7.0.4


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 2/3] xtensa: Use "test -e" instead of bashism "test -a"
  2012-06-10 14:39 [PATCH 1/3] xtensa: Replace xtensa-specific _f{data,text} by _s{data,text} Geert Uytterhoeven
@ 2012-06-10 14:39 ` Geert Uytterhoeven
  2012-06-10 14:39 ` [PATCH 3/3] xtensa: Use the declarations provided by <asm/sections.h> Geert Uytterhoeven
  1 sibling, 0 replies; 3+ messages in thread
From: Geert Uytterhoeven @ 2012-06-10 14:39 UTC (permalink / raw)
  To: Chris Zankel, Andrew Morton
  Cc: linux-kernel, Geert Uytterhoeven, linux-kbuild

On Ubuntu, /bin/sh is a symlink to dash, which does not support "test -a".
This causes messages like

    test: 1: -a: unexpected operator
    test: 1: -a: unexpected operator

and link failures like

    (.init.text+0x132): undefined reference to `platform_init'

due to the appropriate platform code not being compiled.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: linux-kbuild@vger.kernel.org
---
 arch/xtensa/Makefile |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/xtensa/Makefile b/arch/xtensa/Makefile
index d41f9ed..1537a0a 100644
--- a/arch/xtensa/Makefile
+++ b/arch/xtensa/Makefile
@@ -68,8 +68,8 @@ core-$(CONFIG_EMBEDDED_RAMDISK)	+= arch/xtensa/boot/ramdisk/
 
 # Only build variant and/or platform if it includes a Makefile
 
-buildvar := $(shell test -a $(srctree)/arch/xtensa/variants/$(VARIANT)/Makefile && echo arch/xtensa/variants/$(VARIANT)/)
-buildplf := $(shell test -a $(srctree)/arch/xtensa/platforms/$(PLATFORM)/Makefile && echo arch/xtensa/platforms/$(PLATFORM)/)
+buildvar := $(shell test -e $(srctree)/arch/xtensa/variants/$(VARIANT)/Makefile && echo arch/xtensa/variants/$(VARIANT)/)
+buildplf := $(shell test -e $(srctree)/arch/xtensa/platforms/$(PLATFORM)/Makefile && echo arch/xtensa/platforms/$(PLATFORM)/)
 
 # Find libgcc.a
 
-- 
1.7.0.4


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 3/3] xtensa: Use the declarations provided by <asm/sections.h>
  2012-06-10 14:39 [PATCH 1/3] xtensa: Replace xtensa-specific _f{data,text} by _s{data,text} Geert Uytterhoeven
  2012-06-10 14:39 ` [PATCH 2/3] xtensa: Use "test -e" instead of bashism "test -a" Geert Uytterhoeven
@ 2012-06-10 14:39 ` Geert Uytterhoeven
  1 sibling, 0 replies; 3+ messages in thread
From: Geert Uytterhoeven @ 2012-06-10 14:39 UTC (permalink / raw)
  To: Chris Zankel, Andrew Morton; +Cc: linux-kernel, Geert Uytterhoeven

  - Include <asm/sections.h>,
  - Remove the (different) extern declarations,
  - Remove the no longer needed address-of ('&') operators,
  - Use %p to format pointer differences.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
 arch/xtensa/mm/init.c |   18 +++++++-----------
 1 files changed, 7 insertions(+), 11 deletions(-)

diff --git a/arch/xtensa/mm/init.c b/arch/xtensa/mm/init.c
index c82af58..db95517 100644
--- a/arch/xtensa/mm/init.c
+++ b/arch/xtensa/mm/init.c
@@ -26,11 +26,7 @@
 
 #include <asm/bootparam.h>
 #include <asm/page.h>
-
-/* References to section boundaries */
-
-extern char _stext, _etext, _sdata, _edata, _rodata_end;
-extern char __init_begin, __init_end;
+#include <asm/sections.h>
 
 /*
  * mem_reserve(start, end, must_exist)
@@ -197,9 +193,9 @@ void __init mem_init(void)
 			reservedpages++;
 	}
 
-	codesize =  (unsigned long) &_etext - (unsigned long) &_stext;
-	datasize =  (unsigned long) &_edata - (unsigned long) &_sdata;
-	initsize =  (unsigned long) &__init_end - (unsigned long) &__init_begin;
+	codesize =  (unsigned long) _etext - (unsigned long) _stext;
+	datasize =  (unsigned long) _edata - (unsigned long) _sdata;
+	initsize =  (unsigned long) __init_end - (unsigned long) __init_begin;
 
 	printk("Memory: %luk/%luk available (%ldk kernel code, %ldk reserved, "
 	       "%ldk data, %ldk init %ldk highmem)\n",
@@ -237,7 +233,7 @@ void free_initrd_mem(unsigned long start, unsigned long end)
 
 void free_initmem(void)
 {
-	free_reserved_mem(&__init_begin, &__init_end);
-	printk("Freeing unused kernel memory: %dk freed\n",
-	       (&__init_end - &__init_begin) >> 10);
+	free_reserved_mem(__init_begin, __init_end);
+	printk("Freeing unused kernel memory: %zuk freed\n",
+	       (__init_end - __init_begin) >> 10);
 }
-- 
1.7.0.4


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-06-10 14:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-06-10 14:39 [PATCH 1/3] xtensa: Replace xtensa-specific _f{data,text} by _s{data,text} Geert Uytterhoeven
2012-06-10 14:39 ` [PATCH 2/3] xtensa: Use "test -e" instead of bashism "test -a" Geert Uytterhoeven
2012-06-10 14:39 ` [PATCH 3/3] xtensa: Use the declarations provided by <asm/sections.h> Geert Uytterhoeven

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®