bsp,am,integrate-am-apps: do not rename text and rodata sections

* they will be placed according to the AM linker script
This commit is contained in:
Zihao Yu 2024-01-17 11:54:13 +08:00
parent 3257709e16
commit 6972e89b7a

View file

@ -63,8 +63,9 @@ def integrate(app_dir):
redefine_sym_fp.write(f"__am_{app_name}_{f} {f}\n")
redefine_sym_fp.close()
for obj in objs:
os.system(f"{CROSS_COMPILE}objcopy --prefix-symbols=__am_{app_name}_ --prefix-sections=__am_apps {str(obj)}")
os.system(f"{CROSS_COMPILE}objcopy --redefine-syms=redefine_sym.txt {str(obj)}")
os.system(f"{CROSS_COMPILE}objcopy --prefix-symbols=__am_{app_name}_ --set-section-flags .text*=readonly,noload --set-section-flags .*rodata*=readonly,noload {str(obj)}")
os.system(f"{CROSS_COMPILE}objcopy --redefine-syms=redefine_sym.txt --prefix-alloc-sections=__am_apps {str(obj)}")
os.system(f"{CROSS_COMPILE}objcopy --set-section-flags .text*=readonly,code,alloc --set-section-flags .*rodata*=readonly,data,alloc {str(obj)}")
am_app_mk_fp.write("SRCS += " + str(obj.relative_to("build/" + ARCH)) + "\n")
os.remove(redefine_sym_file)
am_app_c_fp.write(f"""extern int __am_{app_name}_main(const char *);