linux-mips
[Top] [All Lists]

[PATCH 2/2] MIPS: vmlinux.lds.S: handle .{init,exit}.bss sections

To: linux-arch@vger.kernel.org
Subject: [PATCH 2/2] MIPS: vmlinux.lds.S: handle .{init,exit}.bss sections
From: Franck Bui-Huu <fbuihuu@gmail.com>
Date: Sat, 1 Dec 2007 22:13:06 +0100
Cc: macro@linux-mips.org, linux-mips@linux-mips.org
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=VoR5l8cqb6l44ze3jC00m6EsJ+7Hr4kjBiio300nvdA=; b=t3Y5tu+Mco9zBdrGwSLMhldk5nDZFoznR8numhYl8Ip35dGE8PIWXRg+95FMgxs2npsyQp3JLINi1xMVMt4+XrdCIWWwA9Y8QoFBBSNIvnNFPav+309gs9FjazhJCT0SklR6SFpsJSBeW8DK37shuyYY5ISpGsCY6sLcQEEwDCs=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; b=dyieupMvVkLEIzG7X/PmfWslcTqjqcfdTZyecPW9OkCMbzlwZtv9GZTWlHq5ZydxWfXNxRGgkEZyJtjQ6Q725SndQ3AFJq7Hjnw+lIMNvJRapKAq4b3G9Q6V+QnMr+rWTvnYvgR1fEh7hUoU2SHZDuveGlARG0oIRtRLg8maPZo=
In-reply-to: <1196543586-6698-1-git-send-email-fbuihuu@gmail.com>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <1196543586-6698-1-git-send-email-fbuihuu@gmail.com>
Sender: linux-mips-bounce@linux-mips.org
Signed-off-by: Franck Bui-Huu <fbuihuu@gmail.com>
---
 arch/mips/kernel/vmlinux.lds.S |   21 ++++++++++++++++-----
 1 files changed, 16 insertions(+), 5 deletions(-)

diff --git a/arch/mips/kernel/vmlinux.lds.S b/arch/mips/kernel/vmlinux.lds.S
index 5fc2398..8508d3c 100644
--- a/arch/mips/kernel/vmlinux.lds.S
+++ b/arch/mips/kernel/vmlinux.lds.S
@@ -110,7 +110,7 @@ SECTIONS
        _edata =  .;                    /* End of data section */
 
        /* will be freed after init */
-       . = ALIGN(_PAGE_SIZE);          /* Init code and data */
+       . = ALIGN(_PAGE_SIZE);          /* Init code, data and bss */
        __init_begin = .;
        .init.text : {
                _sinittext = .;
@@ -158,12 +158,23 @@ SECTIONS
        }
 #endif
        PERCPU(_PAGE_SIZE)
-       . = ALIGN(_PAGE_SIZE);
-       __init_end = .;
-       /* freed after init ends here */
 
+       /*
+        * We keep init/exit bss sections here to have only one
+        * segment to load. Note that .bss.exit is also discarded
+        * at runtime for the same reason as above.
+        */
+       .exit.bss : {
+               *(.bss.exit)
+       }
        __bss_start = .;        /* BSS */
-       .sbss  : {
+       .init.bss : {
+               *(.bss.init)
+       }
+       . = ALIGN(_PAGE_SIZE);
+       __init_end = .;         /* freed after init ends here */
+
+       .sbss : {
                *(.sbss)
                *(.scommon)
        }
-- 
1.5.3.5


<Prev in Thread] Current Thread [Next in Thread>