Hello dear List!
I use GPC for ARM7TDMI processor working under uCLinux of 2.26
version.
I would like to use -fpic option to decrease memory usage (my
filesystem lies in SDRAM so load program to RAM is just memory
waste), but when I start program built with -fpic,
it tells me "undefined instruction". I searched via the mail list but it seems to me that
there is no great interest to this problem (I mean -fpic usage).
I use arm-elf-gcc (2.95.3) and arm-elf-gpc
(20021111) built together. It's a bit old but it's the only version I've managed
to build for arm-elf- platform. Anyway, the problem is: when I build
hello-world-program written on C using arm-elf-gcc with "-fpic
-msingle-pic-base", it works fine. When I try to build
hello-world-program written on Pascal using arm-elf-gpc and the same flags, it doesn't
work and tell me "undefined instruction". I looked into map file, created by linker, and there is strange
issue: when I use -fpic options, C linker uses libgcc.a located in
/usr/local/bin/../lib/gcc-lib/arm-elf/2.95.3/fpic/msingle-pic-base/,
but Pascal linker always uses
/usr/local/bin/../lib/gcc-lib/arm-elf/2.95.3/ whether the program was
built with -fpic option or not. So I've thought that the problem is in
libgpc.a and tried to rebuild it (and all GPC). I didn't find any options
about -fpic in Pascal configuration files. I tried do add "-fPIC
-msingle-pic-base" to the CFLAGS and GPC_FLAGS variables in the Makefile in p/rts
directory of Pascal sources and rebuild GPC, but the program still doesn't work. What
may be the problem, is the -fpic option supported now in Pascal?
Perhaps, I should use newer version of GPC or configure it in other
way than I did?
Best regards,
Igor Marnat
mailto:marny@rambler.ru