[Mingw-w64-public] [PATCH] ld: pep: Stop emitting reference to the pseudo-relocator function

LIU Hao lh_mouse@126.com
Thu Jul 2 15:04:10 GMT 2026


在 2026-7-2 22:38, Jon Turney 写道:
> The exported _pei386_runtime_relocator function currently only exists as
> a non-functional stub in the Cygwin runtime, merely to satisfy this
> reference synthesized in ld [1].
> 
> The function still has contents in the MinGW runtime [2], but is already
> referenced by being explcitly called at crt startup/dll load.
> 
> We'd like to drop the (slightly confusing) stub from the Cygwin runtime,
> especially in possible future architectures (e.g aarch64), where
> backwards compatibilty concerns don't exist.
> 
> So, for PE+ targets, stop explicitly emitting a reference to
> _pei386_runtime_relocator in the linker.
> 
> (The archeological record is unclear why this functionality exists in
> ld.
> 
> Since --enable-runtime-pseudo-reloc-v1 exists for 32-bit PE arches, and
> out of an abundance of caution, keep emitting it for those targets (i.e.
> i386) where it conceivably might still be needed or useful with an
> ancient runtime.)
> 
> Cc'ed to mingw-w64-public list.
> 
> [1] https://cygwin.com/cgit/newlib-cygwin/tree/winsup/cygwin/lib/pseudo-reloc-dummy.c
> [2] https://sourceforge.net/p/mingw-w64/mingw-w64/ci/master/tree/mingw-w64-crt/crt/pseudo-reloc.c#l479
> 
> Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
> Cc: mingw-w64-public@lists.sourceforge.net
>
AFAICT there's no reason to keep it. Even the original MinGW.org code calls it explicitly:

https://sourceforge.net/p/mingw/mingw-org-wsl/ci/5.1-trunk/tree/mingwrt/crt1.c#l343


-- 
Best regards,
LIU Hao
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature.asc
Type: application/pgp-signature
Size: 840 bytes
Desc: OpenPGP digital signature
URL: <https://sourceware.org/pipermail/binutils/attachments/20260702/e265cb3b/attachment.sig>


More information about the Binutils mailing list