[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200222171859.3594058-1-nivedita@alum.mit.edu>
Date: Sat, 22 Feb 2020 12:18:59 -0500
From: Arvind Sankar <nivedita@...m.mit.edu>
To: Arvind Sankar <nivedita@...m.mit.edu>
Cc: Nathan Chancellor <natechancellor@...il.com>,
Fangrui Song <maskray@...gle.com>,
Borislav Petkov <bp@...en8.de>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>,
"H. Peter Anvin" <hpa@...or.com>, x86@...nel.org,
linux-kernel@...r.kernel.org, clang-built-linux@...glegroups.com,
Michael Matz <matz@...e.de>
Subject: [PATCH] x86/boot/compressed: Fix compressed kernel linking with lld
Commit TBD ("x86/boot/compressed: Remove unnecessary sections from
bzImage") discarded unnecessary sections with *(*). While this works
fine with the bfd linker, lld tries to also discard essential sections
like .shstrtab, .symtab and .strtab, which results in the link failing
since .shstrtab is required by the ELF specification. .symtab and
.strtab are also necessary to generate the zoffset.h file for the
bzImage header.
Since the only sizeable section that can be discarded is .eh_frame,
restrict the discard to only .eh_frame to be safe.
Signed-off-by: Arvind Sankar <nivedita@...m.mit.edu>
---
Sending as a fix on top of tip/x86/boot.
arch/x86/boot/compressed/vmlinux.lds.S | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/x86/boot/compressed/vmlinux.lds.S b/arch/x86/boot/compressed/vmlinux.lds.S
index 12a20603d92e..469dcf800a2c 100644
--- a/arch/x86/boot/compressed/vmlinux.lds.S
+++ b/arch/x86/boot/compressed/vmlinux.lds.S
@@ -74,8 +74,8 @@ SECTIONS
. = ALIGN(PAGE_SIZE); /* keep ZO size page aligned */
_end = .;
- /* Discard all remaining sections */
+ /* Discard .eh_frame to save some space */
/DISCARD/ : {
- *(*)
+ *(.eh_frame)
}
}
--
2.24.1
Powered by blists - more mailing lists