Just recompiled `qdos-gcc' on raspberry, but I do miss something on the way.
Code: Select all
$ qdos-gcc hello.c -o hello
Undefined Symbol: ''
hello: dataspace 100 (64)
Undefined Symbols: 1
Any ideas?
Many thanks
Tomas
Code: Select all
$ qdos-gcc hello.c -o hello
Undefined Symbol: ''
hello: dataspace 100 (64)
Undefined Symbols: 1
Code: Select all
# hello.c
#include <stdio.h>
main (int argc, char *argv[])
{
printf ("%s\n\n", "hello world!");
}
Code: Select all
$ qdos-gcc -S hello.c
$ cat hello.s
.sect .text
.sect .rom
.sect .data
.sect .bss
;gcc2_compiled
.sect .text
LC0:
.data1 0x68,0x65,0x6c,0x6c,0x6f,0x20,0x77,0x6f,0x72,0x6c,0x64,0x21,0x0
LC1:
.data1 0x25,0x73,0xa,0xa,0x0
.align 2
.extern _main
_main:
link a6,#0
bsr ___main
pea LC0
pea LC1
bsr _printf
addq.l #8,sp
L8:
unlk a6
rts
Code: Select all
$ which as
/usr/local/qdos/bin/as68
$ as hello.s
Code: Select all
$ hd hello.o
00000000 fb 01 07 68 65 6c 6c 6f 2e 6f fb 10 ff ff 04 54 |...hello.o.....T|
00000010 45 58 54 fb 10 ff fe 04 44 41 54 41 fb 10 ff fd |EXT.....DATA....|
00000020 05 55 44 41 54 41 fb 06 05 5f 6d 61 69 6e 00 00 |.UDATA..._main..|
00000030 00 12 ff ff fb 10 00 03 07 5f 5f 5f 6d 61 69 6e |.........___main|
00000040 fb 04 ff ff 68 65 6c 6c 6f 20 77 6f 72 6c 64 21 |....hello world!|
00000050 00 25 73 0a 0a 00 4e 56 00 00 4e b9 fb 07 00 00 |.%s...NV..N.....|
00000060 00 00 54 2b 00 03 fb 48 79 fb 07 00 00 00 00 54 |..T+...Hy......T|
00000070 2b ff ff fb 48 79 fb 07 00 00 00 0d 54 2b ff ff |+...Hy......T+..|
00000080 fb 4e b9 fb 07 00 00 00 00 54 2b 00 04 fb 50 8f |.N.......T+...P.|
00000090 4e 5e 4e 75 fb 13 |N^Nu..|
00000096
Code: Select all
+#define GLOBAL_ASM_OP ".extern" \
#define ASM_GLOBALIZE_LABEL(FILE,NAME) \
do { fprintf (FILE, "%s ", GLOBAL_ASM_OP); \
assemble_name (FILE, NAME);
Code: Select all
# hello.s
...
.extern _main,_printf
...
Code: Select all
$ as hello.s
$ hd hello.o
00000000 fb 01 07 68 65 6c 6c 6f 2e 6f fb 10 ff ff 04 54 |...hello.o.....T|
00000010 45 58 54 fb 10 ff fe 04 44 41 54 41 fb 10 ff fd |EXT.....DATA....|
00000020 05 55 44 41 54 41 fb 06 05 5f 6d 61 69 6e 00 00 |.UDATA..._main..|
00000030 00 12 ff ff fb 10 00 03 07 5f 70 72 69 6e 74 66 |........._printf|
00000040 fb 04 ff ff 68 65 6c 6c 6f 20 77 6f 72 6c 64 21 |....hello world!|
00000050 00 25 73 0a 0a 00 4e 56 00 00 4e b9 fb 07 00 00 |.%s...NV..N.....|
00000060 00 00 54 2b 00 04 fb 48 79 fb 07 00 00 00 00 54 |..T+...Hy......T|
00000070 2b ff ff fb 48 79 fb 07 00 00 00 0d 54 2b ff ff |+...Hy......T+..|
00000080 fb 4e b9 fb 07 00 00 00 00 54 2b 00 03 fb 50 8f |.N.......T+...P.|
00000090 4e 5e 4e 75 fb 13
Code: Select all
$ as hello.s
LC0
LC1
_main
___main
_printf
L8
Code: Select all
int main(int argc, char *argv[])
{
...
aspass1();
SYM *p; char name[12] = {'\0'};
p = lookup( "_printf" );
//p = lookup( "___main" );
cpyname( name, p);
fprintf( stderr, "%x %x %x %s\n", p, p->flags, p->access, name );
putsym( p );
...
}
Code: Select all
$ which as
/usr/local/qdos/bin/as
$ as hello.s
dumpsym()
_main
___main
def380 8000 4 _printf
Code: Select all
pi@raspberrypi:~/ql/qdos $ qdos-gcc hello.c -o hello
hello: dataspace 882 (372)
Code: Select all
pi@raspberrypi:~/ql/qdos $ /usr/local/qdos/bin/ld -M hello.o -o hello -lgcc > xref
hello: dataspace 882 (372)
Code: Select all
< XREF at 5E8 8
<
< XREF at 5EE C
<
< XREF at 5F4 0
<
---
> XREF at 5E8 40
> UDATA/b712ad92
> XREF at 5EE 44
> UDATA/b712ad92
> XREF at 5F4 38
> UDATA/b712ad92
Code: Select all
pi@raspberrypi:~/ql/qdos $ qdos-gcc hello.c -o hello
hello: dataspace 882 (372)
pi@raspberrypi:~/ql/qdos $ cmp hello x86/hello
pi@raspberrypi:~/ql/qdos $ cp hello ~/mdv2
How did your testing go?tcat wrote:Hi,
Seems almost there.hello.pngCode: Select all
pi@raspberrypi:~/ql/qdos $ qdos-gcc hello.c -o hello hello: dataspace 882 (372) pi@raspberrypi:~/ql/qdos $ cmp hello x86/hello pi@raspberrypi:~/ql/qdos $ cp hello ~/mdv2
Testing further...
Tom