u-boot/arch/x86/cpu
Bin Meng 6fbe06a6ce x86: Discard .note.gnu.property sections
When switching to kernel.org x86_64 gcc 11.1.0 toolchain, u-boot.rom
built from qemu-x86_defconfig no longer boots anymore. Investigation
shows that U-Boot fails at a very early stage during the boot process,
in fdtdec_prepare_fdt() where fdt_check_header() complains that there
is not a valid device tree found at gd->fdt_blob which points to _end.
Now _end points to an allocated section .note.gnu.property which of
course is wrong.

This issue is however not seen when using the default Ubuntu 20.04 gnu
toolchain (gcc 9.3.0 with binutils 2.34). Further investigation shows
that it is caused by a behavior change of binutils v2.36 which is part
of the kernel.org gcc 11.1.0 toolchain, via the following commit:

  939b95c77bf2 ("Linux/x86: Configure gas with --enable-x86-used-note by default")

In fact, there was already a regression bug report [1] for binutils two
months ago, but the binutils folks did not think it is a bug :(

To resolve this, there are several options:

* pass -Wa,-mx86-used-note=no to gas
* pass -R .note.gnu.property to objcopy
* discard the section in the linker script

Linux kernel uses the discard way [2], so let's do the same for U-Boot.

[1] https://sourceware.org/bugzilla/show_bug.cgi?id=27753
[2] commit 4caffe6a28d3 ("x86/vdso: Discard .note.gnu.property sections in vDSO")

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
2021-06-23 17:21:14 +08:00
..
apollolake x86: coral: Allow init of debug UART in U-Boot proper 2021-03-27 15:04:30 +13:00
baytrail common: Drop asm/global_data.h from common header 2021-02-02 15:33:42 -05:00
braswell common: Drop asm/global_data.h from common header 2021-02-02 15:33:42 -05:00
broadwell common: Drop asm/global_data.h from common header 2021-02-02 15:33:42 -05:00
coreboot treewide: Convert macro and uses of __section(foo) to __section("foo") 2021-05-24 14:21:30 -04:00
efi common: Drop asm/global_data.h from common header 2021-02-02 15:33:42 -05:00
i386 common: Drop asm/global_data.h from common header 2021-02-02 15:33:42 -05:00
intel_common x86: itss: Tidy up bind() for of-platdata-inst 2021-03-26 17:03:09 +13:00
ivybridge reset: Remove addr parameter from reset_cpu() 2021-03-02 14:03:02 -05:00
qemu x86: qemu: move QFW to its own uclass 2021-04-12 17:44:55 -04:00
quark common: Drop asm/global_data.h from common header 2021-02-02 15:33:42 -05:00
queensbay common: Drop init.h from common header 2020-05-18 17:33:33 -04:00
slimbootloader common: Drop asm/global_data.h from common header 2021-02-02 15:33:42 -05:00
tangier Prepare v2021.01-rc5 2021-01-05 16:20:26 -05:00
x86_64 x86: cpu: Report address width from cpu_get_info() 2020-09-25 11:27:21 +08:00
acpi_gpe.c x86: acpi_gpe: Update driver name to match devicetree 2021-02-01 15:11:41 +08:00
call32.S common: Drop asm/global_data.h from common header 2021-02-02 15:33:42 -05:00
config.mk Remove CROSS_COMPILE default from arch/*/config.mk 2020-07-01 10:11:03 -04:00
cpu.c common: Drop asm/global_data.h from common header 2021-02-02 15:33:42 -05:00
cpu_x86.c common: Drop asm/global_data.h from common header 2021-02-02 15:33:42 -05:00
ioapic.c common: Drop log.h from common header 2020-05-18 21:19:18 -04:00
irq.c common: Drop asm/global_data.h from common header 2021-02-02 15:33:42 -05:00
lapic.c common: Drop log.h from common header 2020-05-18 21:19:18 -04:00
Makefile x86: Don't enable SMP in SPL 2020-07-20 09:46:46 +08:00
mp_init.c common: Drop asm/global_data.h from common header 2021-02-02 15:33:42 -05:00
mtrr.c common: Drop asm/global_data.h from common header 2021-02-02 15:33:42 -05:00
pci.c common: Drop log.h from common header 2020-05-18 21:19:18 -04:00
qfw_cpu.c x86: qemu: move QFW to its own uclass 2021-04-12 17:44:55 -04:00
resetvec.S x86: Reduce resetvec size 2019-10-11 17:37:38 +08:00
sipi_vector.S common: Drop asm/global_data.h from common header 2021-02-02 15:33:42 -05:00
start.S common: Drop asm/global_data.h from common header 2021-02-02 15:33:42 -05:00
start16.S common: Drop asm/global_data.h from common header 2021-02-02 15:33:42 -05:00
start64.S x86: start64: Fix copyright message 2019-05-08 13:02:10 +08:00
start_from_spl.S x86: coral: Allow init of debug UART in U-Boot proper 2021-03-27 15:04:30 +13:00
start_from_tpl.S x86: Add more comments to the start-up code 2019-10-08 13:57:36 +08:00
turbo.c common: Drop asm/global_data.h from common header 2021-02-02 15:33:42 -05:00
u-boot-64.lds x86: Discard .note.gnu.property sections 2021-06-23 17:21:14 +08:00
u-boot-spl.lds x86: Discard .note.gnu.property sections 2021-06-23 17:21:14 +08:00
u-boot.lds x86: Discard .note.gnu.property sections 2021-06-23 17:21:14 +08:00
wakeup.S x86: Move acpi_s3.h to include/acpi/ 2020-04-16 14:36:28 +08:00