D59275 added the following clause to Symbol::includeInDynsym()
if (isUndefWeak() && Config->Pie && SharedFiles.empty()) return false;
D59549 explored the possibility to generalize it for -no-pie.
GNU ld's rules are architecture dependent and partly controlled by -z
{,no-}dynamic-undefined-weak. Our attempts to mimic its rules are
actually half-baked and don't provide perceivable benefits (it can save
a few more weak undefined symbols in .dynsym in a -static-pie
executable). Let's just delete the rule for simplicity.
This makes D71795 NFC.
This behavior change does not affect anything. I added this file just to check our behavior regarding the glibc weak undefined symbol __gmon_start__. The instruction will not be called when it is undefined, so we don't care the target of the branch.