[libcpu] fix symbol of kernel entry point (#8159)

Signed-off-by: Shell <smokewood@qq.com>
This commit is contained in:
Shell 2023-10-20 13:27:38 +08:00 committed by GitHub
parent 552b5406b5
commit 07b23ecbb1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 9 additions and 7 deletions

View File

@ -30,7 +30,7 @@ if PLATFORM == 'gcc':
CXXFLAGS= DEVICE + CFPFLAGS + ' -Wall -fdiagnostics-color=always'
CFLAGS = DEVICE + CFPFLAGS + ' -Wall -Wno-cpp -std=gnu99 -fdiagnostics-color=always'
AFLAGS = ' -c' + AFPFLAGS + ' -x assembler-with-cpp'
LFLAGS = DEVICE + ' -nostartfiles -Wl,--gc-sections,-Map=rtthread.map,-cref,-u,system_vectors -T link.lds' + ' -lsupc++ -lgcc -static'
LFLAGS = DEVICE + ' -Wl,--gc-sections,-Map=rtthread.map,-cref,-u,system_vectors -T link.lds' + ' -lsupc++ -lgcc -static'
CPATH = ''
LPATH = ''

View File

@ -12,6 +12,8 @@ bsp_path = Dir('#').abspath
if not os.path.exists(bsp_path + "/link.lds"):
Env['LINKFLAGS'] = Env['LINKFLAGS'].replace('link.lds', cwd + "/link.lds")
# fix the linker with crtx.o
Env['LINKFLAGS'] += ' -nostartfiles'
Preprocessing("link.lds.S", ".lds", CPPPATH=[bsp_path])
# add common code files

View File

@ -803,8 +803,8 @@ void rt_hw_mem_setup_early(unsigned long *tbl0, unsigned long *tbl1,
#ifdef RT_USING_SMART
unsigned long va = KERNEL_VADDR_START;
#else
extern unsigned char __start;
unsigned long va = (unsigned long) &__start;
extern unsigned char _start;
unsigned long va = (unsigned long) &_start;
va = RT_ALIGN_DOWN(va, 0x200000);
#endif

View File

@ -38,8 +38,8 @@ boot_arg1 .req x23
boot_arg2 .req x24
stack_top .req x25
.global __start
__start:
.global _start
_start:
/*
* Boot CPU general-purpose register settings:
* x0 = physical address of device tree blob (dtb) in system RAM.
@ -165,8 +165,8 @@ __start:
dsb sy
#ifdef RT_USING_SMART
ldr x2, =__start
GET_PHY x3, __start
ldr x2, =_start
GET_PHY x3, _start
sub x3, x3, x2
#else
mov x3,0