summaryrefslogtreecommitdiff
path: root/src/stm8/main.c
diff options
context:
space:
mode:
authorXavier ASUS <xavi92psx@gmail.com>2019-10-21 16:08:26 +0200
committerXavier ASUS <xavi92psx@gmail.com>2019-10-21 16:08:26 +0200
commit9d8d485a0a3b869ad64bb745d102ab6cac0ba4a1 (patch)
tree5428e47ddf776e9b56a2000e77396996f2ae1955 /src/stm8/main.c
parentde2840528859860ca242f7bde0cbd90d51984cf2 (diff)
downloadsdcc-gas-9d8d485a0a3b869ad64bb745d102ab6cac0ba4a1.tar.gz
Implemented --ffunction-sections
Interrupt vector must be placed on section .vectors, according to the default linker script file. Intermediate labels must be $-terminated so they are not listed by nm.
Diffstat (limited to 'src/stm8/main.c')
-rw-r--r--src/stm8/main.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/stm8/main.c b/src/stm8/main.c
index 424d4cb..dbef2a8 100644
--- a/src/stm8/main.c
+++ b/src/stm8/main.c
@@ -281,22 +281,22 @@ stm8_genInitStartup (FILE *of)
"_start:\n"
"\t; Zeroing .bss\n"
"\tldw x, __bss_start\n"
- "\t$0:\n"
+ "0$:\n"
"\tclr (x)\n"
"\tincw x\n"
"\tcpw x, __bss_end\n"
- "\tjrne $0\n"
+ "\tjrne 0$\n"
"\t; Copying .data from ROM to RAM\n"
"\t; Calculate .data section size\n"
"\tldw x, __data_load_start\n"
"\tldw y, __data_start\n"
- "\t$1:\n"
+ "1$:\n"
"\tld a, (x)\n"
"\tld (y), a\n"
"\tincw x\n"
"\tincw y\n"
"\tcpw y, _edata\n"
- "\tjrne $1\n");
+ "\tjrne 1$\n");
}
}
@@ -308,9 +308,7 @@ stm8_genIVT(struct dbuf_s * oBuf, symbol ** intTable, int intCount)
int i;
if (options.gasOutput)
- {
- dbuf_tprintf(oBuf, "!area\n", ".vectors");
- }
+ dbuf_tprintf(oBuf, "\tint __interrupt_vect ; reset\n");
else
dbuf_tprintf(oBuf, "\tint s_GSINIT ; reset\n");