mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Sam Ravnborg <sam@ravnborg.org>
To: Tim Abbott <tabbott@MIT.EDU>
Cc: "Linus Torvalds" <torvalds@linux-foundation.org>,
	"Linux kernel mailing list" <linux-kernel@vger.kernel.org>,
	"Anders Kaseorg" <andersk@MIT.EDU>,
	"Waseem Daher" <wdaher@MIT.EDU>,
	"Denys Vlasenko" <vda.linux@googlemail.com>,
	"Rusty Russell" <rusty@rustcorp.com.au>,
	"Andi Kleen" <andi@firstfloor.org>,
	"H. Peter Anvin" <hpa@zytor.com>,
	"Stephen Rothwell" <sfr@canb.auug.org.au>,
	"Jeff Arnold" <jbarnold@MIT.EDU>,
	"Andrew Morton" <akpm@linux-foundation.org>,
	"Jon Masters" <jonathan@jonmasters.org>,
	"Masami Hiramatsu" <mhiramat@redhat.com>,
	"Theodore Ts'o" <tytso@MIT.EDU>,
	"Nikanth Karthikesan" <knikanth@suse.de>,
	"Arjan van de Ven" <arjan@infradead.org>,
	"Paul Mundt" <lethal@linux-sh.org>,
	"Américo Wang" <xiyou.wangcong@gmail.com>
Subject: Re: [PATCH v3 1/3] Make section names compatible with -ffunction-sections -fdata-sections
Date: Fri, 24 Apr 2009 19:23:58 +0200	[thread overview]
Message-ID: <20090424172358.GA21946@uranus.ravnborg.org> (raw)
In-Reply-To: <1240519774-20307-1-git-send-email-tabbott@mit.edu>

> ---
>  Documentation/mutex-design.txt              |    4 +-
>  arch/alpha/kernel/head.S                    |    2 +-
...
>  include/linux/linkage.h                     |    4 +-
>  include/linux/spinlock.h                    |    2 +-
>  kernel/module.c                             |    2 +-
>  scripts/mod/modpost.c                       |   12 ++++----
>  scripts/recordmcount.pl                     |    6 ++--
>  141 files changed, 356 insertions(+), 348 deletions(-)

This patch touches far too many files.
We should try to work out a method so we are in better control
of the section names, so renaming in the end is a simple patch
touching only a few files.

A few suggestions follows.

> diff --git a/arch/alpha/kernel/head.S b/arch/alpha/kernel/head.S
> index 7ac1f13..16293d4 100644
> --- a/arch/alpha/kernel/head.S
> +++ b/arch/alpha/kernel/head.S
> @@ -10,7 +10,7 @@
>  #include <asm/system.h>
>  #include <asm/asm-offsets.h>
>  
> -.section .text.head, "ax"
> +.section .text..head, "ax"

Use __HEAD (from include/linux/init.h)
Same goes for all other uses of .text.head.


>  .globl swapper_pg_dir
>  .globl _stext
>  swapper_pg_dir=SWAPPER_PGD
> diff --git a/arch/alpha/kernel/init_task.c b/arch/alpha/kernel/init_task.c
> index c2938e5..7929755 100644
> --- a/arch/alpha/kernel/init_task.c
> +++ b/arch/alpha/kernel/init_task.c
> @@ -17,5 +17,5 @@ EXPORT_SYMBOL(init_mm);
>  EXPORT_SYMBOL(init_task);
>  
>  union thread_union init_thread_union
> -	__attribute__((section(".data.init_thread")))
> +	__attribute__((section(".data..init_thread")))
>  	= { INIT_THREAD_INFO(init_task) };

1) Either wait for the consolidation of init_tast or add a:
#define SECTION_INIT_THREAD  __section(".data.init_thread")
to sched.h and use that one for all archs.


