NetBSD-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: lib/59391: unnecessary __PIC__ conditionals clutter .S files
The following reply was made to PR lib/59391; it has been noted by GNATS.
From: Taylor R Campbell <riastradh%NetBSD.org@localhost>
To: Valery Ushakov <uwe%stderr.spb.ru@localhost>
Cc: gnats-bugs%NetBSD.org@localhost, netbsd-bugs%NetBSD.org@localhost
Subject: Re: lib/59391: unnecessary __PIC__ conditionals clutter .S files
Date: Sat, 3 May 2025 14:58:48 +0000
> Date: Sat, 3 May 2025 17:07:24 +0300
> From: Valery Ushakov <uwe%stderr.spb.ru@localhost>
>=20
> > Sometimes entire files are conditionalized on __PIC__, such as:
> >
> > https://nxr.netbsd.org/xref/src/lib/libc/arch/sparc/gen/sigsetjmp.S?r=
=3D1.7
>=20
> Which, in this particular case, is, IMHO, the best way to write it.
> [...]
> But trying to cram this into one text for static and PIC with macro
> magic will be a bad idea.
So I see, the control flow is nontrivially different, I guess because
there's no PLT here (and no conditional branch to register)? Fair
enough! (Though why not use PLT here?)
But the x86 ones are just silly: we already have a macro PIC_PLT to
conditionally expand to x@PLT or x depending on __PIC__, so
#ifdef __PIC__
call PIC_PLT(x)
#else
call x
#endif
redundantly makes this PIC code an ATM machine.
Home |
Main Index |
Thread Index |
Old Index