mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/2] Macros for section name cleanup
@ 2009-06-23 23:57 Tim Abbott
  2009-06-23 23:59 ` [PATCH 1/2] Add new macros for page-aligned data and bss sections Tim Abbott
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Tim Abbott @ 2009-06-23 23:57 UTC (permalink / raw)
  To: Linux kernel mailing list; +Cc: Sam Ravnborg, devel, Denys Vlasenko, Tim Abbott

These are the remaining changes from my previous macros for section
name cleanup patch series that were not subsumed by Sam Ravnborg's
recent update to vmlinux.lds.h (commit
7923f90fffa8746f6457d4eea2109fd3d6414189).

I've dropped the patch reworking __read_mostly to be a generic thing
in include/linux/cache.h.  I think the consensus on that patch was
that we should first make all the architectures support
.data.read_mostly in their linker scripts and then do a single patch
removing all the architecture implementations in favor of a single one
in include/linux/cache.h.

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 */

Sam Ravnborg proposed that rather than just renaming all the sections
outright, we should start by first getting more control over the
section names used in the kernel so that we can later rename sections
without touching too many files.  This patch series provides the
architecture-independent macros needed for that cleanup.

Tim Abbott (2):
  Add new macros for page-aligned data and bss sections.
  Add new __init_task_data macro to be used in arch init_task.c files.

 include/linux/init_task.h |    3 +++
 include/linux/linkage.h   |    9 +++++++++
 2 files changed, 12 insertions(+), 0 deletions(-)


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

* [PATCH 1/2] Add new macros for page-aligned data and bss sections.
  2009-06-23 23:57 [PATCH 0/2] Macros for section name cleanup Tim Abbott
@ 2009-06-23 23:59 ` Tim Abbott
  2009-06-23 23:59 ` [PATCH 2/2] Add new __init_task_data macro to be used in arch init_task.c files Tim Abbott
  2009-06-26 22:08 ` [PATCH 0/2] Macros for section name cleanup Sam Ravnborg
  2 siblings, 0 replies; 4+ messages in thread
From: Tim Abbott @ 2009-06-23 23:59 UTC (permalink / raw)
  To: Linux kernel mailing list; +Cc: Sam Ravnborg, devel, Denys Vlasenko, Tim Abbott

This patch is preparation for replacing most uses of
".bss.page_aligned" and ".data.page_aligned" in the kernel with
macros, so that the section name can later be changed without having
to touch a lot of the kernel.

The long-term goal here is to be able to change the kernel's magic
section names to those that are compatible with -ffunction-sections
-fdata-sections.  This requires renaming all magic sections with names
of the form ".data.foo".

Signed-off-by: Tim Abbott <tabbott@ksplice.com>
Cc: Sam Ravnborg <sam@ravnborg.org>
Acked-by: David Howells <dhowells@redhat.com>
---
 include/linux/linkage.h |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/include/linux/linkage.h b/include/linux/linkage.h
