xtensa-fsf-ld: dangerous relocation: call8: call target out of range

Sterling Augustine augustine.sterling@gmail.com
Mon Jul 16 18:52:00 GMT 2012


On Mon, Jul 16, 2012 at 8:31 AM, Max Filippov <jcmvbkbc@gmail.com> wrote:
>
> Sorry, missed CC to you.
>
> ---------- Forwarded message ----------
> From: Max Filippov <jcmvbkbc@gmail.com>
> Date: Mon, Jul 16, 2012 at 6:26 PM
> Subject: xtensa-fsf-ld: dangerous relocation: call8: call target out of range
> To: binutils@sourceware.org
> Cc: Marc Gauthier <marc@tensilica.com>
>
>
> Hello.
>
> I'm trying to build linux kernel for FSF xtensa core using binutils-2.22.
> In the final linking step I get the following error:
>
> + /home/dumb/ws/tensilica/tools/xtensa-toolchain-build/build-xtensa-fsf-elf/root/bin/xtensa-fsf-elf-ld
> --build-id -o .tmp_vmlinux2 -T
> /home/dumb/ws/tensilica/linux/linux-build/fsf/defconfig/arch/xtensa/kernel/vmlinux.lds
> arch/xtensa/kernel/head.o init/built-in.o --start-group usr/built-in.o
> arch/xtensa/kernel/built-in.o arch/xtensa/mm/built-in.o
> arch/xtensa/platforms/iss/built-in.o kernel/built-in.o mm/built-in.o
> fs/built-in.o ipc/built-in.o security/built-in.o crypto/built-in.o
> block/built-in.o lib/lib.a arch/xtensa/lib/lib.a
> /home/dumb/ws/tensilica/tools/xtensa-toolchain-build/build-xtensa-fsf-elf/root/lib/gcc/xtensa-fsf-elf/4.6.3/libgcc.a
> lib/built-in.o arch/xtensa/lib/built-in.o
> /home/dumb/ws/tensilica/tools/xtensa-toolchain-build/build-xtensa-fsf-elf/root/lib/gcc/xtensa-fsf-elf/4.6.3/libgcc.a
> drivers/built-in.o sound/built-in.o firmware/built-in.o net/built-in.o
> --end-group .tmp_kallsyms1.o
> net/built-in.o: In function `fib_net_init':
> fib_frontend.c:(.init.text+0x1553): dangerous relocation: call8: call
> target out of range: (.text+0x3eb38)
>
> If I add --no-relax ld option to this link step everything works fine.
>
> Referenced portion of the object file (net/built-in.o) looks like this:
>
>     1550:       180000          l32r    a8, fffc1550
> <unregister_net_sysctl_table+0xfff6eb90>
>                         1550: R_XTENSA_SLOT0_OP .init.literal+0x5a0
>                         1550: R_XTENSA_ASM_EXPAND       fib_trie_table
>     1553:       0b8000          callx8  a8
>     1556:       caa3            beqz.n  a10, 157d <fib_net_init+0x5d>
>
> Can anybody suggest the way to debug/fix it?


Looks like a linker bug to me. Quite likely the relaxer is
mis-estimating the distance to the call target, and converting the
l32r-callx8 sequence to a single call8 which can't reach. In the short
tem, --no-relax-ld is your only option. Your code will be slightly
larger and slightly slower, but it shouldn't be a dealbreaker.

In the longer term, someone at Tensilica will need to submit a patch,
so full repro instructions would be very good here. I think Tensilica
might maintain some private patches, but I don't know if they have
anything addresses this one. Marc?

Sterling



More information about the Binutils mailing list