Re: [yocto] [meta-rockchip][PATCH] u-boot-rockchip: fix for binutils-2.28
On Wed 2017-03-08 @ 09:33:18 PM, Khem Raj wrote: > On 17-03-09 00:01:12, Trevor Woerner wrote: > > Okay. > > > > Building with 2.28 (and letting it fail), then repeating the final link step > > with 2.27 succeeds! > > OK thats good. Can you post the output of readelf -e on final good and bad > binaries Phew! I wasn't sure if this was good or bad :-S I assume by "good" you mean a build with binutils-2.27 without -N and with SPL? I assume by "bad" you mean the frankenbuild (i.e. built with 2.28 but linked with 2.27, without -N, with SPL)? If so, good: ELF Header: Magic: 7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00 Class: ELF32 Data: 2's complement, little endian Version: 1 (current) OS/ABI:UNIX - System V ABI Version: 0 Type: DYN (Shared object file) Machine: ARM Version: 0x1 Entry point address: 0x0 Start of program headers: 52 (bytes into file) Start of section headers: 3548088 (bytes into file) Flags: 0x5000200, Version5 EABI, soft-float ABI Size of this header: 52 (bytes) Size of program headers: 32 (bytes) Number of program headers: 5 Size of section headers: 40 (bytes) Number of section headers: 30 Section header string table index: 27 Section Headers: [Nr] Name TypeAddr OffSize ES Flg Lk Inf Al [ 0] NULL 00 00 00 0 0 0 [ 1] .text PROGBITS 01 0301a4 00 AX 0 0 32 [ 2] .rodata PROGBITS000301a8 0401a8 0134dc 00 A 0 0 8 [ 3] .hash HASH00043684 053684 18 04 A 13 0 4 [ 4] .data PROGBITS000436a0 0536a0 00296c 00 WA 0 0 8 [ 5] .got.plt PROGBITS0004600c 05600c 0c 04 WA 0 0 4 [ 6] .u_boot_list PROGBITS00046018 056018 001b3c 00 WA 0 0 4 [ 7] .efi_runtime PROGBITS00047b58 057b58 000100 00 WAX 0 0 8 [ 8] .efi_runtime_rel REL 00047c58 057c58 90 08 A 13 0 4 [ 9] .rel.dyn REL 00047ce8 057ce8 00a8c8 08 A 13 0 4 [10] .bss_startPROGBITS00047ce8 06267d 00 00 W 0 0 1 [11] .bss NOBITS 00047ce8 00 03d100 00 WA 0 0 64 [12] .bss_end PROGBITS00084de8 06267d 00 00 W 0 0 1 [13] .dynsym DYNSYM 000525b0 0625b0 30 10 A 14 3 4 [14] .dynstr STRTAB 000525e0 0625e0 01 00 A 0 0 1 [15] .dynamic DYNAMIC 000525e4 0625e4 88 08 WA 14 0 4 [16] .interp PROGBITS0005266c 06266c 11 00 A 0 0 1 [17] .ARM.attributes ARM_ATTRIBUTES 06267d 29 00 0 0 1 [18] .comment PROGBITS 0626a6 11 01 MS 0 0 1 [19] .debug_line PROGBITS 0626b7 0556f7 00 0 0 1 [20] .debug_info PROGBITS 0b7dae 1885b9 00 0 0 1 [21] .debug_abbrev PROGBITS 240367 03454d 00 0 0 1 [22] .debug_arangesPROGBITS 2748b8 0058b8 00 0 0 8 [23] .debug_frame PROGBITS 27a170 00fd78 00 0 0 4 [24] .debug_strPROGBITS 289ee8 0281a9 01 MS 0 0 1 [25] .debug_locPROGBITS 2b2091 07d5c5 00 0 0 1 [26] .debug_ranges PROGBITS 32f658 00c850 00 0 0 8 [27] .shstrtab STRTAB 36228b 00012b 00 0 0 1 [28] .symtab SYMTAB 33bea8 01bef0 10 29 5910 4 [29] .strtab STRTAB 357d98 00a4f3 00 0 0 1 Key to Flags: W (write), A (alloc), X (execute), M (merge), S (strings) I (info), L (link order), G (group), T (TLS), E (exclude), x (unknown) O (extra OS processing required) o (OS specific), p (processor specific) Program Headers: Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align PHDR 0x34 0x00010034 0x 0x000a0 0x000a0 R E 0x4 INTERP 0x06266c 0x0005266
Re: [yocto] [meta-rockchip][PATCH] u-boot-rockchip: fix for binutils-2.28
On 17-03-09 00:01:12, Trevor Woerner wrote: > On Wed 2017-03-08 @ 04:51:04 PM, Khem Raj wrote: > > On 17-03-08 19:01:05, Tom Rini wrote: > > > On Wed, Mar 08, 2017 at 03:42:00PM -0800, Khem Raj wrote: > > > > On 17-03-08 18:28:21, Tom Rini wrote: > > > > > On Wed, Mar 08, 2017 at 12:31:47PM -0500, Trevor Woerner wrote: > > > > > > > > > > > openembedded-core updated bintuils from 2.27 to 2.28 which causes > > > > > > u-boot to > > > > > > fail to compile: > > > > > > > > > > > > arm-oe-linux-gnueabi-ld.bfd: u-boot: Not enough room for > > > > > > program headers, try linking with -N > > > > > > > > > > > > Building with -N does fix the issue, so this patch simply adds that > > > > > > flag to > > > > > > the build so it succeeds. > > > > > > > > > > > > This has been build-tested, as well as run-tested on the firefly. > > > > > > > > > > > > Signed-off-by: Trevor Woerner > > > > > > > > > > Unless there's an immediate need I would ask holding off on this for a > > > > > bit, I want to track down why this is happening. > > > > > > > > perhaps linker map files from 2.27 and 2.28 binutils will help to > > > > understand it > > > > > > Nothing is standing out yet: > > > https://lists.denx.de/pipermail/u-boot/2017-March/283278.html > > > https://lists.denx.de/pipermail/u-boot/2017-March/283286.html > > > > I see that .data.rel.ro are generated eventhough they are empty they > > appear to be in final link this section will hold constant variables > > that gcc sees and needs dynamic relocation, that probably is not > > relevant to u-boot since its linked stand-alone > > > > Can you try to do just the final link with 2.28 and all built with 2.27 > > and see if it still happens, want to rule out assembler > > Okay. > > Building with 2.28 (and letting it fail), then repeating the final link step > with 2.27 succeeds! OK thats good. Can you post the output of readelf -e on final good and bad binaries > > $ arm-oe-linux-gnueabi-ld.bfd -v > GNU ld (GNU Binutils) 2.27.0.20160806 > > $ arm-oe-linux-gnueabi-ld.bfd -pie --gc-sections -Bstatic -Ttext > 0x -o u-boot \ > -T u-boot.lds arch/arm/cpu/armv7/start.o --start-group > arch/arm/cpu/built-in.o \ > arch/arm/cpu/armv7/built-in.o arch/arm/lib/built-in.o > arch/arm/mach-rockchip/built-in.o \ > board/firefly/firefly-rk3288/built-in.o cmd/built-in.o > common/built-in.o disk/built-in.o \ > drivers/built-in.o drivers/dma/built-in.o drivers/gpio/built-in.o > drivers/i2c/built-in.o \ > drivers/mmc/built-in.o drivers/mtd/built-in.o > drivers/mtd/onenand/built-in.o \ > drivers/mtd/spi/built-in.o drivers/net/built-in.o > drivers/net/phy/built-in.o \ > drivers/pci/built-in.o drivers/power/built-in.o > drivers/power/battery/built-in.o \ > drivers/power/domain/built-in.o drivers/power/fuel_gauge/built-in.o > drivers/power/mfd/built-in.o \ > drivers/power/pmic/built-in.o drivers/power/regulator/built-in.o > drivers/serial/built-in.o \ > drivers/spi/built-in.o drivers/usb/common/built-in.o > drivers/usb/dwc3/built-in.o \ > drivers/usb/emul/built-in.o drivers/usb/eth/built-in.o > drivers/usb/gadget/built-in.o \ > drivers/usb/gadget/udc/built-in.o drivers/usb/host/built-in.o > drivers/usb/musb-new/built-in.o \ > drivers/usb/musb/built-in.o drivers/usb/phy/built-in.o > drivers/usb/ulpi/built-in.o fs/built-in.o \ > lib/built-in.o net/built-in.o test/built-in.o test/dm/built-in.o > --end-group \ > arch/arm/lib/eabi_compat.o arch/arm/lib/lib.a -Map u-boot.map > $ echo $? > 0 > > Looking at the top couple lines of a diff between the map files of a > binutils-2.27 build and this frankenbuild (both with SPL, neither with -N) > gives: > > --- 2.27-without-N/u-boot.map 2017-03-08 13:26:26.966147350 -0500 > +++ build-with-2.28-link-with-2.27/u-boot.map 2017-03-08 > 23:48:43.593173398 -0500 > @@ -5442,7 +5442,7 @@ > .iplt 0x000301a40x0 > arch/arm/cpu/armv7/start.o >0x000301a4. = ALIGN (0x4) > > -.rodata 0x000301a80x134dc > +.rodata 0x000301a80x134b8 > *(SORT(.rodata*)) > .rodata.efi_boot_services >0x000301a8 0xc8 lib/built-in.o > @@ -5859,4836 +5859,4836 @@ > .rodata.cb_erase.str1.1 >0x00033745 0x60 > drivers/usb/gadget/built-in.o > .rodata.cb_getvar.str1.1 > -0x000337a5 0xfc > drivers/usb/gadget/built-in.o > -0x10c (size before relaxing) > +0x000337a5 0xea > drivers/usb/gadget/built-in.o > + 0xfa (size before relaxing)
Re: [yocto] [meta-rockchip][PATCH] u-boot-rockchip: fix for binutils-2.28
On Wed 2017-03-08 @ 04:51:04 PM, Khem Raj wrote: > On 17-03-08 19:01:05, Tom Rini wrote: > > On Wed, Mar 08, 2017 at 03:42:00PM -0800, Khem Raj wrote: > > > On 17-03-08 18:28:21, Tom Rini wrote: > > > > On Wed, Mar 08, 2017 at 12:31:47PM -0500, Trevor Woerner wrote: > > > > > > > > > openembedded-core updated bintuils from 2.27 to 2.28 which causes > > > > > u-boot to > > > > > fail to compile: > > > > > > > > > > arm-oe-linux-gnueabi-ld.bfd: u-boot: Not enough room for > > > > > program headers, try linking with -N > > > > > > > > > > Building with -N does fix the issue, so this patch simply adds that > > > > > flag to > > > > > the build so it succeeds. > > > > > > > > > > This has been build-tested, as well as run-tested on the firefly. > > > > > > > > > > Signed-off-by: Trevor Woerner > > > > > > > > Unless there's an immediate need I would ask holding off on this for a > > > > bit, I want to track down why this is happening. > > > > > > perhaps linker map files from 2.27 and 2.28 binutils will help to > > > understand it > > > > Nothing is standing out yet: > > https://lists.denx.de/pipermail/u-boot/2017-March/283278.html > > https://lists.denx.de/pipermail/u-boot/2017-March/283286.html > > I see that .data.rel.ro are generated eventhough they are empty they > appear to be in final link this section will hold constant variables > that gcc sees and needs dynamic relocation, that probably is not > relevant to u-boot since its linked stand-alone > > Can you try to do just the final link with 2.28 and all built with 2.27 > and see if it still happens, want to rule out assembler Okay. Building with 2.28 (and letting it fail), then repeating the final link step with 2.27 succeeds! $ arm-oe-linux-gnueabi-ld.bfd -v GNU ld (GNU Binutils) 2.27.0.20160806 $ arm-oe-linux-gnueabi-ld.bfd -pie --gc-sections -Bstatic -Ttext 0x -o u-boot \ -T u-boot.lds arch/arm/cpu/armv7/start.o --start-group arch/arm/cpu/built-in.o \ arch/arm/cpu/armv7/built-in.o arch/arm/lib/built-in.o arch/arm/mach-rockchip/built-in.o \ board/firefly/firefly-rk3288/built-in.o cmd/built-in.o common/built-in.o disk/built-in.o \ drivers/built-in.o drivers/dma/built-in.o drivers/gpio/built-in.o drivers/i2c/built-in.o \ drivers/mmc/built-in.o drivers/mtd/built-in.o drivers/mtd/onenand/built-in.o \ drivers/mtd/spi/built-in.o drivers/net/built-in.o drivers/net/phy/built-in.o \ drivers/pci/built-in.o drivers/power/built-in.o drivers/power/battery/built-in.o \ drivers/power/domain/built-in.o drivers/power/fuel_gauge/built-in.o drivers/power/mfd/built-in.o \ drivers/power/pmic/built-in.o drivers/power/regulator/built-in.o drivers/serial/built-in.o \ drivers/spi/built-in.o drivers/usb/common/built-in.o drivers/usb/dwc3/built-in.o \ drivers/usb/emul/built-in.o drivers/usb/eth/built-in.o drivers/usb/gadget/built-in.o \ drivers/usb/gadget/udc/built-in.o drivers/usb/host/built-in.o drivers/usb/musb-new/built-in.o \ drivers/usb/musb/built-in.o drivers/usb/phy/built-in.o drivers/usb/ulpi/built-in.o fs/built-in.o \ lib/built-in.o net/built-in.o test/built-in.o test/dm/built-in.o --end-group \ arch/arm/lib/eabi_compat.o arch/arm/lib/lib.a -Map u-boot.map $ echo $? 0 Looking at the top couple lines of a diff between the map files of a binutils-2.27 build and this frankenbuild (both with SPL, neither with -N) gives: --- 2.27-without-N/u-boot.map 2017-03-08 13:26:26.966147350 -0500 +++ build-with-2.28-link-with-2.27/u-boot.map 2017-03-08 23:48:43.593173398 -0500 @@ -5442,7 +5442,7 @@ .iplt 0x000301a40x0 arch/arm/cpu/armv7/start.o 0x000301a4. = ALIGN (0x4) -.rodata 0x000301a80x134dc +.rodata 0x000301a80x134b8 *(SORT(.rodata*)) .rodata.efi_boot_services 0x000301a8 0xc8 lib/built-in.o @@ -5859,4836 +5859,4836 @@ .rodata.cb_erase.str1.1 0x00033745 0x60 drivers/usb/gadget/built-in.o .rodata.cb_getvar.str1.1 -0x000337a5 0xfc drivers/usb/gadget/built-in.o -0x10c (size before relaxing) +0x000337a5 0xea drivers/usb/gadget/built-in.o + 0xfa (size before relaxing) .rodata.cb_oem.str1.1 -0x000338a1 0x4e drivers/usb/gadget/built-in.o +0x0003388f 0x4e drivers/usb/gadget/built-in.o 0x5c (size befo
Re: [yocto] [meta-rockchip][PATCH] u-boot-rockchip: fix for binutils-2.28
On Wed 2017-03-08 @ 06:28:21 PM, Tom Rini wrote: Whoa! I didn't know I'd find you here :-) Bravo! > Unless there's an immediate need I would ask holding off on this for a > bit, I want to track down why this is happening. No problem. I really just want people to know I've found a work-around, just in case. -- ___ yocto mailing list yocto@yoctoproject.org https://lists.yoctoproject.org/listinfo/yocto
Re: [yocto] [meta-rockchip][PATCH] u-boot-rockchip: fix for binutils-2.28
On 17-03-08 19:01:05, Tom Rini wrote: > On Wed, Mar 08, 2017 at 03:42:00PM -0800, Khem Raj wrote: > > On 17-03-08 18:28:21, Tom Rini wrote: > > > On Wed, Mar 08, 2017 at 12:31:47PM -0500, Trevor Woerner wrote: > > > > > > > openembedded-core updated bintuils from 2.27 to 2.28 which causes > > > > u-boot to > > > > fail to compile: > > > > > > > > arm-oe-linux-gnueabi-ld.bfd: u-boot: Not enough room for > > > > program headers, try linking with -N > > > > > > > > Building with -N does fix the issue, so this patch simply adds that > > > > flag to > > > > the build so it succeeds. > > > > > > > > This has been build-tested, as well as run-tested on the firefly. > > > > > > > > Signed-off-by: Trevor Woerner > > > > > > Unless there's an immediate need I would ask holding off on this for a > > > bit, I want to track down why this is happening. > > > > perhaps linker map files from 2.27 and 2.28 binutils will help to > > understand it > > Nothing is standing out yet: > https://lists.denx.de/pipermail/u-boot/2017-March/283278.html > https://lists.denx.de/pipermail/u-boot/2017-March/283286.html I see that .data.rel.ro are generated eventhough they are empty they appear to be in final link this section will hold constant variables that gcc sees and needs dynamic relocation, that probably is not relevant to u-boot since its linked stand-alone Can you try to do just the final link with 2.28 and all built with 2.27 and see if it still happens, want to rule out assembler > > I'm asking Trevor to poke at something that would change where we link > things at and perhaps there's a linker bug here (this platform says that > we link U-Boot at 0x0). > > -- > Tom -- ___ yocto mailing list yocto@yoctoproject.org https://lists.yoctoproject.org/listinfo/yocto
Re: [yocto] [meta-rockchip][PATCH] u-boot-rockchip: fix for binutils-2.28
On Wed, Mar 08, 2017 at 03:42:00PM -0800, Khem Raj wrote: > On 17-03-08 18:28:21, Tom Rini wrote: > > On Wed, Mar 08, 2017 at 12:31:47PM -0500, Trevor Woerner wrote: > > > > > openembedded-core updated bintuils from 2.27 to 2.28 which causes u-boot > > > to > > > fail to compile: > > > > > > arm-oe-linux-gnueabi-ld.bfd: u-boot: Not enough room for program > > > headers, try linking with -N > > > > > > Building with -N does fix the issue, so this patch simply adds that flag > > > to > > > the build so it succeeds. > > > > > > This has been build-tested, as well as run-tested on the firefly. > > > > > > Signed-off-by: Trevor Woerner > > > > Unless there's an immediate need I would ask holding off on this for a > > bit, I want to track down why this is happening. > > perhaps linker map files from 2.27 and 2.28 binutils will help to > understand it Nothing is standing out yet: https://lists.denx.de/pipermail/u-boot/2017-March/283278.html https://lists.denx.de/pipermail/u-boot/2017-March/283286.html I'm asking Trevor to poke at something that would change where we link things at and perhaps there's a linker bug here (this platform says that we link U-Boot at 0x0). -- Tom -- ___ yocto mailing list yocto@yoctoproject.org https://lists.yoctoproject.org/listinfo/yocto
Re: [yocto] [meta-rockchip][PATCH] u-boot-rockchip: fix for binutils-2.28
On 17-03-08 18:28:21, Tom Rini wrote: > On Wed, Mar 08, 2017 at 12:31:47PM -0500, Trevor Woerner wrote: > > > openembedded-core updated bintuils from 2.27 to 2.28 which causes u-boot to > > fail to compile: > > > > arm-oe-linux-gnueabi-ld.bfd: u-boot: Not enough room for program > > headers, try linking with -N > > > > Building with -N does fix the issue, so this patch simply adds that flag to > > the build so it succeeds. > > > > This has been build-tested, as well as run-tested on the firefly. > > > > Signed-off-by: Trevor Woerner > > Unless there's an immediate need I would ask holding off on this for a > bit, I want to track down why this is happening. perhaps linker map files from 2.27 and 2.28 binutils will help to understand it > > -- > Tom > -- > ___ > yocto mailing list > yocto@yoctoproject.org > https://lists.yoctoproject.org/listinfo/yocto -- ___ yocto mailing list yocto@yoctoproject.org https://lists.yoctoproject.org/listinfo/yocto
Re: [yocto] [meta-rockchip][PATCH] u-boot-rockchip: fix for binutils-2.28
On Wed, Mar 08, 2017 at 12:31:47PM -0500, Trevor Woerner wrote: > openembedded-core updated bintuils from 2.27 to 2.28 which causes u-boot to > fail to compile: > > arm-oe-linux-gnueabi-ld.bfd: u-boot: Not enough room for program > headers, try linking with -N > > Building with -N does fix the issue, so this patch simply adds that flag to > the build so it succeeds. > > This has been build-tested, as well as run-tested on the firefly. > > Signed-off-by: Trevor Woerner Unless there's an immediate need I would ask holding off on this for a bit, I want to track down why this is happening. -- Tom -- ___ yocto mailing list yocto@yoctoproject.org https://lists.yoctoproject.org/listinfo/yocto
[yocto] [meta-rockchip][PATCH] u-boot-rockchip: fix for binutils-2.28
openembedded-core updated bintuils from 2.27 to 2.28 which causes u-boot to fail to compile: arm-oe-linux-gnueabi-ld.bfd: u-boot: Not enough room for program headers, try linking with -N Building with -N does fix the issue, so this patch simply adds that flag to the build so it succeeds. This has been build-tested, as well as run-tested on the firefly. Signed-off-by: Trevor Woerner --- recipes-bsp/u-boot/files/binutils-2.28-ld-fix.patch | 13 + recipes-bsp/u-boot/u-boot-rockchip_git.bb | 5 - 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 recipes-bsp/u-boot/files/binutils-2.28-ld-fix.patch diff --git a/recipes-bsp/u-boot/files/binutils-2.28-ld-fix.patch b/recipes-bsp/u-boot/files/binutils-2.28-ld-fix.patch new file mode 100644 index 000..9dfc463 --- /dev/null +++ b/recipes-bsp/u-boot/files/binutils-2.28-ld-fix.patch @@ -0,0 +1,13 @@ +Index: git/arch/arm/config.mk +=== +--- git.orig/arch/arm/config.mk git/arch/arm/config.mk +@@ -89,7 +89,7 @@ PLATFORM_LIBS := arch/arm/lib/eabi_compa + endif + + # needed for relocation +-LDFLAGS_u-boot += -pie ++LDFLAGS_u-boot += -N -pie + + # + # FIXME: binutils versions < 2.22 have a bug in the assembler where diff --git a/recipes-bsp/u-boot/u-boot-rockchip_git.bb b/recipes-bsp/u-boot/u-boot-rockchip_git.bb index 3b4f109..4887d5d 100644 --- a/recipes-bsp/u-boot/u-boot-rockchip_git.bb +++ b/recipes-bsp/u-boot/u-boot-rockchip_git.bb @@ -9,7 +9,10 @@ LICENSE = "GPLv2+" LIC_FILES_CHKSUM = "file://Licenses/README;md5=a2c678cfd4a4d97135585cad908541c6" COMPATIBLE_MACHINE = "(firefly-rk3288)" -SRC_URI = "git://github.com/rockchip-linux/u-boot.git;branch=release;" +SRC_URI = " \ + git://github.com/rockchip-linux/u-boot.git;branch=release; \ + file://binutils-2.28-ld-fix.patch \ + " SRCREV = "${AUTOREV}" S = "${WORKDIR}/git" -- 2.12.0.rc1.48.g076c053 -- ___ yocto mailing list yocto@yoctoproject.org https://lists.yoctoproject.org/listinfo/yocto