This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: PDP-11 ABI for cross compiler
Well, I have a working compiler but the linker doesn't work or I am
not using it right. I took /lib from a 2.11BSD system.
$ uname -a
FreeBSD bsd.localdomain 8.0-RC1 FreeBSD 8.0-RC1 #0: Thu Sep 17
20:45:19 UTC 2009
root@almeida.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC i386
$ pdp11-bsd2.11-gcc -v
Using built-in specs.
Target: pdp11-bsd2.11
Configured with: ../gcc-4.1.2/configure --target=pdp11-bsd2.11
--without-headers --with-newlib --enable-languages=c --disable-shared
--enable-version-specific-runtime-libs
Thread model: single
gcc version 4.1.2
$ cat a.c
int
main()
{
return 0;
}
$ pdp11-bsd2.11-gcc a.c
/usr/local/lib/gcc/pdp11-bsd2.11/4.1.2/libgcc.a(__main.o):__main.o:(.text+0x86):
undefined reference to `_atexit'
collect2: ld returned 1 exit status
$ pdp11-bsd2.11-gcc -c a.c
$ file a.o
a.o: PDP-11 executable not stripped
$ pdp11-bsd2.11-gcc -S a.c
$ cat a.s
.text
.even
.globl _main
_main:
; /* function prologue main*/
;/* switch cpu to double float, single integer */
setd
seti
mov r5, -(sp)
mov sp, r5
;/* end of prologue */
jsr pc, ___main
clr r0
; /*function epilogue */
mov r5, sp
mov (sp)+, r5
rts pc
;/* end of epilogue*/
$ pdp11-bsd2.11-gcc -static -nostartfiles -nodefaultlibs -nostdlib a.c
/var/tmp//ccgCzTH1.o:/var/tmp//ccgCzTH1.o:(.text+0xa): undefined
reference to `___main'
collect2: ld returned 1 exit status
$ pdp11-bsd2.11-ld -static -nodefaultlibs -nostartfiles -nostdlib a.o
a.o:a.o:(.text+0xa): undefined reference to `__main'
$
--
Aram Hăvărneanu