linux-mips
[Top] [All Lists]

[PATCH] MIPS: ZBOOT: define program header for text loadable segment

To: linux-mips@linux-mips.org
Subject: [PATCH] MIPS: ZBOOT: define program header for text loadable segment
From: "Florian Fainelli" <f.fainelli@gmail.com>
Date: Thu, 12 Sep 2013 15:42:05 +0100
Cc: ralf@linux-mips.org, blogic@openwrt.org, james.hogan@imgtec.com, "Florian Fainelli" <f.fainelli@gmail.com>
List-archive: <http://www.linux-mips.org/archives/linux-mips/>
List-help: <mailto:ecartis@linux-mips.org?Subject=help>
List-id: linux-mips <linux-mips.eddie.linux-mips.org>
List-owner: <mailto:ralf@linux-mips.org>
List-post: <mailto:linux-mips@linux-mips.org>
List-software: Ecartis version 1.0.0
List-subscribe: <mailto:ecartis@linux-mips.org?subject=subscribe%20linux-mips>
List-unsubscribe: <mailto:ecartis@linux-mips.org?subject=unsubscribe%20linux-mips>
Original-recipient: rfc822;linux-mips@linux-mips.org
Sender: linux-mips-bounce@linux-mips.org
There is currently no corresponding ELF program header for the "text"
loadable segment which is confusing for some bootloader out there such
as CFE because it expects to find a program header matching the segment
it is trying to load. The Linux kernel ELF binary "vmlinux" has a
similar program header for the text segment so we just mimic this here
too.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
 arch/mips/boot/compressed/ld.script | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/arch/mips/boot/compressed/ld.script 
b/arch/mips/boot/compressed/ld.script
index 8e6b07c..5a33409 100644
--- a/arch/mips/boot/compressed/ld.script
+++ b/arch/mips/boot/compressed/ld.script
@@ -8,6 +8,9 @@
 
 OUTPUT_ARCH(mips)
 ENTRY(start)
+PHDRS {
+       text PT_LOAD FLAGS(7); /* RWX */
+}
 SECTIONS
 {
        /* Text and read-only data */
@@ -15,7 +18,7 @@ SECTIONS
        .text : {
                *(.text)
                *(.rodata)
-       }
+       }: text
        /* End of text section */
 
        /* Writable data */
-- 
1.8.1.2



<Prev in Thread] Current Thread [Next in Thread>
  • [PATCH] MIPS: ZBOOT: define program header for text loadable segment, Florian Fainelli <=