Re: [PATCH] PE/COFF: Implement visibility attribute via .drectve
LIU Hao <[email protected]> Fri, 7 Aug 2026 14:02:03 +0800
| Newsgroups | gmane.comp.gcc.patches |
|---|---|
| Message-ID | <[email protected]> |
在 2026-8-7 13:55, Jonathan Yong 写道: > On 7/31/26 20:08, Oleg Tolmatcev wrote: >> On PE/COFF targets (MinGW, Cygwin), the visibility attribute was >> previously ignored with a warning. This patch makes it functional >> by emitting -exclude-symbols directives into the .drectve section, >> matching Clang's behavior. The GNU linker already reads and >> respects these directives during auto-export, so hidden/internal >> symbols are now correctly excluded from DLL exports. >> > > Please also test for __stdcall and __fastcall for x86 32-bit targets and improve testcase to cover it. The reason for that is, for i686, the symbol that follow `-exclude-symbols:` should have its leading underscore removed, so `_some_cdecl` becomes `-exclude-symbols:some_cdecl`, and `_some_stdcall@8` becomes `some_stdcall@8`, but `@some_fastcall@8` doesn't have a leading underscore so it's `-exclude-symbols:@some_fastcall@`. -- Best regards, LIU Hao
OpenPGP_signature.asc
(application/pgp-signature, 840 B)
-----BEGIN PGP SIGNATURE----- wsF5BAABCAAjFiEEYmSQWY4DEzq4FUs4hfveZl3ogBsFAmp1dNsFAwAAAAAACgkQhfveZl3ogBv1 AQ/8CFFK3bON14z/Hkd3zBrUsDD6wuGOhvr9jMitBXmWtpnjAwrIKWXb+80ZZ294nP10ep/cteTF Wi0l5hMkWJH76As6pR6zINQR/giSTTyqiA+g5FjhpfPONk5fEflFY/+EEFQM2ByaeeKzc4ge+xt8 9Jnum7lleCeoFOSXOFBiJYKrXQtRSc0krdEMRmcCAO2ci+ijFFAPvtV6YvE6gA5ch8kSzGu04gwe AP8zmN8SMGfAtM98A2fPAt83KhRWTub9plNPIAB4/uaA6nxAWb+E7L9eDzi3+iqiyNJhIJQxYUYG TCrFBkjvUFk9AL5ENFVUcmljSZDmFbb7iEo8W7GLfMxA4Q5qlxmHTATShtOLyTi+SRxRBIqhawCG BauvEPtdJ/G8IvGHIZbyJRNrir5GudcRi1VyaxINwq7PF7DHSzGvdug+JVEjTXC0FrvPPdIU6aeH HpOp8gNrvq2BhZCMUfIKeb0lqWwPuMKCJPjqhEnlm/dVvI31YvStuTj3a+FhbClhIm1u1CXo8Vt3 xUvsHdV/DXR/ZsWXLeYh5t19kJXrdnaUPTKhfhlggQxHxNMlBXRhbxE5LYz5+agWe8Xu6GhvaTDL ZeKABv4gZLstDs/Wp47fqxvGCBCCSvp7PrpA63DuJZ0bfMi1cvSyuwZJqkNv2ewvmceQNwllSauC hJs= =V4+/ -----END PGP SIGNATURE-----