This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
-mpcrel and -fPIC and -m68000
- To: gcc-patches at gcc dot gnu dot org
- Subject: -mpcrel and -fPIC and -m68000
- From: "Alexander Aganichev" <AAganichev at hypercom dot com>
- Date: Fri, 23 Jun 2000 19:50:30 +0100
I've made small patch that provides support for PC relative addressing on
m68000 with -fPIC option set. If someone intrested in testing here it is:
(See attached file: m68k.pcrel-68000.diff)
How it works:
~~~~~~~~~~
On M68020 we already have the following code for calling:
lea (label:l,%pc),%aX
jsr (%aX)
It could be simulated on M68000 with:
move #label-tmp_label,%aX
tmp_label:
lea tmp_label(%aX,%pc),%aX
jsr (%aX)
Unfortunately I was unable to understand how to allocate temporary register
(I've tried to use `clobber' but failed) to make same trick with `pea', so
gcc generates `lea' followed by `move' in this version. I believe someone
who undertand gcc internals better make a better support for this feature.
--
Alexander Aganichev
Hypercom Europe Limited, Inc.
Software Engineer
m68k.pcrel-68000.diff