4
0
mirror of https://github.com/RT-Thread/rt-thread.git synced 2025-03-02 09:35:28 +08:00

[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' CXXFLAGS= DEVICE + CFPFLAGS + ' -Wall -fdiagnostics-color=always'
CFLAGS = DEVICE + CFPFLAGS + ' -Wall -Wno-cpp -std=gnu99 -fdiagnostics-color=always' CFLAGS = DEVICE + CFPFLAGS + ' -Wall -Wno-cpp -std=gnu99 -fdiagnostics-color=always'
AFLAGS = ' -c' + AFPFLAGS + ' -x assembler-with-cpp' 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 = '' CPATH = ''
LPATH = '' LPATH = ''

View File

@ -12,6 +12,8 @@ bsp_path = Dir('#').abspath
if not os.path.exists(bsp_path + "/link.lds"): if not os.path.exists(bsp_path + "/link.lds"):
Env['LINKFLAGS'] = Env['LINKFLAGS'].replace('link.lds', cwd + "/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]) Preprocessing("link.lds.S", ".lds", CPPPATH=[bsp_path])
# add common code files # 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 #ifdef RT_USING_SMART
unsigned long va = KERNEL_VADDR_START; unsigned long va = KERNEL_VADDR_START;
#else #else
extern unsigned char __start; extern unsigned char _start;
unsigned long va = (unsigned long) &__start; unsigned long va = (unsigned long) &_start;
va = RT_ALIGN_DOWN(va, 0x200000); va = RT_ALIGN_DOWN(va, 0x200000);
#endif #endif

View File

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