diff mbox

[1/7] ARM: disallow combining XIP and LTO

Message ID 20180220215954.4092811-2-arnd@arndb.de (mailing list archive)
State New, archived
Headers show

Commit Message

Arnd Bergmann Feb. 20, 2018, 9:59 p.m. UTC
This fails during deflate_xip_data.sh

  /home/arnd/cross-gcc/bin/arm-linux-gnueabi-objcopy -O binary -R .comment -S  vmlinux arch/arm/boot/xipImage && /bin/bash -c '/git/arm-soc/arch/arm/boot/deflate_xip_data.sh vmlinux arch/arm/boot/xipImage || { rm -f arch/arm/boot/xipImage; false; }'
make -f /git/arm-soc/scripts/Makefile.modpost
+ sym_val __data_loc
+ sed -n / __data_loc$/{s/ .*$//p;q}
+ /home/arnd/cross-gcc/bin/arm-linux-gnueabi-gcc-nm vmlinux
/home/arnd/cross-gcc/lib/gcc/arm-linux-gnueabi/8.0.1/../../../../arm-linux-gnueabi/bin/nm terminated with signal 13 [Broken pipe]
+ local val=ac74c0f4
+ [ ac74c0f4 ]
+ echo 2893332724
+ __data_loc=2893332724
+ sym_val _edata_loc
+ /home/arnd/cross-gcc/bin/arm-linux-gnueabi-gcc-nm vmlinux
+ sed -n / _edata_loc$/{s/ .*$//p;q}
/home/arnd/cross-gcc/lib/gcc/arm-linux-gnueabi/8.0.1/../../../../arm-linux-gnueabi/bin/nm terminated with signal 13 [Broken pipe]
+ local val=ac7b8744
+ [ ac7b8744 ]
+ echo 2893776708
+ _edata_loc=2893776708
+ sym_val _xiprom
+ sed -n / _xiprom$/{s/ .*$//p;q}
+ /home/arnd/cross-gcc/bin/arm-linux-gnueabi-gcc-nm vmlinux
/home/arnd/cross-gcc/lib/gcc/arm-linux-gnueabi/8.0.1/../../../../arm-linux-gnueabi/bin/nm terminated with signal 13 [Broken pipe]

Obviously we want to make the combination work, no idea why it doesn't.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 arch/arm/Kconfig | 1 +
 1 file changed, 1 insertion(+)

Comments

Nicolas Pitre Feb. 21, 2018, 3:01 a.m. UTC | #1
On Tue, 20 Feb 2018, Arnd Bergmann wrote:

> This fails during deflate_xip_data.sh
> 
>   /home/arnd/cross-gcc/bin/arm-linux-gnueabi-objcopy -O binary -R .comment -S  vmlinux arch/arm/boot/xipImage && /bin/bash -c '/git/arm-soc/arch/arm/boot/deflate_xip_data.sh vmlinux arch/arm/boot/xipImage || { rm -f arch/arm/boot/xipImage; false; }'
> make -f /git/arm-soc/scripts/Makefile.modpost
> + sym_val __data_loc
> + sed -n / __data_loc$/{s/ .*$//p;q}
> + /home/arnd/cross-gcc/bin/arm-linux-gnueabi-gcc-nm vmlinux
> /home/arnd/cross-gcc/lib/gcc/arm-linux-gnueabi/8.0.1/../../../../arm-linux-gnueabi/bin/nm terminated with signal 13 [Broken pipe]
> + local val=ac74c0f4
> + [ ac74c0f4 ]
> + echo 2893332724
> + __data_loc=2893332724
> + sym_val _edata_loc
> + /home/arnd/cross-gcc/bin/arm-linux-gnueabi-gcc-nm vmlinux
> + sed -n / _edata_loc$/{s/ .*$//p;q}
> /home/arnd/cross-gcc/lib/gcc/arm-linux-gnueabi/8.0.1/../../../../arm-linux-gnueabi/bin/nm terminated with signal 13 [Broken pipe]
> + local val=ac7b8744
> + [ ac7b8744 ]
> + echo 2893776708
> + _edata_loc=2893776708
> + sym_val _xiprom
> + sed -n / _xiprom$/{s/ .*$//p;q}
> + /home/arnd/cross-gcc/bin/arm-linux-gnueabi-gcc-nm vmlinux
> /home/arnd/cross-gcc/lib/gcc/arm-linux-gnueabi/8.0.1/../../../../arm-linux-gnueabi/bin/nm terminated with signal 13 [Broken pipe]
> 
> Obviously we want to make the combination work, no idea why it doesn't.
> 
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
>  arch/arm/Kconfig | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
> index 823e397ee0f3..8ed0f664f86f 100644
> --- a/arch/arm/Kconfig
> +++ b/arch/arm/Kconfig
> @@ -1976,6 +1976,7 @@ endchoice
>  config XIP_KERNEL
>  	bool "Kernel Execute-In-Place from ROM"
>  	depends on !ARM_LPAE && !ARCH_MULTIPLATFORM
> +	depends on !LTO

You should move this to config XIP_DEFLATED_DATA instead.


Nicolas
Arnd Bergmann Feb. 21, 2018, 11:50 a.m. UTC | #2
On Wed, Feb 21, 2018 at 4:01 AM, Nicolas Pitre <nicolas.pitre@linaro.org> wrote:
> On Tue, 20 Feb 2018, Arnd Bergmann wrote:
>
>> This fails during deflate_xip_data.sh
>>
>>   /home/arnd/cross-gcc/bin/arm-linux-gnueabi-objcopy -O binary -R .comment -S  vmlinux arch/arm/boot/xipImage && /bin/bash -c '/git/arm-soc/arch/arm/boot/deflate_xip_data.sh vmlinux arch/arm/boot/xipImage || { rm -f arch/arm/boot/xipImage; false; }'
>> make -f /git/arm-soc/scripts/Makefile.modpost
>> + sym_val __data_loc
>> + sed -n / __data_loc$/{s/ .*$//p;q}
>> + /home/arnd/cross-gcc/bin/arm-linux-gnueabi-gcc-nm vmlinux
>> /home/arnd/cross-gcc/lib/gcc/arm-linux-gnueabi/8.0.1/../../../../arm-linux-gnueabi/bin/nm terminated with signal 13 [Broken pipe]
>> + local val=ac74c0f4
>> + [ ac74c0f4 ]
>> + echo 2893332724
>> + __data_loc=2893332724
>> + sym_val _edata_loc
>> + /home/arnd/cross-gcc/bin/arm-linux-gnueabi-gcc-nm vmlinux
>> + sed -n / _edata_loc$/{s/ .*$//p;q}
>> /home/arnd/cross-gcc/lib/gcc/arm-linux-gnueabi/8.0.1/../../../../arm-linux-gnueabi/bin/nm terminated with signal 13 [Broken pipe]
>> + local val=ac7b8744
>> + [ ac7b8744 ]
>> + echo 2893776708
>> + _edata_loc=2893776708
>> + sym_val _xiprom
>> + sed -n / _xiprom$/{s/ .*$//p;q}
>> + /home/arnd/cross-gcc/bin/arm-linux-gnueabi-gcc-nm vmlinux
>> /home/arnd/cross-gcc/lib/gcc/arm-linux-gnueabi/8.0.1/../../../../arm-linux-gnueabi/bin/nm terminated with signal 13 [Broken pipe]
>>
>> Obviously we want to make the combination work, no idea why it doesn't.
>>
>
> You should move this to config XIP_DEFLATED_DATA instead.

Right, makes sense. I'd still prever nm to not crash, but that would be a small
improvement.

       Arnd
Nicolas Pitre Feb. 21, 2018, 3:13 p.m. UTC | #3
On Wed, 21 Feb 2018, Arnd Bergmann wrote:

> On Wed, Feb 21, 2018 at 4:01 AM, Nicolas Pitre <nicolas.pitre@linaro.org> wrote:
> > On Tue, 20 Feb 2018, Arnd Bergmann wrote:
> >
> >> This fails during deflate_xip_data.sh
> >>
> >>   /home/arnd/cross-gcc/bin/arm-linux-gnueabi-objcopy -O binary -R .comment -S  vmlinux arch/arm/boot/xipImage && /bin/bash -c '/git/arm-soc/arch/arm/boot/deflate_xip_data.sh vmlinux arch/arm/boot/xipImage || { rm -f arch/arm/boot/xipImage; false; }'
> >> make -f /git/arm-soc/scripts/Makefile.modpost
> >> + sym_val __data_loc
> >> + sed -n / __data_loc$/{s/ .*$//p;q}
> >> + /home/arnd/cross-gcc/bin/arm-linux-gnueabi-gcc-nm vmlinux
> >> /home/arnd/cross-gcc/lib/gcc/arm-linux-gnueabi/8.0.1/../../../../arm-linux-gnueabi/bin/nm terminated with signal 13 [Broken pipe]
> >> + local val=ac74c0f4
> >> + [ ac74c0f4 ]
> >> + echo 2893332724
> >> + __data_loc=2893332724
> >> + sym_val _edata_loc
> >> + /home/arnd/cross-gcc/bin/arm-linux-gnueabi-gcc-nm vmlinux
> >> + sed -n / _edata_loc$/{s/ .*$//p;q}
> >> /home/arnd/cross-gcc/lib/gcc/arm-linux-gnueabi/8.0.1/../../../../arm-linux-gnueabi/bin/nm terminated with signal 13 [Broken pipe]
> >> + local val=ac7b8744
> >> + [ ac7b8744 ]
> >> + echo 2893776708
> >> + _edata_loc=2893776708
> >> + sym_val _xiprom
> >> + sed -n / _xiprom$/{s/ .*$//p;q}
> >> + /home/arnd/cross-gcc/bin/arm-linux-gnueabi-gcc-nm vmlinux
> >> /home/arnd/cross-gcc/lib/gcc/arm-linux-gnueabi/8.0.1/../../../../arm-linux-gnueabi/bin/nm terminated with signal 13 [Broken pipe]
> >>
> >> Obviously we want to make the combination work, no idea why it doesn't.
> >>
> >
> > You should move this to config XIP_DEFLATED_DATA instead.
> 
> Right, makes sense. I'd still prever nm to not crash, but that would be a small
> improvement.

I'll have a look at nm.

However this feature is linked to head-inflate-data.c (your patch #5/7) 
and I have no obvious quick solution in mind for that one.


Nicolas
diff mbox

Patch

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 823e397ee0f3..8ed0f664f86f 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -1976,6 +1976,7 @@  endchoice
 config XIP_KERNEL
 	bool "Kernel Execute-In-Place from ROM"
 	depends on !ARM_LPAE && !ARCH_MULTIPLATFORM
+	depends on !LTO
 	help
 	  Execute-In-Place allows the kernel to run from non-volatile storage
 	  directly addressable by the CPU, such as NOR flash. This saves RAM