Skip to contentSkip to conversation

Linking Error on env_get("loadaddr")

DISCUSSION Oliver Graute 3 participants 3 messages Nov 2, 2020 – Nov 3, 2020

lore
Share & tools
lore
#0 lore raw

Hello list,

I try to use env_get("loadaddr") for a board specific CMD and included env.h. But I get the following linking error in nvedit.c. Some clue what I miss here? I still use v2020.07.

start=$(aarch64-linux-gnu-nm u-boot | grep __rel_dyn_start | cut -f 1 -d ' '); end=$(aarch64-linux-gnu-nm u-boot | grep __rel_dyn_end | cut -f 1 -d ' '); tools/relocate-rela u-boot-nodtb.bin 0x80020000 $start $end

  CC      spl/arch/arm/cpu/armv8/fwcall.o
  LD      spl/arch/arm/cpu/armv8/built-in.o
  CC      spl/common/spl/spl.o
  LD      spl/common/spl/built-in.o
  CC      spl/lib/display_options.o
  LD      spl/lib/built-in.o
  LD      spl/u-boot-spl

cmd/built-in.o: In function `env_match':
/home/graute/u-boot-test/cmd/nvedit.c:804: undefined reference to env_get_char' /home/graute/u-boot-test/cmd/nvedit.c:808: undefined reference to env_get_char' cmd/built-in.o: In function `env_get_f':
/home/graute/u-boot-test/cmd/nvedit.c:713: undefined reference to env_get_char' /home/graute/u-boot-test/cmd/nvedit.c:716: undefined reference to env_get_char' /home/graute/u-boot-test/cmd/nvedit.c:729: undefined reference to env_get_char' cmd/built-in.o: In function env_get':
/home/graute/u-boot-test/cmd/nvedit.c:677: undefined reference to env_htab' /home/graute/u-boot-test/cmd/nvedit.c:677: undefined reference to env_htab' lib/built-in.o: In function `hsearch_r':
/home/graute/u-boot-test/lib/hashtable.c:402: undefined reference to `env_flags_init' scripts/Makefile.spl:422: recipe for target 'spl/u-boot-spl' failed make[1]: *** [spl/u-boot-spl] Error 1
Makefile:1926: recipe for target 'spl/u-boot-spl' failed
make: *** [spl/u-boot-spl] Error 2

Best Regards,

Oliver

#1 lore raw
Quoted 5 lines · Oliver Graute

Hello list,

I try to use env_get("loadaddr") for a board specific CMD and included env.h. But I get the following linking error in nvedit.c. Some clue what I miss here? I still use v2020.07.

Did you check whether CONFIG_SPL_ENV_SUPPORT is enabled?

Quoted 31 lines

start=$(aarch64-linux-gnu-nm u-boot | grep __rel_dyn_start | cut -f 1 -d ' '); end=$(aarch64-linux-gnu-nm u-boot | grep __rel_dyn_end | cut -f 1 -d ' '); tools/relocate-rela u-boot-nodtb.bin 0x80020000 $start $end

  CC      spl/arch/arm/cpu/armv8/fwcall.o
  LD      spl/arch/arm/cpu/armv8/built-in.o
  CC      spl/common/spl/spl.o
  LD      spl/common/spl/built-in.o
  CC      spl/lib/display_options.o
  LD      spl/lib/built-in.o
  LD      spl/u-boot-spl

cmd/built-in.o: In function `env_match':
/home/graute/u-boot-test/cmd/nvedit.c:804: undefined reference to env_get_char' /home/graute/u-boot-test/cmd/nvedit.c:808: undefined reference to env_get_char' cmd/built-in.o: In function `env_get_f':
/home/graute/u-boot-test/cmd/nvedit.c:713: undefined reference to env_get_char' /home/graute/u-boot-test/cmd/nvedit.c:716: undefined reference to env_get_char' /home/graute/u-boot-test/cmd/nvedit.c:729: undefined reference to env_get_char' cmd/built-in.o: In function env_get':
/home/graute/u-boot-test/cmd/nvedit.c:677: undefined reference to env_htab' /home/graute/u-boot-test/cmd/nvedit.c:677: undefined reference to env_htab' lib/built-in.o: In function `hsearch_r':
/home/graute/u-boot-test/lib/hashtable.c:402: undefined reference to `env_flags_init' scripts/Makefile.spl:422: recipe for target 'spl/u-boot-spl' failed make[1]: *** [spl/u-boot-spl] Error 1
Makefile:1926: recipe for target 'spl/u-boot-spl' failed
make: *** [spl/u-boot-spl] Error 2

Best Regards,

Oliver

#2 lore raw
Quoted 8 lines · Jaehoon Chung
Quoted 5 lines · Oliver Graute

Hello list,

I try to use env_get("loadaddr") for a board specific CMD and included env.h. But I get the following linking error in nvedit.c. Some clue what I miss here? I still use v2020.07.

Did you check whether CONFIG_SPL_ENV_SUPPORT is enabled?

thx this solved my issue.

Best Regards,

Oliver