This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: m68k - Dropping the Motorola syntax
Bernardo Innocenti <bernie@develer.com> writes:
> On Tuesday 19 August 2003 10:24, Andreas Schwab wrote:
> > Ian Lance Taylor <ian@airs.com> writes:
> > |> Using Motorola syntax is necessary from the gcc point of view, because
> > |> for some reason gcc appears to only emit @PLTPC, etc., if MOTOROLA is
> > |> defined.
> >
> > The original m68k PIC generation was designed for Sun3/a.out, which only
> > worked with Sun as, not with GNU as, AFAIK. This was using MIT syntax,
> > probably because Sun as does only grok that. Now that support for Sun3
> > has been removed it would be possible to also remove support for non-ELF
> > PIC, so that PIC support is independent of the assembler dialect.
>
> But, afaik, NetBSD always had shared libraries built with -fPIC on a.out
> ports, which used the MIT syntax. PIC for .so modules wasn't optional as in
> Linux that can use COW on mmap()'ed memory to relocate code differently
> for each process address space.
>
> So I wonder, how could they use the MIT syntax _and_ PIC at the same
> time if it wasn't supported by GCC?
Andreas is saying that in the m68k backend, the type of PIC support is
tied to the assembler dialect. When generating MIT syntax, the m68k
backend produces a.out style PIC support. When generating Motorola
syntax, the m68k backend produces ELF style PIC support.
For example, when generating a PIC call, if MOTOROLA is defined gcc
emits
bsr %0@PLTPC
whereas if MOTOROLA is not defined gcc emits:
jbsr %0,a1
Ian