summaryrefslogtreecommitdiff
path: root/src/stm8
diff options
context:
space:
mode:
authorXavier ASUS <xavi92psx@gmail.com>2019-10-25 01:05:12 +0200
committerXavier ASUS <xavi92psx@gmail.com>2019-10-25 01:05:12 +0200
commit4de313f145d3c9bde748306f48443aadef6cf774 (patch)
treeba07672dc4d3c59705957d721c5cb1bad95c2cdb /src/stm8
parent9d2f975be4bd8e9d8f15eb0d013944e46b00c8d2 (diff)
downloadsdcc-gas-4de313f145d3c9bde748306f48443aadef6cf774.tar.gz
DWARF2 debugging (almost) working
Stack pointer setup is removed since it is already set to 0x3FF for the STM8S003F3/K3, according to the datasheet.
Diffstat (limited to 'src/stm8')
-rw-r--r--src/stm8/gen.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/stm8/gen.c b/src/stm8/gen.c
index 7dd5101..91dd7c7 100644
--- a/src/stm8/gen.c
+++ b/src/stm8/gen.c
@@ -3385,16 +3385,6 @@ genFunction (iCode *ic)
emit2 (";", " function %s", sym->name);
emit2 (";", "-----------------------------------------");
- /* Place each new function into its own section so GNU ld
- * can perform dead code elimination via --gc-sections. */
- if (options.function_sections && options.gasOutput)
- {
- char name[256];
-
- snprintf(name, sizeof name, "%s.%s", CODE_NAME, sym->name);
- emit2(".section", " %s", name);
- }
-
D (emit2 (";", stm8_assignment_optimal ? "Register assignment is optimal." : "Register assignment might be sub-optimal."));
D (emit2 (";", "Stack space usage: %d bytes.", sym->stack));
@@ -8200,6 +8190,16 @@ genSTM8Code (iCode *lic)
int cln = 0;
regalloc_dry_run = FALSE;
+ /* Place each new function into its own section so GNU ld
+ * can perform dead code elimination via --gc-sections. */
+ if (options.function_sections && options.gasOutput && currFunc)
+ {
+ char name[256];
+
+ snprintf(name, sizeof name, "%s.%s", CODE_NAME, currFunc->rname);
+ emit2(".section", " %s", name);
+ }
+
/* if debug information required */
if (options.debug && currFunc && !regalloc_dry_run)
debugFile->writeFunction (currFunc, lic);