This is initial GNU AS support mainly for Z80 port. To compile GAS patch required: https://sourceware.org/bugzilla/show_bug.cgi?id=25224
Discussion: elf output file support for Z80 theoreticaly possible?
Discussion: elf output file support for Z80 theoreticaly possible?
Better work with sections.
I remove section redifinition. It is better to done it inside ld script.
I have separated patch by two independed patches.
Using this patch SDCC can accept option
--asm=gas
for z80 target which helps it to produce more comfortable for GNU AS code. It is first stage patch. I think, more deep support should be added later by another patches.Last edit: Sergey Belyashov 2020-02-11
New version. I need review before it be committed.
I wonder what the explicit empty cases in one of the new switches z80/main.c are for. Why not just leave those out? Or add an empty default (the other two addded switches do use a default, though non-empty)?
I've run regression tests with the patch applied, and did not notice any problems on my system. But I did not try the new gas support.
I do not know. I'll fix it.
By the way, there was some similar work for gas support in the stm8 backend, but AFAIK there were some regressions that never fully got fixed (I think some of the work is on github in an sdcc fork - https://github.com/XaviDCR92/sdcc-gas).
I have already added special changes to GAS itself to support SDCC z80 assembler dialect. So changes here are just add compiler invocation for gbz80, z80, z180, z80n and ez80 ports. I want to support other z80-like ports, but GAS z80 target requires deep refactoring. I try to do it using CGEN, but it cannot describe CISC ISAs, so refactoring is not done.
Applied in [r11785].