Re: [PATCH 1/2] vmlinux.lds.h: fix BOUNDED_SECTION_(PRE|POST)_LABEL macros

From: Greg KH
Date: Thu Nov 17 2022 - 01:30:11 EST


On Wed, Nov 16, 2022 at 05:20:21PM -0700, Jim Cromie wrote:
> commit foo added BOUNDED_SECTION_(PRE|POST)_LABEL macros,
> encapsulating the basic boilerplate to: KEEP/pack records into a
> section, and to mark the begin and end of the section with
> linker-symbols.
>
> But it tried to do extra, adding KEEP(*(.gnu.linkonce.##_sec_)) to
> optionally reserve a header record in front of the data. It wrongly
> placed the KEEP after the linker-symbol starting the section,
> so if a header was added, it would wind up in the data.
>
> Putting the KEEP in the "correct" place proved brittle, and too clever
> by half. The obvious safe fix is to remove the KEEP, and provide
> separate macros to do the extra work.
>
> While here, the macro var-names: _s_, _e_ are nearly invisible, change
> them to more obvious names: _BEGIN_, _END_
>
> Signed-off-by: Jim Cromie <jim.cromie@xxxxxxxxx>
> ---
> include/asm-generic/vmlinux.lds.h | 14 ++++++--------
> 1 file changed, 6 insertions(+), 8 deletions(-)

This change fails to apply to my driver-core-next tree. Are you sure it
is correct?

confused,

greg k-h