lkml.org 
[lkml]   [2020]   [Feb]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] x86/boot/compressed: Fix compressed kernel linking with lld
On 2020-02-23, Kees Cook wrote:
>On Sat, Feb 22, 2020 at 1:01 PM 'Fangrui Song' via Clang Built Linux
><clang-built-linux@googlegroups.com> wrote:
>> https://github.com/torvalds/linux/commit/83a092cf95f28696ddc36c8add0cf03ac034897f
>> added -Wl,--orphan-handling=warn to arch/powerpc/Makefile .
>> x86 can follow if that is appropriate.
>
>I've been playing with a series to do this, here:
>
>https://git.kernel.org/pub/scm/linux/kernel/git/kees/linux.git/log/?h=linker/orphans/x86-arm
>
>There's some work to be done still...

Thanks for investigating this! There are a number of compiler options
which can add ad-hoc sections. They may need caution.


I just filed https://sourceware.org/bugzilla/show_bug.cgi?id=25591 "Should /DISCARD/ : { *(.symtab) *(.strtab) } work?"
Let's see what GNU ld will do...

Note that * can be refined to SHF_ALLOC sections
(https://sourceware.org/binutils/docs/ld/Input-Section-Basics.html):

SECTIONS {
.text : { *(.text) }
/* This excludes .strtab / .symtab / .shstrtab */
/* https://reviews.llvm.org/D72756 implemented INPUT_SECTION_FLAGS. Not included in LLVM release/10.* */
/DISCARD/ : { INPUT_SECTION_FLAGS(SHF_ALLOC) *(*) }
}


Just realized that this was reported as https://bugs.llvm.org/show_bug.cgi?id=44452
Looks like we will probably close it as wontfix.

\
 
 \ /
  Last update: 2020-02-24 07:06    [W:0.153 / U:0.828 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site