blob: 3f8808f702454445fc6e0fd3f128c80e346fbbf9 [file] [log] [blame]
developerf11ee162022-04-12 11:17:45 +08001From 7d1531c81c0fb4c93bea8dc316043ad0e4d0c270 Mon Sep 17 00:00:00 2001
2From: Chuanhong Guo <gch981213@gmail.com>
3Date: Sun, 25 Oct 2020 23:19:40 +0800
4Subject: [PATCH] MIPS: zboot: put appended dtb into a section
5
6This will make a separated section for dtb appear in ELF, and we can
7then use objcopy to patch a dtb into vmlinuz when RAW_APPENDED_DTB
8is set in kernel config.
9
10command to patch a dtb:
11objcopy --set-section-flags=.appended_dtb=alloc,contents \
12 --update-section=.appended_dtb=<target>.dtb vmlinuz vmlinuz-dtb
13
14Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
15---
16 arch/mips/boot/compressed/ld.script | 9 ++++++---
17 1 file changed, 6 insertions(+), 3 deletions(-)
18
19--- a/arch/mips/boot/compressed/ld.script
20+++ b/arch/mips/boot/compressed/ld.script
21@@ -31,9 +31,12 @@ SECTIONS
22 CONSTRUCTORS
23 . = ALIGN(16);
24 }
25- __appended_dtb = .;
26- /* leave space for appended DTB */
27- . += 0x100000;
28+
29+ .appended_dtb : {
30+ __appended_dtb = .;
31+ /* leave space for appended DTB */
32+ . += 0x100000;
33+ }
34
35 _edata = .;
36 /* End of data section */