public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Olaf Hering <olaf@aepfle.de>
To: Linus Torvalds <torvalds@osdl.org>
Cc: Jean Delvare <khali@linux-fr.org>,
	Roman Zippel <zippel@linux-m68k.org>,
	Andrey Borzenkov <arvidjaar@mail.ru>,
	Andrew Morton <akpm@osdl.org>,
	linux-kernel@vger.kernel.org, Andy Whitcroft <apw@shadowen.org>,
	Herbert Poetzl <herbert@13thfloor.at>
Subject: Re: .version keeps being updated
Date: Wed, 10 Jan 2007 21:02:49 +0100	[thread overview]
Message-ID: <20070110200249.GA30676@aepfle.de> (raw)
In-Reply-To: <20070110193136.GA30486@aepfle.de>

On Wed, Jan 10, Olaf Hering wrote:

> On Wed, Jan 10, Linus Torvalds wrote:
> 
> > Grr.
> 
> It did work for me for some reason, but I was wondering why it did work.

with such a change, it will always be first. Tested on powerpc.
I could even add an ELF parser and look for the first bytes in the
.rodata section.

diff --git a/arch/powerpc/kernel/vmlinux.lds.S b/arch/powerpc/kernel/vmlinux.lds.S
diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
index 9fcc8d9..2050d8e 100644
--- a/include/asm-generic/vmlinux.lds.h
+++ b/include/asm-generic/vmlinux.lds.h
@@ -11,6 +11,11 @@ #define ALIGN_FUNCTION()  . = ALIGN(8)
 
 #define RODATA								\
 	. = ALIGN(4096);						\
+									\
+	.rodata.uts         : AT(ADDR(.data.uts) - LOAD_OFFSET) {	\
+		*(.data.uts)						\
+	}								\
+									\
 	.rodata           : AT(ADDR(.rodata) - LOAD_OFFSET) {		\
 		VMLINUX_SYMBOL(__start_rodata) = .;			\
 		*(.rodata) *(.rodata.*)					\
diff --git a/init/version.c b/init/version.c
index 9d96d36..03f5916 100644
--- a/init/version.c
+++ b/init/version.c
@@ -19,6 +19,8 @@ #define version_string(a) version(a)
 
 int version_string(LINUX_VERSION_CODE);
 
+const char __attribute__ ((__section__ (".rodata.uts"))) get_kernel_version[] = "fiXme Linux version " UTS_RELEASE;
+
 struct uts_namespace init_uts_ns = {
 	.kref = {
 		.refcount	= ATOMIC_INIT(2),

  reply	other threads:[~2007-01-10 20:02 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-09  9:20 .version keeps being updated Jean Delvare
2007-01-09  9:32 ` Gene Heskett
2007-01-09 17:05 ` Andrey Borzenkov
2007-01-09 20:44   ` Jean Delvare
2007-01-09 21:31     ` Andrew Morton
2007-01-09 23:21       ` Linus Torvalds
2007-01-09 23:25         ` Andrew Morton
2007-01-09 23:33           ` David Miller
2007-01-09 23:39           ` Andi Kleen
2007-01-10  1:43           ` Herbert Poetzl
2007-01-10  8:53           ` Jean Delvare
2007-01-10 16:52           ` Martin J. Bligh
2007-01-10 17:05             ` Jean Delvare
2007-01-10 11:31         ` Jan Engelhardt
2007-01-10 13:45     ` Roman Zippel
2007-01-10 16:01       ` Olaf Hering
2007-01-10 17:10       ` Jean Delvare
2007-01-10 19:02         ` Linus Torvalds
2007-01-10 19:31           ` Olaf Hering
2007-01-10 20:02             ` Olaf Hering [this message]
2007-01-10 22:56               ` Jan Engelhardt
2007-01-10 23:35                 ` Segher Boessenkool
2007-01-11 13:27                   ` Jan Engelhardt
2007-01-11 13:55                     ` Andreas Schwab
2007-01-11 17:39                       ` Segher Boessenkool
2007-01-11 18:01                         ` Jan Engelhardt
2007-01-10 21:33             ` Linus Torvalds
2007-01-10 19:32           ` Linus Torvalds
2007-01-10 21:20             ` Andy Whitcroft
2007-01-11 10:56             ` Andy Whitcroft
2007-01-11 12:38           ` Roman Zippel
2007-01-11 13:05             ` Andy Whitcroft
2007-01-11 16:47             ` Linus Torvalds
2007-01-09 21:55 ` Luca Tettamanti
2007-01-10  7:34   ` Jean Delvare
2007-01-09 23:25 ` Willy Tarreau

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=20070110200249.GA30676@aepfle.de \
    --to=olaf@aepfle.de \
    --cc=akpm@osdl.org \
    --cc=apw@shadowen.org \
    --cc=arvidjaar@mail.ru \
    --cc=herbert@13thfloor.at \
    --cc=khali@linux-fr.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@osdl.org \
    --cc=zippel@linux-m68k.org \
    /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