sim: Fix sim m32 start up crash issue.

After compilation, when starting nsh, the following crash occurs.
==2500151==Shadow memory range interleaves with an existing memory mapping. ASan cannot proceed correctly. ABORTING.
==2500151==ASan shadow was supposed to be located in the [0x1ffff000-0x3fffffff] range.
==2500151==Process memory map follows:
0x30000000-0x33dd4000 /nuttx/nuttx

To avoid overlaps, change the starting address of the text segment.

Using Ttext-segment=0x30000000 causes a crash when starting the 32-bit SIM.
Using -Ttext-segment=0x50000000 causes a crash when starting the 64-bit SIM.
Setting -Ttext-segment=0x40000000 resolves all issues perfectly.

Signed-off-by: cuiziwei <cuiziwei@xiaomi.com>
This commit is contained in:
cuiziwei 2024-11-22 22:38:12 +08:00 committed by Xiang Xiao
parent 2d20de72be
commit 8e58245524
2 changed files with 3 additions and 3 deletions

View file

@ -196,5 +196,5 @@ if(APPLE)
add_link_options(-Wl,-dead_strip)
else()
add_link_options(-Wl,--gc-sections)
add_link_options(-Wl,-Ttext-segment=0x30000000)
add_link_options(-Wl,-Ttext-segment=0x40000000)
endif()

View file

@ -296,9 +296,9 @@ ifeq ($(CONFIG_HOST_MACOS),y)
else
LDFLAGS += -Wl,--gc-sections
# Let the symbol table link from 0x30000000
# Let the symbol table link from 0x40000000
# which is more convenient for debugging.
LDFLAGS += -Wl,-Ttext-segment=0x30000000
LDFLAGS += -Wl,-Ttext-segment=0x40000000
endif
ifeq ($(CONFIG_DEBUG_LINK_MAP),y)