> diff --git a/arch/alpha/kernel/vmlinux.lds.S b/arch/alpha/kernel/vmlinux.lds.S
> index ef37fc1..511f8ca 100644
> --- a/arch/alpha/kernel/vmlinux.lds.S
> +++ b/arch/alpha/kernel/vmlinux.lds.S
> @@ -16,7 +16,7 @@ SECTIONS
>  
>  	_text = .;	/* Text and read-only data */
>  	.text : {
> -	*(.text.head)
> +	*(.text..head)
>  		TEXT_TEXT
>  		SCHED_TEXT
>  		LOCK_TEXT

Use HEAD_TEXT (from include/asm-generic/vmlinux.lds.h)


> @@ -93,18 +93,18 @@ SECTIONS
>  	/* Freed after init ends here */
>  
>  	/* Note 2 page alignment above.  */
> -	.data.init_thread : {
> -		*(.data.init_thread)
> +	.data..init_thread : {
> +		*(.data..init_thread)
>  	}

Add something like:
#define DATA_THREAD(aling) \
	...
to vmlinux.lds.h


>  
>  	. = ALIGN(PAGE_SIZE);
> -	.data.page_aligned : {
> -		*(.data.page_aligned)
> +	.data..page_aligned : {
> +		*(.data..page_aligned)
>  	}

Add something like:
#define DATA_PAGE_ALIGNED() \
	...
to vmlinux.lds.h


>  
>  	. = ALIGN(64);
> -	.data.cacheline_aligned : {
> -		*(.data.cacheline_aligned)
> +	.data..cacheline_aligned : {
> +		*(.data..cacheline_aligned)
>  	}

Add something like:
#define DATA_CACHE_ALIGNED() \
	...
to vmlinux.lds.h

>  
>  	_data = .;
> diff --git a/arch/arm/kernel/head-nommu.S b/arch/arm/kernel/head-nommu.S
> index cc87e17..fcd93f5 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"
> +	.section ".text..head", "ax"
__HEAD

>  ENTRY(stext)
>  	msr	cpsr_c, #PSR_F_BIT | PSR_I_BIT | SVC_MODE @ ensure svc mode
>  						@ and irqs disabled
> diff --git a/arch/arm/kernel/head.S b/arch/arm/kernel/head.S
> index 21e17dc..705e759 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"
> +	.section ".text..head", "ax"
__HEAD

>  ENTRY(stext)
>  	msr	cpsr_c, #PSR_F_BIT | PSR_I_BIT | SVC_MODE @ ensure svc mode
>  						@ and irqs disabled
> diff --git a/arch/arm/kernel/init_task.c b/arch/arm/kernel/init_task.c
> index e859af3..0b81b8f 100644
> --- a/arch/arm/kernel/init_task.c
> +++ b/arch/arm/kernel/init_task.c
> @@ -29,7 +29,7 @@ EXPORT_SYMBOL(init_mm);
>   * The things we do for performance..
>   */
>  union thread_union init_thread_union
> -	__attribute__((__section__(".data.init_task"))) =
> +	__attribute__((__section__(".data..init_task"))) =
>  		{ INIT_THREAD_INFO(init_task) };
>  
>  /*
> diff --git a/arch/arm/kernel/vmlinux.lds.S b/arch/arm/kernel/vmlinux.lds.S
> index c90f272..89c97c3 100644
> --- a/arch/arm/kernel/vmlinux.lds.S
> +++ b/arch/arm/kernel/vmlinux.lds.S
> @@ -23,10 +23,10 @@ SECTIONS
>  #else
>  	. = PAGE_OFFSET + TEXT_OFFSET;
>  #endif
> -	.text.head : {
> +	.text..head : {
>  		_stext = .;
>  		_sinittext = .;
> -		*(.text.head)
> +		*(.text..head)

HEAD_TEXT
>  	}
>  
>  	.init : {			/* Init code and data		*/
> @@ -66,9 +66,9 @@ SECTIONS
>  		. = ALIGN(4096);
>  		__per_cpu_load = .;
>  		__per_cpu_start = .;
> -			*(.data.percpu.page_aligned)
> -			*(.data.percpu)
> -			*(.data.percpu.shared_aligned)
> +			*(.data..percpu.page_aligned)
> +			*(.data..percpu)
> +			*(.data..percpu.shared_aligned)
>  		__per_cpu_end = .;

PERCPU / PERCPU_VADDR


>  #ifndef CONFIG_XIP_KERNEL
>  		__init_begin = _stext;
> @@ -146,7 +146,7 @@ SECTIONS
>  		 * first, the init task union, aligned
>  		 * to an 8192 byte boundary.
>  		 */
> -		*(.data.init_task)
> +		*(.data..init_task)


>  
>  #ifdef CONFIG_XIP_KERNEL
>  		. = ALIGN(4096);
> @@ -158,7 +158,7 @@ SECTIONS
>  

>  		. = ALIGN(4096);
>  		__nosave_begin = .;
> -		*(.data.nosave)
> +		*(.data..nosave)
>  		. = ALIGN(4096);
>  		__nosave_end = .;

Add whole bloce to a DATA_NOSAVE(align) in vmlinux.lds.h


>  
> @@ -166,7 +166,7 @@ SECTIONS
>  		 * then the cacheline aligned data
>  		 */
>  		. = ALIGN(32);
> -		*(.data.cacheline_aligned)
> +		*(.data..cacheline_aligned)
>  
>  		/*
>  		 * The exception fixup table (might need resorting at runtime)
> diff --git a/arch/arm/mm/proc-v6.S b/arch/arm/mm/proc-v6.S
> index f0cc599..39d8dd1 100644
> --- a/arch/arm/mm/proc-v6.S
> +++ b/arch/arm/mm/proc-v6.S
> @@ -132,7 +132,7 @@ cpu_v6_name:
>  	.asciz	"ARMv6-compatible processor"
>  	.align
>  
> -	.section ".text.init", #alloc, #execinstr
> +	.section ".text..init", #alloc, #execinstr

Use __INIT (from init.h).


I will recommend that you do this in separate steps.
1) Is to define all the new sections to vmlinux.lds.h,
init.h and maybe other files.

To make this complete you need to go through several of the architectures.

If you have this ready soon we can push this upstream so the individual
architectures can apply their modifications.
So step 2 is to create individual patches for each architecture
and the remaining files. We can then carry this in -next until
we hit a merge window.

Until now this is pure cleanup.

The final step is to do the renaming in the few files that hold
the section definitions - it is a simple patch.
And then we can try out function-sections etc.

	Sam

  parent reply	other threads:[~2009-04-24 17:22 UTC|newest]

Thread overview: 99+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-05 23:14 [PATCH v2 0/4] Add support for compiling " Tim Abbott
2009-04-05 23:14 ` [PATCH v2 1/4] Make section names compatible " Tim Abbott
2009-04-05 23:14   ` [PATCH v2 2/4] modpost: Check the section flags, not name, to catch missing "ax"/"aw" Tim Abbott
2009-04-05 23:14     ` [PATCH v2 3/4] modpost: Support objects with more than 64k sections Tim Abbott
2009-04-05 23:14       ` [PATCH v2 4/4] x86: Add an option to compile with -ffunction-sections -fdata-sections Tim Abbott
2009-04-08  0:34 ` [PATCH v2 0/4] Add support for compiling " Tim Abbott
2009-04-08  5:22   ` Rusty Russell
2009-04-20 20:26   ` Tim Abbott
2009-04-20 23:40     ` Linus Torvalds
2009-04-21  0:26       ` Tim Abbott
2009-04-21  0:35         ` Linus Torvalds
2009-04-21  1:25           ` H. Peter Anvin
2009-04-21  1:49             ` Denys Vlasenko
2009-04-21  3:18           ` Arjan van de Ven
2009-04-21  3:26             ` Anders Kaseorg
2009-04-21 10:26             ` Andi Kleen
2009-04-21  6:01           ` Tim Abbott
2009-04-21 10:24           ` Andi Kleen
2009-04-23 20:48           ` [PATCH v3 0/3] " Tim Abbott
2009-04-23 20:49             ` [PATCH v3 1/3] Make section names compatible " Tim Abbott
2009-04-23 20:49               ` [PATCH v3 2/3] modpost: Check the section flags, not name, to catch missing "ax"/"aw" Tim Abbott
2009-04-23 20:49                 ` [PATCH v3 3/3] modpost: Support objects with more than 64k sections Tim Abbott
2009-04-24  0:16               ` [PATCH v3 1/3] Make section names compatible with -ffunction-sections -fdata-sections Paul Mundt
2009-04-24 17:23               ` Sam Ravnborg [this message]
2009-04-26  2:10                 ` Tim Abbott
2009-04-26  2:10                   ` [PATCH 01/15] Add new HEAD_TEXT_SECTION macro Tim Abbott
2009-04-26  2:10                     ` [PATCH 02/15] xtensa: convert to use __HEAD and HEAD_TEXT macros Tim Abbott
2009-04-26  2:10                       ` [PATCH 03/15] alpha: " Tim Abbott
2009-04-26  2:10                         ` [PATCH 04/15] frv: convert frv " Tim Abbott
2009-04-26  2:11                           ` [PATCH 05/15] arm: convert " Tim Abbott
2009-04-26  2:11                             ` [PATCH 06/15] ia64: " Tim Abbott
2009-04-26  2:11                               ` [PATCH 07/15] m32r: " Tim Abbott
2009-04-26  2:11                                 ` [PATCH 08/15] m68k: " Tim Abbott
2009-04-26  2:11                                   ` [PATCH 09/15] mn10300: " Tim Abbott
2009-04-26  2:11                                     ` [PATCH 10/15] powerpc: " Tim Abbott
2009-04-26  2:11                                       ` [PATCH 11/15] s390: " Tim Abbott
2009-04-26  2:11                                         ` [PATCH 12/15] sh: " Tim Abbott
2009-04-26  2:11                                           ` [PATCH 13/15] sparc: " Tim Abbott
2009-04-26  2:11                                             ` [PATCH 14/15] x86: " Tim Abbott
2009-04-26  2:11                                               ` [PATCH 15/15] modpost: convert modpost to use HEAD_TEXT_SECTION macro Tim Abbott
2009-04-26 11:30                                                 ` Sam Ravnborg
2009-04-26 22:18                                                   ` Anders Kaseorg
2009-04-26 11:28                                               ` [PATCH 14/15] x86: convert to use __HEAD and HEAD_TEXT macros Sam Ravnborg
2009-04-26 16:40                                               ` Linus Torvalds
2009-04-26 17:12                                                 ` Linus Torvalds
2009-04-26 18:34                                                   ` Sam Ravnborg
2009-04-26 18:56                                                     ` Linus Torvalds
2009-04-26 19:23                                                       ` Sam Ravnborg
2009-04-26 21:07                                                         ` [PATCH] x86: beautify vmlinux_64.lds.S Sam Ravnborg
2009-04-27  4:54                                                           ` [tip:x86/kbuild] " tip-bot for Sam Ravnborg
2009-04-27  4:59                                                         ` [PATCH 14/15] x86: convert to use __HEAD and HEAD_TEXT macros Ingo Molnar
2009-04-27  6:42                                                           ` Sam Ravnborg
2009-04-27  7:19                                                             ` Ingo Molnar
2009-04-27  7:37                                                               ` Sam Ravnborg
2009-04-26 20:50                                                       ` Andi Kleen
2009-04-27  3:47                                                       ` Ingo Molnar
2009-04-30 10:39                                                   ` [tip:x86/kbuild] x86: boot/compressed/vmlinux.lds.S: fix build of bzImage with 64 bit compiler tip-bot for Sam Ravnborg
2009-04-30 14:52                                                     ` H. Peter Anvin
2009-04-30 15:09                                                       ` Sam Ravnborg
2009-04-30 16:29                                                         ` H. Peter Anvin
2009-04-30 17:52                                                           ` Sam Ravnborg
2009-04-30 19:02                                                             ` H. Peter Anvin
2009-04-26 11:24                                             ` [PATCH 13/15] sparc: convert to use __HEAD and HEAD_TEXT macros Sam Ravnborg
2009-04-26 11:24                                           ` [PATCH 12/15] sh: " Sam Ravnborg
2009-04-26 11:23                                         ` [PATCH 11/15] s390: " Sam Ravnborg
2009-04-26 11:23                                       ` [PATCH 10/15] powerpc: " Sam Ravnborg
2009-04-26 11:22                                     ` [PATCH 09/15] mn10300: " Sam Ravnborg
2009-04-26 11:22                                   ` [PATCH 08/15] m68k: " Sam Ravnborg
2009-04-26 11:21                                 ` [PATCH 07/15] m32r: " Sam Ravnborg
2009-04-28  3:34                                   ` Hirokazu Takata
2009-04-26 11:21                               ` [PATCH 06/15] ia64: " Sam Ravnborg
2009-04-26 11:19                             ` [PATCH 05/15] arm: " Sam Ravnborg
2009-04-27 16:46                               ` Tim Abbott
2009-04-27 17:00                                 ` Russell King
2009-04-27 17:06                                 ` Linus Torvalds
2009-04-27 17:29                                   ` Luck, Tony
2009-04-28  8:56                                   ` Ralf Baechle
2009-04-26 11:16                           ` [PATCH 04/15] frv: convert frv " Sam Ravnborg
2009-04-26 11:15                         ` [PATCH 03/15] alpha: convert " Sam Ravnborg
2009-04-26 11:13                       ` [PATCH 02/15] xtensa: " Sam Ravnborg
2009-04-26 16:29                     ` [PATCH 01/15] Add new HEAD_TEXT_SECTION macro Linus Torvalds
2009-04-26  2:42                   ` [PATCH v3 1/3] Make section names compatible with -ffunction-sections -fdata-sections Paul Mundt
2009-04-26  9:15                     ` Sam Ravnborg
2009-04-26  9:20                     ` [PATCH] kbuild: fix comment in modpost.c Sam Ravnborg
2009-04-26 17:28                       ` Tim Abbott
2009-04-26  9:09                   ` [PATCH v3 1/3] Make section names compatible with -ffunction-sections -fdata-sections Sam Ravnborg
2009-04-26 21:53                     ` Tim Abbott
2009-04-26 13:09                 ` Rusty Russell
2009-04-24  0:14             ` [PATCH v3 0/3] Add support for compiling " Paul Mundt
2009-04-24 14:19             ` Masami Hiramatsu
2009-04-24 15:32               ` Tim Abbott
2009-04-25  1:49                 ` Masami Hiramatsu
2009-04-21  1:05       ` [PATCH v2 0/4] " Denys Vlasenko
2009-04-21  5:50       ` Rusty Russell
2009-04-22 12:47         ` Paul Mundt
2009-04-21 14:02 ` Américo Wang
2009-04-21 17:40   ` Anders Kaseorg
2009-04-22 11:38     ` Masami Hiramatsu
2009-04-22 17:13       ` Tim Abbott

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090424172358.GA21946@uranus.ravnborg.org \
    --to=sam@ravnborg.org \
    --cc=akpm@linux-foundation.org \
    --cc=andersk@MIT.EDU \
    --cc=andi@firstfloor.org \
    --cc=arjan@infradead.org \
    --cc=hpa@zytor.com \
    --cc=jbarnold@MIT.EDU \
    --cc=jonathan@jonmasters.org \
    --cc=knikanth@suse.de \
    --cc=lethal@linux-sh.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mhiramat@redhat.com \
    --cc=rusty@rustcorp.com.au \
    --cc=sfr@canb.auug.org.au \
    --cc=tabbott@MIT.EDU \
    --cc=torvalds@linux-foundation.org \
    --cc=tytso@MIT.EDU \
    --cc=vda.linux@googlemail.com \
    --cc=wdaher@MIT.EDU \
    --cc=xiyou.wangcong@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome