You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This was originally raised by @acassis in #1816 and #1810. However I've only just got a chance to have a look at it.
To summarize, applications built against Nuttx export when following the instructions outlined in the wiki entry, and on Alan's video on the Nuttx channel fail to launch.
As reported, the result when trying to load the application following the above method is as follows:
NuttShell (NSH) NuttX-12.1.0
nsh> ls /dev
/dev:
console
null
sda
ttyS0
nsh> hello
Hello, World!!
nsh> mount -t vfat /dev/sda /bin
nsh> ls /bin
/bin:
Testing/
hello.txt
hello
nsh> hello
elf_symname: Symbol has no name
elf_symvalue: SHN_UNDEF: Failed to get symbol name: -3
elf_relocate: Section 2 reloc 0: Undefined symbol[0] has no name: -3
_assert: Current Version: NuttX 12.1.0 9603288c80-dirty Jun 26 2023 20:01:55 arm
_assert: Assertion failed panic: at file: :0 task: hello 0x200033c8
up_dump_register: R0: 00000001 R1: 20004948 R2: 20004948 R3: 00000001
up_dump_register: R4: 200033c8 R5: 00000001 R6: 20004948 FP: 00000000
up_dump_register: R8: 00000000 SB: 00000000 SL: 00000000 R11: 00000000
up_dump_register: IP: 00000000 SP: 20005120 LR: 0800508f PC: 200033c8
up_dump_register: xPSR: 80000000 PRIMASK: 00000000 CONTROL: 00000000
up_dump_register: EXC_RETURN: fffffff9
dump_stack: User Stack:
dump_stack: base: 0x20004958
dump_stack: size: 00002008
dump_stack: sp: 0x20005120
dump_tasks: PID GROUP PRI POLICY TYPE NPX STATE EVENT SIGMASK STACKBASD
dump_task: 0 0 0 FIFO Kthread N-- Ready 0000000000000000 0x20000dk
dump_task: 1 1 224 RR Kthread --- Waiting Semaphore 0000000000000000 0x200021c
dump_task: 3 3 100 RR Kthread --- Waiting Semaphore 0000000000000000 0x200039t
dump_task: 4 4 100 RR Task --- Waiting Semaphore 0000000000000000 0x200041n
dump_task: 6 6 100 RR Task --- Running 0000000000000000 0x200049
On inspection, it seems that ARCHCPUFLAGS in the exported package may just be missing from CFLAGS in the example Makefile:
For reference, the complete update Makefile I'm using is:
EXPORT_PACKAGE=nuttx-export-12.2.1-RC0
include$(EXPORT_PACKAGE)/scripts/Make.defs
ARCHCFLAGS += -mlong-calls
ARCHWARNINGS += -Wall -Wstrict-prototypes -Wshadow -Wundef
ARCHOPTIMIZATION += -Os -fno-strict-aliasing -fno-strength-reduce -fomit-frame-pointer
ARCHINCLUDES += -I. -isystem $(EXPORT_PACKAGE)/include
CFLAGS = $(ARCHCPUFLAGS)$(ARCHCFLAGS)$(ARCHWARNINGS)$(ARCHOPTIMIZATION)$(ARCHINCLUDES) -pipe
# Setup up linker command line optionsLDRELFLAGS = -r
LDELFFLAGS = -r -e main
LDELFFLAGS += -T defines.ld -T gnu-elf.ld
# This might change in a different environmentOBJEXT ?= .o
# This is the generated ELF programBIN = hello
REL = hello.r
# These are the sources files that we useSRCS = hello.c
OBJS = $(SRCS:.c=$(OBJEXT))# Build targetsall: $(BIN).PHONY: clean
System.map: $(EXPORT_PACKAGE)/System.map
cat $(EXPORT_PACKAGE)/System.map | sed -e "s/\r//g">System.map
$(OBJS): %$(OBJEXT): %.c
$(CC) -c $(CFLAGS) -o $@$<$(REL): $(OBJS)$(LD)$(LDRELFLAGS) -o $@$<defines.ld: System.map $(REL)
./mkdefines.sh System.map "$(REL)">defines.ld
$(BIN): defines.ld $(REL)$(LD)$(LDELFFLAGS) -o $@$(REL)$(STRIP)$(REL)clean:
rm -f $(BIN)
rm -f $(REL)
rm -f defines.ld
rm -f System.map
rm -f *.o
The other files from the wiki entry remain unchanged.
I don't have access to any appropriate hardware to test this change on. However, I was able to try out the process with the rv-virt:nsh, running the application from hostfs:
NuttShell (NSH) NuttX-12.2.1-RC0
nsh> mount -t hostfs -o fs=./addon /bin
nsh> hello
Hello from Add-On Program!
nsh>
@acassis would you mind testing this on your end, with the target hardware to see if it resolves the issue.
The text was updated successfully, but these errors were encountered:
g2gps
changed the title
Issue building ELF programs with no symbol tables.
Issue building ELF programs with no symbol table.
Jul 11, 2023
This was originally raised by @acassis in #1816 and #1810. However I've only just got a chance to have a look at it.
To summarize, applications built against Nuttx export when following the instructions outlined in the wiki entry, and on Alan's video on the Nuttx channel fail to launch.
As reported, the result when trying to load the application following the above method is as follows:
On inspection, it seems that
ARCHCPUFLAGS
in the exported package may just be missing fromCFLAGS
in the example Makefile:To test, the expected arcitecture, from the inspecting the kernel:
The addon program with the original makefile:
The addon program with the updated makefile:
For reference, the complete update Makefile I'm using is:
The other files from the wiki entry remain unchanged.
I don't have access to any appropriate hardware to test this change on. However, I was able to try out the process with the
rv-virt:nsh
, running the application from hostfs:@acassis would you mind testing this on your end, with the target hardware to see if it resolves the issue.
The text was updated successfully, but these errors were encountered: