生成位置无关的代码
This commit is contained in:
@@ -9,7 +9,7 @@ void set_r9(void *r9);
|
||||
|
||||
|
||||
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȫ<EFBFBD>ֱ<EFBFBD><D6B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ
|
||||
static void * const g_r9;
|
||||
static void * const volatile g_r9;
|
||||
|
||||
//ָ<><D6B8>app<70><70><EFBFBD><EFBFBD>
|
||||
static app_struct *g_me;
|
||||
|
@@ -23,7 +23,7 @@
|
||||
|
||||
|
||||
#define APP_INFO(name_,type_,size_,pro_) \
|
||||
const app_info_struct __app_info= \
|
||||
const app_info_struct __app_info __attribute__((used,section(".__app_info"))) = \
|
||||
{\
|
||||
.name=name_,\
|
||||
.exe_type=type_,\
|
||||
|
@@ -7,13 +7,14 @@
|
||||
|
||||
|
||||
|
||||
|
||||
char g_test_str[]="hello world";
|
||||
|
||||
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
int my_main (void *ptr)
|
||||
{
|
||||
global_init(ptr);
|
||||
global_run_start();
|
||||
printf("%s\n", g_test_str);
|
||||
|
||||
//<2F><>ֹ<EFBFBD><D6B9><EFBFBD><EFBFBD><EFBFBD>ظ<EFBFBD><D8B8><EFBFBD><EFBFBD><EFBFBD>
|
||||
WIN_WindowStruct *win=0;
|
||||
|
@@ -85,6 +85,7 @@
|
||||
api_item realloc,40 @
|
||||
api_item strlen,500
|
||||
api_item sprintf,501
|
||||
api_item puts,502
|
||||
|
||||
|
||||
|
||||
|
@@ -29,8 +29,12 @@ CFLAG=[
|
||||
|
||||
# debug
|
||||
'-g -gdwarf-2',
|
||||
'-fpic',
|
||||
'-e my_main -Wl,--section-start=.app_info=0x00000000 -nostartfiles -nodefaultlibs'
|
||||
'-fpie',
|
||||
'-fno-plt',
|
||||
'-e my_main -nostartfiles -nodefaultlibs',
|
||||
'-Wl,--section-start=.__app_info=0x00000000',
|
||||
'-Wl,--no-dynamic-linker',
|
||||
'-Wl,--undefined=__app_info'
|
||||
]
|
||||
|
||||
DEF=[
|
||||
@@ -238,7 +242,7 @@ def build_target(src:list):
|
||||
dst=os.path.join(OUTPUT,TARGET)+".elf"
|
||||
if(check_rebuild(dst,obj_list)):
|
||||
rsp=f"{' '.join(obj_list)} -o {dst} {flags} \
|
||||
-Wl,-Map={OUTPUT}/{TARGET}.map,--cref -Wl,--gc-sections \
|
||||
-Wl,-Map={OUTPUT}/{TARGET}.map,--cref -Wl,-pie -Wl,--gc-sections \
|
||||
-Wl,-print-memory-usage"
|
||||
print(f"链接 {dst}")
|
||||
with open(f"{OUTPUT}/{TARGET}.rsp",'w+') as f:
|
||||
|
Reference in New Issue
Block a user