RISC-V BSP memory map

Hesham Almatary heshamelmatary at gmail.com
Mon May 28 08:48:09 UTC 2018


Hi Sebastian,



On Mon, May 28, 2018 at 6:39 AM, Sebastian Huber
<sebastian.huber at embedded-brains.de> wrote:
> Hello,
>
> on which board do the RISC-V BSPs run? The memory is located at 0x1000_0000.
>
None so far. I only ran in on Spike (RISC-V simulator). At the time of
the port (2015), there were no hardware or boards
for RISC-V

> The FE310-G000 has the ROM at 0x2000_0000 and RAM (DTIM) at 0x8000_0000.
>
> The FU540-C000 (and Qemu "virt") has the ROM at 0x2000_0000 and RAM (DDR) at
> 0x8000_0000.
>
> So, why is the memory at 0x1000_0000 and not 0x8000_0000?
>
That's basically a hack. The reason is when I tried to change RAM to
0x80000000 (above 2GiB), I get relocations errors even when I pass
-mcmodel=medany (riscv-pk and seL4 but they don't use stdlib or
startfiles from gcc). Maybe you can help with that error and suggest a
solution as I don't know?
The errors happen during linking stage of libc and crt* stuff. Please
see error log below:

riscv64-rtems5-gcc  -mcmodel=medany -march=rv64imac -mabi=lp64 -Os
-B/local/scratch/hmka2/Coding/RTEMS/build/riscv64-rtems5/c/riscv64_generic/lib/libbsp/riscv/riscv_generic
-B/local/scratch/hmka2/Coding/RTEMS/rtems/bsps/riscv/riscv_generic/start
-specs bsp_specs -qrtems -L./../../../../riscv64_generic/lib
-L/local/scratch/hmka2/Coding/RTEMS/rtems/bsps/riscv/share
d/start -Wl,--wrap=printf -Wl,--wrap=puts -Wl,--wrap=putchar  -o
loopback.exe loopback/loopback-init.o
riscv64-rtems5-gcc  -mcmodel=medany -march=rv64imac -mabi=lp64 -Os
-B/local/scratch/hmka2/Coding/RTEMS/build/riscv64-rtems5/c/riscv64_generic/lib/libbsp/riscv/riscv_generic
-B/local/scratch/hmka2/Coding/RTEMS/rtems/bsps/riscv/riscv_generic/start
-specs bsp_specs -qrtems -L./../../../../riscv64_generic/lib
-L/local/scratch/hmka2/Coding/RTEMS/rtems/bsps/riscv/share
d/start -Wl,--wrap=printf -Wl,--wrap=puts -Wl,--wrap=putchar  -o
minimum.exe minimum/minimum-init.o
/local/scratch/hmka2/development/rtems/5/lib/gcc/riscv64-rtems5/7.3.0/../../../../riscv64-rtems5/bin/ld:
/local/scratch/hmka2/development/rtems/5/lib/gcc/riscv64-rtems5/7.3.0/rv64imac/lp64/crtbegin.o:
in function `deregister_tm_clones':
crtstuff.c:(.text+0x0): relocation truncated to fit: R_RISCV_HI20
against `__TMC_LIST__'
/local/scratch/hmka2/development/rtems/5/lib/gcc/riscv64-rtems5/7.3.0/../../../../riscv64-rtems5/bin/ld:
/local/scratch/hmka2/development/rtems/5/lib/gcc/riscv64-rtems5/7.3.0/../../../../riscv64-rtems5/lib/rv64imac/lp64/libc.a(lib_a-findfp.o):
in function `std':
/local/scratch/hmka2/Coding/RTEMS/rtems-source-builder/rtems/build/riscv64-rtems5-gcc-7.3.0-newlib-3.0.0-x86_64-linux-gnu-1/build/riscv64-rtems5/rv64imac/lp64/newlib/libc/stdio/../../../../../../../gcc-7.3.0/newlib/libc/stdio/findfp.c:60:(.text+0x34):
relocation truncated to fit: R_RISCV_HI20 against symbol `__sread'
defined in .text section in /local/scratch/hmk
a2/development/rtems/5/lib/gcc/riscv64-rtems5/7.3.0/../../../../riscv64-rtems5/lib/rv64imac/lp64/libc.a(lib_a-stdio.o)
/local/scratch/hmka2/development/rtems/5/lib/gcc/riscv64-rtems5/7.3.0/../../../../riscv64-rtems5/bin/ld:
/local/scratch/hmka2/development/rtems/5/lib/gcc/riscv64-rtems5/7.3.0/../../../../riscv64-rtems5/lib/rv64imac/lp64/libc.a(lib_a-locale.o):
in function `_setlocale_r':
/local/scratch/hmka2/Coding/RTEMS/rtems-source-builder/rtems/build/riscv64-rtems5-gcc-7.3.0-newlib-3.0.0-x86_64-linux-gnu-1/build/riscv64-rtems5/rv64imac/lp64/newlib/libc/locale/../../../../../../../gcc-7.3.0/newlib/libc/locale/locale.c:295:(.text+0x8):
relocation truncated to fit: R_RISCV_HI20 against `.LC0'
/local/scratch/hmka2/development/rtems/5/lib/gcc/riscv64-rtems5/7.3.0/../../../../riscv64-rtems5/bin/ld:
/local/scratch/hmka2/development/rtems/5/lib/gcc/riscv64-rtems5/7.3.0/../../../../riscv64-rtems5/lib/rv64imac/lp64/libc.a(lib_a-mbtowc_r.o):
in function `__get_current_locale':
/local/scratch/hmka2/Coding/RTEMS/rtems-source-builder/rtems/build/riscv64-rtems5-gcc-7.3.0-newlib-3.0.0-x86_64-linux-gnu-1/build/riscv64-rtems5/rv64imac/lp64/newlib/libc/stdlib/../../../../../../../gcc-7.3.0/newlib/libc/stdlib/../locale/setlocale.h:230:(.text+0x20):
relocation truncated to fit: R_RISCV_HI20 against symbol
`__global_locale' defined in .data secti
on in /local/scratch/hmka2/development/rtems/5/lib/gcc/riscv64-rtems5/7.3.0/../../../../riscv64-rtems5/lib/rv64imac/lp64/libc.a(lib_a-locale.o)
/local/scratch/hmka2/development/rtems/5/lib/gcc/riscv64-rtems5/7.3.0/../../../../riscv64-rtems5/bin/ld:
/local/scratch/hmka2/development/rtems/5/lib/gcc/riscv64-rtems5/7.3.0/../../../../riscv64-rtems5/lib/rv64imac/lp64/libc.a(lib_a-strcpy.o):
in function `__libc_detect_null':
/local/scratch/hmka2/Coding/RTEMS/rtems-source-builder/rtems/build/riscv64-rtems5-gcc-7.3.0-newlib-3.0.0-x86_64-linux-gnu-1/build/riscv64-rtems5/rv64imac/lp64/newlib/libc/machine/riscv/../../../../../../../../gcc-7.3.0/newlib/libc/machine/riscv/sys/string.h:20:(.text+0x8):
relocation truncated to fit: R_RISCV_HI20 against `.LC0'
/local/scratch/hmka2/development/rtems/5/lib/gcc/riscv64-rtems5/7.3.0/../../../../riscv64-rtems5/bin/ld:
/local/scratch/hmka2/development/rtems/5/lib/gcc/riscv64-rtems5/7.3.0/../../../../riscv64-rtems5/lib/rv64imac/lp64/libc.a(lib_a-strlen.o):
in function `strlen':
/local/scratch/hmka2/Coding/RTEMS/rtems-source-builder/rtems/build/riscv64-rtems5-gcc-7.3.0-newlib-3.0.0-x86_64-linux-gnu-1/build/riscv64-rtems5/rv64imac/lp64/newlib/libc/machine/riscv/../../../../../../../../gcc-7.3.0/newlib/libc/machine/riscv/strlen.c:24:(.text+0x8):
relocation truncated to fit: R_RISCV_HI20 against `.LC0'
/local/scratch/hmka2/development/rtems/5/lib/gcc/riscv64-rtems5/7.3.0/../../../../riscv64-rtems5/bin/ld:
/local/scratch/hmka2/development/rtems/5/lib/gcc/riscv64-rtems5/7.3.0/../../../../riscv64-rtems5/lib/rv64imac/lp64/libc.a(lib_a-wctomb_r.o):
in function `__get_current_locale':
/local/scratch/hmka2/Coding/RTEMS/rtems-source-builder/rtems/build/riscv64-rtems5-gcc-7.3.0-newlib-3.0.0-x86_64-linux-gnu-1/build/riscv64-rtems5/rv64imac/lp64/newlib/libc/stdlib/../../../../../../../gcc-7.3.0/newlib/libc/stdlib/../locale/setlocale.h:230:(.text+0x1c):
relocation truncated to fit: R_RISCV_HI20 against symbol
`__global_locale' defined in .data secti
on in /local/scratch/hmka2/development/rtems/5/lib/gcc/riscv64-rtems5/7.3.0/../../../../riscv64-rtems5/lib/rv64imac/lp64/libc.a(lib_a-locale.o)
/local/scratch/hmka2/development/rtems/5/lib/gcc/riscv64-rtems5/7.3.0/../../../../riscv64-rtems5/bin/ld:
/local/scratch/hmka2/development/rtems/5/lib/gcc/riscv64-rtems5/7.3.0/../../../../riscv64-rtems5/lib/rv64imac/lp64/libc.a(lib_a-__atexit.o):
in function `__register_exitproc':
/local/scratch/hmka2/Coding/RTEMS/rtems-source-builder/rtems/build/riscv64-rtems5-gcc-7.3.0-newlib-3.0.0-x86_64-linux-gnu-1/build/riscv64-rtems5/rv64imac/lp64/newlib/libc/stdlib/../../../../../../../gcc-7.3.0/newlib/libc/stdlib/__atexit.c:75:(.text+0x4):
relocation truncated to fit: R_RISCV_HI20 against symbol
`__atexit_recursive_mutex' defined in .bss section in
 /local/scratch/hmka2/development/rtems/5/lib/gcc/riscv64-rtems5/7.3.0/../../../../riscv64-rtems5/lib/rv64imac/lp64/libc.a(lib_a-__call_atexit.o)
