From 9b1c63d049952df8e74648f5ec3dba90fba5f217 Mon Sep 17 00:00:00 2001 From: HsFatal Date: Sun, 8 Aug 2021 13:16:12 +0800 Subject: [PATCH] Modify the calculation of the size of text section and data section. --- tools/tcc/linkerscript/a.out.lds | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/tcc/linkerscript/a.out.lds b/tools/tcc/linkerscript/a.out.lds index a7f7f41..ce65aa6 100644 --- a/tools/tcc/linkerscript/a.out.lds +++ b/tools/tcc/linkerscript/a.out.lds @@ -24,8 +24,8 @@ SECTIONS *(.symtab) PROVIDE(.sym_end = .); } - PROVIDE(.textsize = (SIZEOF(.text) + 0x400 - 1) & ~( 0x400 - 1 )); - PROVIDE(.datasize = (SIZEOF(.data) + 0x400 - 1) & ~( 0x400 - 1 )); + PROVIDE(.textsize = .data_begin - .text_begin); + PROVIDE(.datasize = .bss_begin - .data_begin); PROVIDE(.bsssize = SIZEOF(.bss)); PROVIDE(.symsize = 0); .header ALIGN(0x400) : AT(0x0){ -- Gitee