Commit Graph

32 Commits

Author SHA1 Message Date
Xavi Del Campo 40ce43b7ae slabeldef is not needed for C strings in GAS format 2019-11-10 20:13:59 +01:00
Xavi Del Campo a13561bc9a Fixed pdk15 lib building 2019-11-07 23:03:29 +01:00
Xavi Del Campo 53953142e7 Removed intermediate files 2019-11-06 04:34:31 +01:00
Xavi Del Campo cf1d3aec55 Fixed github sdcc-gas issues #1, #2 and #4
Issue #1 was caused because code_name and data_name had been incorrectly
defined as const-qualified pointers, but this must be an exception for
the z80 backend, as stated by the comments.

Issue #2 has been solved by removing the --gas switch from SDCCmain.c,
renaming it to "--asm=" (as requested by PKK) and moved to STM8's main.c,
so the option is limited to those targets supporting it.

Issue #4 was because of SDCCglue.c, that generated local labels using
"!labeldef" instead of "!slabeldef", causing those __str_%d labels to be
printed as "__str_%d::" (the double colons stand for globa label according
to asxxx documentation) instead of "__str_%d":".

I ran the regression tests and most of them passed, but "wchar" returned another
"Multiple definition of..." error that I cannot explain so far. It is better than
nothing, though.
2019-11-06 04:34:26 +01:00
Xavi Del Campo 0290d8bd12 Recovered .gitignore 2019-11-05 17:57:22 +01:00
Xavi Del Campo e524f15726 Removed intermediate files 2019-11-05 17:56:35 +01:00
Xavier ASUS 1dcefbf527 _Noreturn-qualified functions now do not generate any ret/iret instruction 2019-10-30 00:23:41 +01:00
Xavier ASUS 7c4ae5853b Bugfixes 2019-10-30 00:04:10 +01:00
Xavier ASUS 3378ab8f23 First implementation for --data-sections
OTOH, section names included in "options" were being assigned *before*
parsing command line arguments. These arose some issues so I have created
a post-parsing function.
2019-10-28 02:03:38 +01:00
Xavier ASUS e801690e4f Bugfixes on startup routine
Memory addresses should be preceded by '#' when referring to them as integers
2019-10-25 02:56:56 +02:00
Xavier ASUS 46783fd76b Removed unneded "== ." directives for --gas 2019-10-25 02:19:30 +02:00
Xavier ASUS 4de313f145 DWARF2 debugging (almost) working
Stack pointer setup is removed since it is already set to 0x3FF
for the STM8S003F3/K3, according to the datasheet.
2019-10-25 01:05:12 +02:00
Xavier ASUS 9d2f975be4 Removed intermediate files 2019-10-25 01:04:41 +02:00
Xavier ASUS 83a2fa10b0 Restored necessary files 2019-10-24 23:35:25 +02:00
Xavier ASUS 0d075d8f25 configure_stm8: added disable-non-free 2019-10-24 23:19:18 +02:00
Xavier ASUS 9e93944f18 Removed intermediate files 2019-10-24 23:18:52 +02:00
Xavier ASUS d5577a84aa Got hi8/lo8 asm instructions working
GNU as does not support the #</#> notation asxxx uses to determine
address LSB and MSB. Instead, two instructions have been created on
GNU as and ld (see my stm8-binutils-gdb fork) for this purpose.

On the other hand, I'm upset to see gen.c does not provide an
assembler-agnostic implementation when SDCCasm.c already provides
tools already meant for this.

OTOH, support for the "-C" has been added for --gas.
2019-10-24 06:19:28 +02:00
Xavier ASUS 8eeb5d5444 Removed intermediate files 2019-10-23 16:57:57 +02:00
Xavier ASUS 9c47d08e98 Implemented -c support for --gas
STM8 code generator was generating some instructions in a
"ld register, (#%d, register)" way, causing assembling errors on
stm8-as. This is because stm8-as does not require the '#' character.
A quick and dirty workaround has been implemented for this.

Added new warning W_IGNORED_OPT_IN_ASM, which warns the user when
both "--no-optsdcc-in-asm" and "--gas" are used (the first is ignored
when the latter is active since GNU as does not accept the .optsdcc
directive, as opposed to asxxx).
2019-10-23 03:57:38 +02:00
Xavier ASUS 4df948b3c1 Removed intermediate files 2019-10-23 03:38:57 +02:00
Xavier ASUS 2cece67cb5 Removed intermediate files 2019-10-23 03:38:32 +02:00
Xavier ASUS ed26eb0002 Ignored options.const_seg and initializer->sname
options.gasOutput is not defined yet when these options above are assigned, so they hold invalid values.
2019-10-22 17:53:04 +02:00
Xavier ASUS b679eaad41 .data symbols are now allocated correctly
.data only needs a label with the smybol name and .byte/.word
directives defining it. Therefore, INITIALIZED_NAME is ignored
since no allocation must be done from emitRegularMap() for .data.
2019-10-22 17:31:19 +02:00
Xavier ASUS 5a0c2910df First working example!
stm8/main.c: 0x8000 must contain the entry point aka "_start" for GNU as.

Some work on supporting debugging symbols with --gas. Not finished yet.
2019-10-22 02:10:51 +02:00
Xavier ASUS 958912f928 Removed unneeded module SDCCgas
It was an experimental attempt to implement GNU as support, but it
was deprecated in favor of ad-hoc workarounds and using SDCC
cross-assembler capabilities.
2019-10-21 17:52:24 +02:00
Xavier ASUS 9d8d485a0a 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.
2019-10-21 16:08:26 +02:00
Xavier ASUS de28405288 Updated Makefiles 2019-10-21 03:05:54 +02:00
Xavier ASUS 41e45c2e8d GNU as now assembles successfully
A new (untested) startup routine has been written for GNU as.
Section names have been considered from stm8-binutils linker script.
2019-10-21 03:04:31 +02:00
Xavier ASUS 3fcc2d265f 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.
2019-10-21 00:22:00 +02:00
Xavier ASUS a2a263dd38 Creating GAS port in SDCCasm
SDCCasm proved a much more elegant way to implement GAS support for SDCC.
In fact, I was surprised to see there was already an attempt that had been commented out.
stm8-as only complaints about those nasty "Smain ==." statements, but that should be easy to fix.
2019-10-19 03:44:47 +02:00
Xavier ASUS 35f6532764 SDCCgas: work on emitting .rodata section 2019-10-19 01:39:13 +02:00
Xavier ASUS 268a53de82 sdcc-3.9.0 fork implementing GNU assembler syntax
This fork aims to provide better support for stm8-binutils
2019-10-18 00:31:54 +02:00