[PATCH 1/1] arch/powerpc: Don't assume start_text & head_end align

Christophe Leroy christophe.leroy at csgroup.eu
Thu Sep 8 16:42:41 AEST 2022



Le 13/03/2019 à 04:38, Alastair D'Silva a écrit :
> From: Alastair D'Silva <alastair at d-silva.org>
> 
> When building LTO kernels, the start_text symbol is not guaranteed to mark
> the end of the head section.
> 
> Instead, look explicitly for __head_end.

Could you please give more details ?

Have you encountered a problem ?

 From commit c494adefef9f ("powerpc/64: Tool to check head sections 
location sanity"), I understand that we want to make sure text_start is 
where it is, not that __head_end is.

Thanks
Christophe


> 
> Signed-off-by: Alastair D'Silva <alastair at d-silva.org>
> ---
>   arch/powerpc/tools/head_check.sh | 10 +++++-----
>   1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/arch/powerpc/tools/head_check.sh b/arch/powerpc/tools/head_check.sh
> index ad9e57209aa4..1b0f634038c3 100644
> --- a/arch/powerpc/tools/head_check.sh
> +++ b/arch/powerpc/tools/head_check.sh
> @@ -44,7 +44,7 @@ nm="$1"
>   vmlinux="$2"
>   
>   # gcc-4.6-era toolchain make _stext an A (absolute) symbol rather than T
> -$nm "$vmlinux" | grep -e " [TA] _stext$" -e " t start_first_256B$" -e " a text_start$" -e " t start_text$" -m4 > .tmp_symbols.txt
> +$nm "$vmlinux" | grep -e " [TA] _stext$" -e " t start_first_256B$" -e " a text_start$" -e " T __head_end$" -m4 > .tmp_symbols.txt
>   
>   
>   vma=$(cat .tmp_symbols.txt | grep -e " [TA] _stext$" | cut -d' ' -f1)
> @@ -63,12 +63,12 @@ fi
>   
>   top_vma=$(echo $vma | cut -d'0' -f1)
>   
> -expected_start_text_addr=$(cat .tmp_symbols.txt | grep " a text_start$" | cut -d' ' -f1 | sed "s/^0/$top_vma/")
> +expected_head_end_addr=$(cat .tmp_symbols.txt | grep " a text_start$" | cut -d' ' -f1 | sed "s/^0/$top_vma/")
>   
> -start_text_addr=$(cat .tmp_symbols.txt | grep " t start_text$" | cut -d' ' -f1)
> +head_end_addr=$(cat .tmp_symbols.txt | grep " T __head_end$" | cut -d' ' -f1)
>   
> -if [ "$start_text_addr" != "$expected_start_text_addr" ]; then
> -	echo "ERROR: start_text address is $start_text_addr, should be $expected_start_text_addr"
> +if [ "$head_end_addr" != "$expected_head_end_addr" ]; then
> +	echo "ERROR: __head_end address is $head_end_addr, should be $expected_head_end_addr"
>   	echo "ERROR: try to enable LD_HEAD_STUB_CATCH config option"
>   	echo "ERROR: see comments in arch/powerpc/tools/head_check.sh"
>   


More information about the Linuxppc-dev mailing list