生成位置无关的代码
This commit is contained in:
@@ -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