Page MenuHomePhabricator

[lld/mac] Don't add names of unreferenced symbols to string table

Authored by thakis on Dec 22 2020, 8:04 AM.



Before this, a hello world program would contain many many unnecessary
entries in its string table.

No behavior change, just makes the string table in the output smaller
and more like ld64's.

Diff Detail

Event Timeline

thakis requested review of this revision.Dec 22 2020, 8:04 AM
thakis created this revision.
compnerd accepted this revision.Dec 22 2020, 9:45 AM
compnerd added a subscriber: compnerd.

The change on L722 took me a few moments to catch - that was subtle.


Why not emplace_back?

This revision is now accepted and ready to land.Dec 22 2020, 9:45 AM



That's annoying to use with structs pre c++20 ( and in practice it won't matter.

(But that's the retconned answer. The actual reason is that the LHS used push_back and I didn't think about it ;) )

Herald added a project: Restricted Project. · View Herald TranscriptDec 22 2020, 1:02 PM