/local/scratch/hmka2/development/rtems/5/lib/gcc/riscv64-rtems5/7.3.0/../../../../riscv64-rtems5/bin/ld:
/local/scratch/hmka2/development/rtems/5/lib/gcc/riscv64-rtems5/7.3.0/../../../../riscv64-rtems5/lib/rv64imac/lp64/libc.a(lib_a-__call_atexit.o):
in function `__call_exitprocs':
/local/scratch/hmka2/Coding/RTEMS/rtems-source-builder/rtems/build/riscv64-rtems5-gcc-7.3.0-newlib-3.0.0-x86_64-linux-gnu-1/build/riscv64-rtems5/rv64imac/lp64/newlib/libc/stdlib/../../../../../../../gcc-7.3.0/newlib/libc/stdlib/__call_atexit.c:79:(.text+0x4):
relocation truncated to fit: R_RISCV_HI20 against `.LANCHOR0'
/local/scratch/hmka2/development/rtems/5/lib/gcc/riscv64-rtems5/7.3.0/../../../../riscv64-rtems5/bin/ld:
/local/scratch/hmka2/development/rtems/5/lib/gcc/riscv64-rtems5/7.3.0/../../../../riscv64-rtems5/lib/rv64imac/lp64/libc.a(lib_a-fflush.o):
in function `fflush':
/local/scratch/hmka2/Coding/RTEMS/rtems-source-builder/rtems/build/riscv64-rtems5-gcc-7.3.0-newlib-3.0.0-x86_64-linux-gnu-1/build/riscv64-rtems5/rv64imac/lp64/newlib/libc/stdio/../../../../../../../gcc-7.3.0/newlib/libc/stdio/fflush.c:291:(.text+0x24e):
relocation truncated to fit: R_RISCV_HI20 against symbol `_fflush_r'
defined in .text section in /local/scratch
/hmka2/development/rtems/5/lib/gcc/riscv64-rtems5/7.3.0/../../../../riscv64-rtems5/lib/rv64imac/lp64/libc.a(lib_a-fflush.o)
/local/scratch/hmka2/development/rtems/5/lib/gcc/riscv64-rtems5/7.3.0/../../../../riscv64-rtems5/bin/ld:
/local/scratch/hmka2/development/rtems/5/lib/gcc/riscv64-rtems5/7.3.0/rv64imac/lp64/libgcc.a(_clzsi2.o):
in function `__clzdi2':
/local/scratch/hmka2/Coding/RTEMS/rtems-source-builder/rtems/build/riscv64-rtems5-gcc-7.3.0-newlib-3.0.0-x86_64-linux-gnu-1/build/riscv64-rtems5/rv64imac/lp64/libgcc/../../../../../gcc-7.3.0/libgcc/libgcc2.c:710:(.text+0x12):
additional relocation overflows omitted from the output

> --
> Sebastian Huber, embedded brains GmbH
>
> Address : Dornierstr. 4, D-82178 Puchheim, Germany
> Phone   : +49 89 189 47 41-16
> Fax     : +49 89 189 47 41-09
> E-Mail  : sebastian.huber at embedded-brains.de
> PGP     : Public key available on request.
>
> Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
>



-- 
Hesham



More information about the devel mailing list