* [PATCH v2 0/2] Linker script cleanup patches for arm
@ 2009-09-16 16:39 Tim Abbott
2009-09-16 16:39 ` [PATCH v2 1/2] arm: convert to use __HEAD and HEAD_TEXT macros Tim Abbott
2009-09-16 16:39 ` [PATCH v2 2/2] arm: Clean up linker script using new linker script macros Tim Abbott
0 siblings, 2 replies; 6+ messages in thread
From: Tim Abbott @ 2009-09-16 16:39 UTC (permalink / raw)
To: Russell King; +Cc: linux-kernel, Sam Ravnborg, Tim Abbott
This is an updated version of the patch series I sent in late July
cleaning up the arm architecture's linker scripts. The only change is
that it is rebased on top of Linus's current master.
This cross-architecture linker script cleanup project is in
preparation for adding support for building the kernel with
-ffunction-sections -fdata-sections, which is a prerequisite for
Ksplice.
-Tim Abbott
Nelson Elhage (1):
arm: Clean up linker script using new linker script macros.
Tim Abbott (1):
arm: convert to use __HEAD and HEAD_TEXT macros.
arch/arm/kernel/head-nommu.S | 2 +-
arch/arm/kernel/head.S | 2 +-
arch/arm/kernel/vmlinux.lds.S | 84 ++++++++++++-----------------------------
3 files changed, 26 insertions(+), 62 deletions(-)
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH v2 1/2] arm: convert to use __HEAD and HEAD_TEXT macros.
2009-09-16 16:39 [PATCH v2 0/2] Linker script cleanup patches for arm Tim Abbott
@ 2009-09-16 16:39 ` Tim Abbott
2009-09-16 16:39 ` [PATCH v2 2/2] arm: Clean up linker script using new linker script macros Tim Abbott
1 sibling, 0 replies; 6+ messages in thread
From: Tim Abbott @ 2009-09-16 16:39 UTC (permalink / raw)
To: Russell King
Cc: linux-kernel, Sam Ravnborg, Tim Abbott, Russell King, Linus Torvalds
This has the consequence of changing the section name used for head
code from ".text.head" to ".head.text". Since this commit changes all
users in the architecture, this change should be harmless.
The .text.head output section is eliminated and the head text code is
included at the start of the .init output section.
Signed-off-by: Tim Abbott <tabbott@ksplice.com>
Cc: Russell King <rmk+kernel@arm.linux.org.uk>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
---
arch/arm/kernel/head-nommu.S | 2 +-
arch/arm/kernel/head.S | 2 +-
arch/arm/kernel/vmlinux.lds.S | 8 +++-----
3 files changed, 5 insertions(+), 7 deletions(-)
diff --git a/arch/arm/kernel/head-nommu.S b/arch/arm/kernel/head-nommu.S
index e5dfc28..573b803 100644
--- a/arch/arm/kernel/head-nommu.S
+++ b/arch/arm/kernel/head-nommu.S
@@ -32,7 +32,7 @@
* numbers for r1.
*
*/
- .section ".text.head", "ax"
+ __HEAD
ENTRY(stext)
setmode PSR_F_BIT | PSR_I_BIT | SVC_MODE, r9 @ ensure svc mode
@ and irqs disabled
diff --git a/arch/arm/kernel/head.S b/arch/arm/kernel/head.S
index 38ccbe1..eb62bf9 100644
--- a/arch/arm/kernel/head.S
+++ b/arch/arm/kernel/head.S
@@ -74,7 +74,7 @@
* crap here - that's what the boot loader (or in extreme, well justified
* circumstances, zImage) is for.
*/
- .section ".text.head", "ax"
+ __HEAD
ENTRY(stext)
setmode PSR_F_BIT | PSR_I_BIT | SVC_MODE, r9 @ ensure svc mode
@ and irqs disabled
diff --git a/arch/arm/kernel/vmlinux.lds.S b/arch/arm/kernel/vmlinux.lds.S
index 5cc4812..d3fbd98 100644
--- a/arch/arm/kernel/vmlinux.lds.S
+++ b/arch/arm/kernel/vmlinux.lds.S
@@ -24,13 +24,11 @@ SECTIONS
#else
. = PAGE_OFFSET + TEXT_OFFSET;
#endif
- .text.head : {
- _stext = .;
- _sinittext = .;
- *(.text.head)
- }
.init : { /* Init code and data */
+ _stext = .;
+ _sinittext = .;
+ HEAD_TEXT
INIT_TEXT
_einittext = .;
__proc_info_begin = .;
--
1.6.3.3
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH v2 2/2] arm: Clean up linker script using new linker script macros.
2009-09-16 16:39 [PATCH v2 0/2] Linker script cleanup patches for arm Tim Abbott
2009-09-16 16:39 ` [PATCH v2 1/2] arm: convert to use __HEAD and HEAD_TEXT macros Tim Abbott
@ 2009-09-16 16:39 ` Tim Abbott
2009-09-16 19:19 ` Russell King - ARM Linux
1 sibling, 1 reply; 6+ messages in thread
From: Tim Abbott @ 2009-09-16 16:39 UTC (permalink / raw)
To: Russell King; +Cc: linux-kernel, Sam Ravnborg, Nelson Elhage, Russell King
From: Nelson Elhage <nelhage@ksplice.com>
This patch is mostly a straightforward translation. The primary side
effect to the resulting vmlinux should be to increase the alignment on
the initramfs to the standard PAGE_SIZE from 32 bytes.
Signed-off-by: Nelson Elhage <nelhage@ksplice.com>
Cc: Russell King <rmk+kernel@arm.linux.org.uk>
---
arch/arm/kernel/vmlinux.lds.S | 76 +++++++++++-----------------------------
1 files changed, 21 insertions(+), 55 deletions(-)
diff --git a/arch/arm/kernel/vmlinux.lds.S b/arch/arm/kernel/vmlinux.lds.S
index d3fbd98..3cd6ff0 100644
--- a/arch/arm/kernel/vmlinux.lds.S
+++ b/arch/arm/kernel/vmlinux.lds.S
@@ -40,43 +40,29 @@ SECTIONS
__tagtable_begin = .;
*(.taglist.init)
__tagtable_end = .;
- . = ALIGN(16);
- __setup_start = .;
- *(.init.setup)
- __setup_end = .;
+
+ INIT_SETUP(16)
+
__early_begin = .;
*(.early_param.init)
__early_end = .;
- __initcall_start = .;
- INITCALLS
- __initcall_end = .;
- __con_initcall_start = .;
- *(.con_initcall.init)
- __con_initcall_end = .;
- __security_initcall_start = .;
- *(.security_initcall.init)
- __security_initcall_end = .;
-#ifdef CONFIG_BLK_DEV_INITRD
- . = ALIGN(32);
- __initramfs_start = .;
- usr/built-in.o(.init.ramfs)
- __initramfs_end = .;
-#endif
- . = ALIGN(PAGE_SIZE);
- __per_cpu_load = .;
- __per_cpu_start = .;
- *(.data.percpu.page_aligned)
- *(.data.percpu)
- *(.data.percpu.shared_aligned)
- __per_cpu_end = .;
+
+ INIT_CALLS
+ CON_INITCALL
+ SECURITY_INITCALL
+ INIT_RAM_FS
+
#ifndef CONFIG_XIP_KERNEL
__init_begin = _stext;
INIT_DATA
- . = ALIGN(PAGE_SIZE);
- __init_end = .;
#endif
}
+ PERCPU(PAGE_SIZE)
+
+ . = ALIGN(PAGE_SIZE);
+ __init_end = .;
+
/DISCARD/ : { /* Exit code and data */
EXIT_TEXT
EXIT_DATA
@@ -155,7 +141,7 @@ SECTIONS
* first, the init task union, aligned
* to an 8192 byte boundary.
*/
- *(.data.init_task)
+ INIT_TASK_DATA(THREAD_SIZE)
#ifdef CONFIG_XIP_KERNEL
. = ALIGN(PAGE_SIZE);
@@ -165,17 +151,8 @@ SECTIONS
__init_end = .;
#endif
- . = ALIGN(PAGE_SIZE);
- __nosave_begin = .;
- *(.data.nosave)
- . = ALIGN(PAGE_SIZE);
- __nosave_end = .;
-
- /*
- * then the cacheline aligned data
- */
- . = ALIGN(32);
- *(.data.cacheline_aligned)
+ NOSAVE_DATA
+ CACHELINE_ALIGNED_DATA(32)
/*
* The exception fixup table (might need resorting at runtime)
@@ -197,21 +174,10 @@ SECTIONS
}
_edata_loc = __data_loc + SIZEOF(.data);
- .bss : {
- __bss_start = .; /* BSS */
- *(.bss)
- *(COMMON)
- __bss_stop = .;
- _end = .;
- }
- /* Stabs debugging sections. */
- .stab 0 : { *(.stab) }
- .stabstr 0 : { *(.stabstr) }
- .stab.excl 0 : { *(.stab.excl) }
- .stab.exclstr 0 : { *(.stab.exclstr) }
- .stab.index 0 : { *(.stab.index) }
- .stab.indexstr 0 : { *(.stab.indexstr) }
- .comment 0 : { *(.comment) }
+ BSS_SECTION(0, 0, 0)
+ _end = .;
+
+ STABS_DEBUG
}
/*
--
1.6.3.3
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2 2/2] arm: Clean up linker script using new linker script macros.
2009-09-16 16:39 ` [PATCH v2 2/2] arm: Clean up linker script using new linker script macros Tim Abbott
@ 2009-09-16 19:19 ` Russell King - ARM Linux
2009-09-16 19:31 ` Tim Abbott
0 siblings, 1 reply; 6+ messages in thread
From: Russell King - ARM Linux @ 2009-09-16 19:19 UTC (permalink / raw)
To: Tim Abbott; +Cc: linux-kernel, Sam Ravnborg, Nelson Elhage
On Wed, Sep 16, 2009 at 12:39:55PM -0400, Tim Abbott wrote:
> This patch is mostly a straightforward translation. The primary side
> effect to the resulting vmlinux should be to increase the alignment on
> the initramfs to the standard PAGE_SIZE from 32 bytes.
I notice you're not sending this to the ARM lists, which means it's
not getting a full review (eg, by Nico who knows the XIP issues in
here). Are you sure this is correct for both the XIP and non-XIP
cases?
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2 2/2] arm: Clean up linker script using new linker script macros.
2009-09-16 19:19 ` Russell King - ARM Linux
@ 2009-09-16 19:31 ` Tim Abbott
2009-09-16 19:32 ` Russell King - ARM Linux
0 siblings, 1 reply; 6+ messages in thread
From: Tim Abbott @ 2009-09-16 19:31 UTC (permalink / raw)
To: Russell King - ARM Linux; +Cc: linux-kernel, Sam Ravnborg, Nelson Elhage
On Wed, 16 Sep 2009, Russell King - ARM Linux wrote:
> On Wed, Sep 16, 2009 at 12:39:55PM -0400, Tim Abbott wrote:
> > This patch is mostly a straightforward translation. The primary side
> > effect to the resulting vmlinux should be to increase the alignment on
> > the initramfs to the standard PAGE_SIZE from 32 bytes.
>
> I notice you're not sending this to the ARM lists, which means it's
> not getting a full review (eg, by Nico who knows the XIP issues in
> here). Are you sure this is correct for both the XIP and non-XIP
> cases?
I can resend to the ARM lists if it will work -- I didn't do so this time
because I seem to recall that only subscribers can post; maybe I
misunderstood the MAINTAINERS entry?
L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only)
Looking at the code, there's definitely something wrong in relation to
CONFIG_XIP_KERNEL; I'll fix this and repost CCing
linux-arm-kernel@lists.arm.linux.org.uk.
-Tim Abbott
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2 2/2] arm: Clean up linker script using new linker script macros.
2009-09-16 19:31 ` Tim Abbott
@ 2009-09-16 19:32 ` Russell King - ARM Linux
0 siblings, 0 replies; 6+ messages in thread
From: Russell King - ARM Linux @ 2009-09-16 19:32 UTC (permalink / raw)
To: Tim Abbott; +Cc: linux-kernel, Sam Ravnborg, Nelson Elhage
On Wed, Sep 16, 2009 at 03:31:37PM -0400, Tim Abbott wrote:
> I can resend to the ARM lists if it will work -- I didn't do so this time
> because I seem to recall that only subscribers can post; maybe I
> misunderstood the MAINTAINERS entry?
>
> L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only)
>
> Looking at the code, there's definitely something wrong in relation to
> CONFIG_XIP_KERNEL; I'll fix this and repost CCing
> linux-arm-kernel@lists.arm.linux.org.uk.
Please use linux-arm-kernel@lists.infradead.org instead. (We'll
get the patch updating MAINTAINERS in soon.)
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2009-09-16 19:33 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-09-16 16:39 [PATCH v2 0/2] Linker script cleanup patches for arm Tim Abbott
2009-09-16 16:39 ` [PATCH v2 1/2] arm: convert to use __HEAD and HEAD_TEXT macros Tim Abbott
2009-09-16 16:39 ` [PATCH v2 2/2] arm: Clean up linker script using new linker script macros Tim Abbott
2009-09-16 19:19 ` Russell King - ARM Linux
2009-09-16 19:31 ` Tim Abbott
2009-09-16 19:32 ` Russell King - ARM Linux
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®