Merge pull request #1868 from jg1uaa/master

change hello.mo building process, compile and link separately
This commit is contained in:
Bernard Xiong 2018-11-05 09:14:02 +08:00 committed by GitHub
commit c7d9daefaa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 5 additions and 12 deletions

View File

@ -7,7 +7,7 @@ all: rtthread rtsym exe dll floppy.img
@sudo mount -t vfat floppy.img tmp -o loop @sudo mount -t vfat floppy.img tmp -o loop
@sudo cp -fv rtthread.elf tmp/boot/oskernel @sudo cp -fv rtthread.elf tmp/boot/oskernel
@sudo rm tmp/bin/* -fr @sudo rm tmp/bin/* -fr
@sudo cp out/* tmp/bin/ -fv @sudo cp out/*.mo tmp/bin/ -fv
@sudo umount tmp @sudo umount tmp
rtthread: rtthread:
@ -23,7 +23,8 @@ out:
mkdir -p out mkdir -p out
dll: obj out dll: obj out
$(CC) -shared -s -fPIC -e main -Isrc src/hello.c -o out/hello.mo $(CC) -c -fPIC -Isrc src/hello.c -o out/hello.o
$(CC) -s -Wl,-shared,-melf_i386,--entry=main -o out/hello.mo out/hello.o
disasm: obj out disasm: obj out
$(CC) -shared -S -fPIC -Isrc src/hello.c -o obj/hello.s $(CC) -shared -S -fPIC -Isrc src/hello.c -o obj/hello.s

View File

@ -48,7 +48,7 @@ void components_init(void)
#endif #endif
#ifdef RT_USING_MODULE #ifdef RT_USING_MODULE
rt_system_module_init(); rt_system_dlmodule_init();
#endif #endif
#endif #endif
} }

View File

@ -71,12 +71,4 @@ void reboot(void)
} }
FINSH_FUNCTION_EXPORT(reboot, reboot PC) FINSH_FUNCTION_EXPORT(reboot, reboot PC)
#endif #endif
#ifdef RT_USING_DFS
#include <time.h>
time_t time(time_t* tm)
{
(void)tm;
return 0;
}
#endif
/*@}*/ /*@}*/

View File

@ -11,7 +11,7 @@
#include "../dlmodule.h" #include "../dlmodule.h"
#include "../dlelf.h" #include "../dlelf.h"
#ifdef __x86__ #ifdef __i386__
#define R_X86_64_GLOB_DAT 6 /* Create GOT entry */ #define R_X86_64_GLOB_DAT 6 /* Create GOT entry */
#define R_X86_64_JUMP_SLOT 7 /* Create PLT entry */ #define R_X86_64_JUMP_SLOT 7 /* Create PLT entry */