[PATCH] sandbox: Fix LTO to work with STACKPROTECTOR

Simon Glass sjg at chromium.org
Mon Jul 1 15:57:40 CEST 2024


Hi Andrew,

On Mon, 24 Jun 2024 at 10:29, Andrew Goodbody
<andrew.goodbody at linaro.org> wrote:
>
> Add the STACKPROTECTOR symbols to the script that generates the
> symbols that should not be removed by the use of LTO when linking
> a shared object. This prevents a fail to build due to link errors.
>
> https://source.denx.de/u-boot/u-boot/-/issues/35
>
> Signed-off-by: Andrew Goodbody <andrew.goodbody at linaro.org>
> ---
>
>  scripts/gen_ll_addressable_symbols.sh | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/scripts/gen_ll_addressable_symbols.sh b/scripts/gen_ll_addressable_symbols.sh
> index d0864804aa..ebf89b04bf 100755
> --- a/scripts/gen_ll_addressable_symbols.sh
> +++ b/scripts/gen_ll_addressable_symbols.sh
> @@ -13,3 +13,5 @@ set -e
>  echo '#include <common.h>'
>  $@ 2>/dev/null | grep -oe '_u_boot_list_2_[a-zA-Z0-9_]*_2_[a-zA-Z0-9_]*' | \
>         sort -u | sed -e 's/^\(.*\)/extern char \1[];\n__ADDRESSABLE(\1);/'
> +$@ 2>/dev/null | grep -oe '__stack_chk_.*' | \
> +       sort -u | sed -e 's/^\(.*\)/extern char \1[];\n__ADDRESSABLE(\1);/'
> --

It is OK to add these new ones, but here you seem to be adding lots of
other things also. So far we are only allowing linker lists. So can
you update this to allow just linker lists and stack_chk? Perhaps
egrep (_u_boot_list_2_|__stack_chk_) or similar?

Regards,
Simon


More information about the U-Boot mailing list