Skip to contentSkip to conversation

P2041RDB: gcc 4.8.2/binutils 2.23.1 default to new GOT table layout

U-Boot Joerg Albert 2 participants 2 messages Feb 10, 2014 – Feb 12, 2014

lore
Share & tools
lore
#0 lore raw

Hi,

I've recently compiled U-Boot (fsl-sdk-v1.3.2) for P2041RDB and had a problem with ARP requests flooding if the peer was not there. It turned out that NetArpWaitTimerStart was not relocated to RAM, but remained in flash, so it couldn't be updated.

Looking at the global offset table, it looks like the linker generates (by default) a new layout, without _GLOBAL_OFFSET_TABLE_ [-1] == blrl (as required by the EABI) and NetArpWaitTimerStart is the entry at _GLOBAL_OFFSET_TABLE_ [-1].
u-boot.lds still assumes the blrl in the GOT.

Putting a

LDFLAGS_FINAL += --bss-plt

into board/freescale/p2041rdb/config.mk

brought the blrl instruction in the GOT back and solved the ARP problem.

I compiled v2014.01-116-g0c57033 for P2041RDB without --bss-plt and the blrl was missing in the GOT as well.

--bss-plt is rarely documented, will it cause some other problems?

Are gcc 4.8.x and binutils 2.23.1 recommended to use with U-Boot or shall we stick to older versions?

Regards,
Joerg

#1 lore raw
Quoted 13 lines · Joerg Albert

Hi,

I've recently compiled U-Boot (fsl-sdk-v1.3.2) for P2041RDB and had a problem with ARP requests flooding if the peer was not there. It turned out that NetArpWaitTimerStart was not relocated to RAM, but remained in flash, so it couldn't be updated.

Looking at the global offset table, it looks like the linker generates (by default) a new layout, without _GLOBAL_OFFSET_TABLE_ [-1] == blrl (as required by the EABI) and NetArpWaitTimerStart is the entry at _GLOBAL_OFFSET_TABLE_ [-1].
u-boot.lds still assumes the blrl in the GOT.

Quoted 3 lines

Putting a

LDFLAGS_FINAL += --bss-plt

Do you mean -mbss-plt?

Quoted 11 lines

into board/freescale/p2041rdb/config.mk

brought the blrl instruction in the GOT back and solved the ARP problem.

I compiled v2014.01-116-g0c57033 for P2041RDB without --bss-plt and the blrl was missing in the GOT as well.

--bss-plt is rarely documented, will it cause some other problems?

Are gcc 4.8.x and binutils 2.23.1 recommended to use with U-Boot or shall we stick to older versions?

For the SDK U-Boot, it's best to use the toolchain that came with the SDK.

For mainline U-Boot, please submit a patch.

-Scott