yf13 commented on code in PR #17486:
URL: https://github.com/apache/nuttx/pull/17486#discussion_r2613655950


##########
arch/z80/src/z80/Toolchain.defs:
##########
@@ -121,5 +121,9 @@ LDMODULEFLAGS = -r -T $(call 
CONVERT_PATH,$(TOPDIR)/libs/libc/elf/gnu-elf.ld)
 CELFFLAGS = $(CFLAGS) -fvisibility=hidden
 CXXELFFLAGS = $(CXXFLAGS) -fvisibility=hidden
 
-LDELFFLAGS = -r -e __start
+ifeq ($(CONFIG_BINFMT_ELF_RELOCATABLE),y)
+  LDELFFLAGS = -r
+else
+  LDELFFLAGS = -e _start

Review Comment:
   I tried that but it leads to below error when building `maix-bit/elf`:
   ```
   LD: nuttx
   riscv64-unknown-elf-ld:  
/tmp/nuttx/staging/libapps.a(symtab.c.tmp.apps.examples.elf_1.o): 
(.rodata.g_elf_exports+0x38): undefined reference to `_start'
   ```
   Because `-e _start` caused `U _start`  in `errno`, which leads to above 
undefined error.
   My feeling is `-r` option implies that no need for `-e`.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to