Re: [PATCH v4 4/5] MIPS: VDSO: Use $(LD) instead of $(CC) to link VDSO

Maciej W. Rozycki
2020-05-13T22:42:27Z

On Tue, 28 Apr 2020, Fangrui Song wrote:

> Sigh... -G 0. This is an option ignored by LLD. GCC devs probably should
> have used the long option --gpsize rather than take the short option -G.
> Even better, -z gpsize= or similar if this option is specific to ELF.

Well, the `-G' option is some 30 years old and comes from RISC-OS where
the vendor linker had it; it was already present with the initial MIPS
port of GCC:

commit fe3ec4f798ceea52e1b542b481670b83c12347fd
Author: Michael Meissner <meissner@gcc.gnu.org>
Date: Sun Dec 1 05:02:56 1991 +0000

Initial revision

From-SVN: r88

specifically:

+#define LINK_SPEC "%{G*} \

there, so I don't know of what GCC developers' choice you are talking
about.

Much of GCC legacy comes from various vendors' compilation systems; in
this case it was the MIPS Computer Systems (aka MIPSCO) compiler. There
may not have been a GNU linker port to RISC-OS at that point (or ever),
and the assembler and linker invocation interfaces were kept compatible as
ports were added to individual GNU development tools, for obvious reasons.
I still remember using GCC with vendor's assembler and linker on DEC
Ultrix/MIPS myself many years ago, to overcome some vendor compiler's
limitations.

And FTR this was still a few years before ELF was even invented; MIPS OSs
used the COFF binary format back then.

Sorry. I think it's LLVM/LLD that ignores compatibility, not the other
way round.

Maciej