2009-05-01 00:02:39

by Tim Abbott

[permalink] [raw]
Subject: [PATCH 0/2] section name cleanup for h8300

This patch series cleans up the section names on the h8300
architecture. It requires the architecture-independent macro
definitions from this patch series:

<http://www.spinics.net/lists/mips/msg33499.html>

The long-term goal here is to add support for building the kernel with
-ffunction-sections -fdata-sections. This requires renaming all the
magic section names in the kernel of the form .text.foo, .data.foo,
.bss.foo, and .rodata.foo to not have collisions with sections
generated for code like:

static int nosave = 0; /* -fdata-sections places in .data.nosave */
static void head(); /* -ffunction-sections places in .text.head */

Note that these patches have not been boot-tested (aside from testing
the analogous changes on x86), since I don't have access to the
appropriate hardware.

-Tim Abbott


Tim Abbott (2):
h8300: use new macros for .data.init_task.
h8300: use .head.text for compressed bootloader.

arch/h8300/boot/compressed/head.S | 3 ++-
arch/h8300/boot/compressed/vmlinux.lds | 2 +-
arch/h8300/kernel/init_task.c | 3 +--
arch/h8300/kernel/vmlinux.lds.S | 3 +--
4 files changed, 5 insertions(+), 6 deletions(-)


2009-04-30 23:47:42

by Tim Abbott

[permalink] [raw]
Subject: [PATCH 2/2] h8300: use .head.text for compressed bootloader.

Signed-off-by: Tim Abbott <[email protected]>
Cc: Yoshinori Sato <[email protected]>
---
arch/h8300/boot/compressed/head.S | 3 ++-
arch/h8300/boot/compressed/vmlinux.lds | 2 +-
2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/arch/h8300/boot/compressed/head.S b/arch/h8300/boot/compressed/head.S
index 985a81a..a821a1b 100644
--- a/arch/h8300/boot/compressed/head.S
+++ b/arch/h8300/boot/compressed/head.S
@@ -5,11 +5,12 @@
*/

.h8300h
+#include <linux/init.h>
#include <linux/linkage.h>

#define SRAM_START 0xff4000

- .section .text.startup
+ __HEAD
.global startup
startup:
mov.l #SRAM_START+0x8000, sp
diff --git a/arch/h8300/boot/compressed/vmlinux.lds b/arch/h8300/boot/compressed/vmlinux.lds
index 65e2a0d..98a492e 100644
--- a/arch/h8300/boot/compressed/vmlinux.lds
+++ b/arch/h8300/boot/compressed/vmlinux.lds
@@ -4,7 +4,7 @@ SECTIONS
{
__stext = . ;
__text = .;
- *(.text.startup)
+ *(.head.text)
*(.text)
__etext = . ;
}
--
1.6.2.1

2009-04-30 23:48:00

by Tim Abbott

[permalink] [raw]
Subject: [PATCH 1/2] h8300: use new macros for .data.init_task.

Signed-off-by: Tim Abbott <[email protected]>
Cc: Yoshinori Sato <[email protected]>
---
arch/h8300/kernel/init_task.c | 3 +--
arch/h8300/kernel/vmlinux.lds.S | 3 +--
2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/arch/h8300/kernel/init_task.c b/arch/h8300/kernel/init_task.c
index cb5dc55..b90e371 100644
--- a/arch/h8300/kernel/init_task.c
+++ b/arch/h8300/kernel/init_task.c
@@ -35,7 +35,6 @@ EXPORT_SYMBOL(init_task);
* way process stacks are handled. This is done by having a special
* "init_task" linker map entry..
*/
-union thread_union init_thread_union
- __attribute__((__section__(".data.init_task"))) =
+union thread_union init_thread_union __init_task_data =
{ INIT_THREAD_INFO(init_task) };

diff --git a/arch/h8300/kernel/vmlinux.lds.S b/arch/h8300/kernel/vmlinux.lds.S
index 43a87b9..33a562c 100644
--- a/arch/h8300/kernel/vmlinux.lds.S
+++ b/arch/h8300/kernel/vmlinux.lds.S
@@ -100,8 +100,7 @@ SECTIONS
__sdata = . ;
___data_start = . ;

- . = ALIGN(0x2000) ;
- *(.data.init_task)
+ INIT_TASK_DATA(0x2000)
. = ALIGN(0x4) ;
DATA_DATA
. = ALIGN(0x4) ;
--
1.6.2.1