summaryrefslogtreecommitdiff
path: root/src/SDCCasm.c
diff options
context:
space:
mode:
authorXavier ASUS <xavi92psx@gmail.com>2019-10-21 00:22:00 +0200
committerXavier ASUS <xavi92psx@gmail.com>2019-10-21 00:22:00 +0200
commit3fcc2d265f1521c2dcae0734de355962cc6cd7a0 (patch)
tree9f914b554fa9af110fda60e6a3962fe9e3a40423 /src/SDCCasm.c
parenta2a263dd383d76e4ee0ed62f393376ef2ae49171 (diff)
downloadsdcc-gas-3fcc2d265f1521c2dcae0734de355962cc6cd7a0.tar.gz
More work on GNU as generation
On _gas_mapping, label definitions do not allow "::". ":" must be used instead. gasOutput is now part of "options". Unneeded sections, such as HOME/GSINIT/etc., are no longer declared and/or defined. GNU as just does not need them. Startup function name must equal "_start" for GNU ld. The value of some macros, such as CODE_NAME or DATA_NAME, must change according to options.gasOutput, as "CODE" or "DATA" (among many others) are not understood by GNU as. STM8 port now selects GNU as format on --gas switch enabled.
Diffstat (limited to 'src/SDCCasm.c')
-rw-r--r--src/SDCCasm.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/SDCCasm.c b/src/SDCCasm.c
index 27f7cd1..05551bd 100644
--- a/src/SDCCasm.c
+++ b/src/SDCCasm.c
@@ -401,7 +401,7 @@ err_no_line:
}
static const ASM_MAPPING _gas_mapping[] = {
- {"labeldef", "%s::"},
+ {"labeldef", "%s:"},
{"slabeldef", "%s:"},
{"tlabeldef", "%05d$:"},
{"tlabel", "%05d$"},
@@ -409,11 +409,12 @@ static const ASM_MAPPING _gas_mapping[] = {
{"zero", "#0x00"},
{"one", "#0x01"},
{"area", ".section %s"},
- {"areacode", ".section .text"},
- {"areadata", ".section .bss"},
+ {"areacode", ".section %s"},
+ {"areadata", ".section %s"},
{"areahome", ".section %s"},
{"ascii", ".ascii \"%s\""},
- {"ds", ".comm %d"},
+ {"comm", ".comm %s, %d, %d"},
+ {"local", ".local %s"},
{"db", ".byte"},
{"dbs", ".byte %s"},
{"dw", ".word"},
@@ -433,7 +434,7 @@ static const ASM_MAPPING _gas_mapping[] = {
"; Function %s\n"
"; ---------------------------------"},
{"functionlabeldef", "%s:"},
- {"globalfunctionlabeldef", "%s::"},
+ {"globalfunctionlabeldef", "%s:"},
{"los", "(%s & 0xFF)"},
{"his", "(%s >> 8)"},
{"hihis", "(%s >> 16)"},