arch/sim:add -Ttext-segment to load the image in the fixed address

to make the address returned by backtrace and gdbstub match the symbol stored in elf.

Signed-off-by: anjiahao <anjiahao@xiaomi.com>
This commit is contained in:
anjiahao 2023-07-17 16:31:14 +08:00 committed by Xiang Xiao
parent ec97cc8a31
commit 307e0eb964

View File

@ -264,3 +264,10 @@ ifeq ($(CONFIG_SIM_M32),y)
LDMODULEFLAGS += -melf_i386
LDELFFLAGS += -melf_i386
endif
# Let the symbol table link from 0x400000
# which is more convenient for debugging.
ifeq ($(CONFIG_HOST_MACOS),n)
LDFLAGS += -Wl,-Ttext-segment=0x400000
endif