index fee9e59..691f591 100644
--- a/include/linux/linkage.h
+++ b/include/linux/linkage.h
@@ -22,6 +22,15 @@
 #define __page_aligned_bss	__section(.bss.page_aligned) __aligned(PAGE_SIZE)
 
 /*
+ * For assembly routines.
+ *
+ * Note when using these that you must specify the appropriate
+ * alignment directives yourself
+ */
+#define __PAGE_ALIGNED_DATA	.section ".data.page_aligned", "aw"
+#define __PAGE_ALIGNED_BSS	.section ".bss.page_aligned", "aw"
+
+/*
  * This is used by architectures to keep arguments on the stack
  * untouched by the compiler by keeping them live until the end.
  * The argument stack may be owned by the assembly-language
-- 
1.6.3.1


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

* [PATCH 2/2] Add new __init_task_data macro to be used in arch init_task.c files.
  2009-06-23 23:57 [PATCH 0/2] Macros for section name cleanup Tim Abbott
  2009-06-23 23:59 ` [PATCH 1/2] Add new macros for page-aligned data and bss sections Tim Abbott
@ 2009-06-23 23:59 ` Tim Abbott
  2009-06-26 22:08 ` [PATCH 0/2] Macros for section name cleanup Sam Ravnborg
  2 siblings, 0 replies; 4+ messages in thread
From: Tim Abbott @ 2009-06-23 23:59 UTC (permalink / raw)
  To: Linux kernel mailing list; +Cc: Sam Ravnborg, devel, Denys Vlasenko, Tim Abbott

This patch is preparation for replacing most ".data.init_task" in the
kernel with macros, so that the section name can later be changed
without having to touch a lot of the kernel.

The long-term goal here is to be able to change the kernel's magic
section names to those that are compatible with -ffunction-sections
-fdata-sections.  This requires renaming all magic sections with names
of the form ".data.foo".

Signed-off-by: Tim Abbott <tabbott@ksplice.com>
Cc: Sam Ravnborg <sam@ravnborg.org>
---
 include/linux/init_task.h |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/include/linux/init_task.h b/include/linux/init_task.h
index 5368fbd..7fc01b1 100644
--- a/include/linux/init_task.h
+++ b/include/linux/init_task.h
@@ -183,5 +183,8 @@ extern struct cred init_cred;
 	LIST_HEAD_INIT(cpu_timers[2]),					\
 }
 
+/* Attach to the init_task data structure for proper alignment */
+#define __init_task_data __attribute__((__section__(".data.init_task")))
+
 
 #endif
-- 
1.6.3.1


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

* Re: [PATCH 0/2] Macros for section name cleanup
  2009-06-23 23:57 [PATCH 0/2] Macros for section name cleanup Tim Abbott
  2009-06-23 23:59 ` [PATCH 1/2] Add new macros for page-aligned data and bss sections Tim Abbott
  2009-06-23 23:59 ` [PATCH 2/2] Add new __init_task_data macro to be used in arch init_task.c files Tim Abbott
@ 2009-06-26 22:08 ` Sam Ravnborg
  2 siblings, 0 replies; 4+ messages in thread
From: Sam Ravnborg @ 2009-06-26 22:08 UTC (permalink / raw)
  To: Tim Abbott; +Cc: Linux kernel mailing list, devel, Denys Vlasenko

On Tue, Jun 23, 2009 at 07:57:30PM -0400, Tim Abbott wrote:
> These are the remaining changes from my previous macros for section
> name cleanup patch series that were not subsumed by Sam Ravnborg's
> recent update to vmlinux.lds.h (commit
> 7923f90fffa8746f6457d4eea2109fd3d6414189).
> 
> I've dropped the patch reworking __read_mostly to be a generic thing
> in include/linux/cache.h.  I think the consensus on that patch was
> that we should first make all the architectures support
> .data.read_mostly in their linker scripts and then do a single patch
> removing all the architecture implementations in favor of a single one
> in include/linux/cache.h.
> 
> 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 */
> 
> Sam Ravnborg proposed that rather than just renaming all the sections
> outright, we should start by first getting more control over the
> section names used in the kernel so that we can later rename sections
> without touching too many files.  This patch series provides the
> architecture-independent macros needed for that cleanup.
> 
> Tim Abbott (2):
>   Add new macros for page-aligned data and bss sections.
>   Add new __init_task_data macro to be used in arch init_task.c files.

Applied all thre patches from you - replacing one from Jesper Nilsson
with the one from you.

	Sam

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

end of thread, other threads:[~2009-06-26 22:06 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-06-23 23:57 [PATCH 0/2] Macros for section name cleanup Tim Abbott
2009-06-23 23:59 ` [PATCH 1/2] Add new macros for page-aligned data and bss sections Tim Abbott
2009-06-23 23:59 ` [PATCH 2/2] Add new __init_task_data macro to be used in arch init_task.c files Tim Abbott
2009-06-26 22:08 ` [PATCH 0/2] Macros for section name cleanup Sam Ravnborg

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®