lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Thu, 7 Mar 2024 11:09:53 +0800
From: "liuyuntao (F)" <liuyuntao12@...wei.com>
To: Arnd Bergmann <arnd@...db.de>, <linux-arm-kernel@...ts.infradead.org>,
	<linux-kernel@...r.kernel.org>
CC: Russell King <linux@...linux.org.uk>, Andrew Davis <afd@...com>, Andrew
 Morton <akpm@...ux-foundation.org>, "Kirill A. Shutemov"
	<kirill.shutemov@...ux.intel.com>, Geert Uytterhoeven
	<geert+renesas@...der.be>, Jonathan Corbet <corbet@....net>, Mike Rapoport
	<rppt@...nel.org>, Rob Herring <robh@...nel.org>, Thomas Gleixner
	<tglx@...utronix.de>, Linus Walleij <linus.walleij@...aro.org>
Subject: Re: [PATCH -next] arm32: enable HAVE_LD_DEAD_CODE_DATA_ELIMINATION



On 2024/2/27 16:06, liuyuntao (F) wrote:
> 
> 
> On 2024/2/23 0:04, Arnd Bergmann wrote:
>> On Thu, Feb 22, 2024, at 12:24, liuyuntao (F) wrote:
>>>
>>> The position of the caret has been moved below the right brace
>>> of { KEEP(*(.vectors.bhb.loop8)) }, indicating that lld is treating
>>> the entire `KEEP(*(.vectors))` as a file name. This could potentially be
>>> a bug in lld. Perhaps we can temporarily
>>> enable the DCE option only when option LD_IS_LLD is disabled,
>>> like risc-v:
>>>
>>> `select HAVE_LD_DEAD_CODE_DATA_ELIMINATION if !LD_IS_LLD`.
>>
>> I would really like to see this working with lld if at all
>> possible, as it allows the combination of gc-sections with
>> lto and CONFIG_TRIM_UNUSED_KSYMS.
> 
Another way to preserve .vector sections without using KEEP annotation.
It boots well. How do you feel about this approach? and, could I submit 
a v2 patch?

1: Define ARM_VECTORS_TEXT to explicitly preserve .vectors section.

 > --- a/arch/arm/include/asm/vmlinux.lds.h
 > +++ b/arch/arm/include/asm/vmlinux.lds.h
 > @@ -87,6 +87,13 @@
 >                 *(.vfp11_veneer)                                \
 >                 *(.v4_bx)
 >
 > +#define ARM_VECTORS_TEXT                                       \
 > +       .vectors.text : {                                       \
 > +               KEEP(*(.vectors))                               \
 > +               KEEP(*(.vectors.bhb.loop8))                     \
 > +               KEEP(*(.vectors.bhb.bpiall))                    \
 > +       }
 > +
 >  #define ARM_TEXT                                               \
 >                 IDMAP_TEXT                                      \
 >                 __entry_text_start = .;                         \

2: Ref ARM_VECTORS_TEXT if config HAVE_LD_DEAD_CODE_DATA_ELIMINATION is 
enabled, and the same to arch/arm/kernel/vmlinux.lds.S

 > --- a/arch/arm/kernel/vmlinux-xip.lds.S 

 > +++ b/arch/arm/kernel/vmlinux-xip.lds.S 

 > @@ -135,6 +135,10 @@ SECTIONS 

 >         ARM_TCM 

 >  #endif 

 > 

 > +#ifdef HAVE_LD_DEAD_CODE_DATA_ELIMINATION 

 > +       ARM_VECTORS_TEXT 

 > +#endif 

 > + 

 >         /* 

 >          * End of copied data. We need a dummy section to get its 
LMA.
 >          * Also located before final ALIGN() as trailing padding is
 > not stored


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