#4658 closed defect (fixed)

Fix build issue with riscv sample test

Reported by: Ryan Long Owned by:
Priority: normal Milestone: 6.1
Component: arch/riscv Version: 6
Severity: normal Keywords:
Cc: Blocked By:


When trying to build the minimum sample test for any RISC-V BSP, the following error occurs.

start.o: in function .L0:

/home/tester/rtems-cron-6/rtems/build/riscv/rv32i/../../../bsps/riscv/shared/start/start.S:84:(.bsp_start_text+0x2c): relocation truncated to fit: R_RISCV_GPREL_I against symbol 'bsp_section_bss_size' defined in *ABS* section in /home/tester/rtems-cron-6/rtems/build/riscv/rv32i/testsuites/samples/minimum.exe

collect2: error: ld returned 1 exit status

Change History (4)

comment:1 Changed on 05/18/22 at 06:26:58 by Sebastian Huber

I cannot reproduce this issue on my development machines. It could be an issue in the linker. I would run the linker in GDB and try to debug it to figure out what is going on.

comment:2 Changed on 10/28/22 at 11:53:25 by Sebastian Huber <sebastian.huber@…>

In 89ba2a98/rtems:

bsps/riscv: Workaround for sporadic linker issues

Disable the linker relaxation in start.S to work around an issue described


The real issue is probably in the linker command file or the linker itself.

Update #4658.

comment:3 Changed on 11/04/22 at 12:50:15 by Sebastian Huber <sebastian.huber@…>

In b4ffaa7c/rtems:

bsps/riscv: Use start data for object

Maybe this helps to ensure that the object is properly aligned.

Update #4658.

comment:4 Changed on 11/29/22 at 23:55:04 by Chris Johns

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.