Page MenuHomePhabricator

LowerTypeTests: Propagate symver directives

Authored by vlad.tsyrklevich on Apr 18 2018, 10:49 PM.



This change fixes, a build failure caused by
LowerTypeTests not preserving .symver symbol versioning directives for
exported functions. Emit symver information to ThinLTO summary data and
then propagate symver directives for exported functions to the merged

Emitting symver information to the summaries increases the size of
intermediate build artifacts for a Chromium build by less than 0.2%.

Diff Detail

Event Timeline


@pcc This should probably be F->hasAddressTaken() instead of F->use_empty(), but I seem to recall that that would be actually be to restrictive for which functions we currently export--is that right?

pcc accepted this revision.Apr 19 2018, 11:31 AM
pcc added a subscriber: tejohnson.


I don't think this will do the right thing if two modules have different .symver targets, but then again that would seem to be problematic even without CFI (consider the case where the modules with different targets get imported into one another).

Probably something to consider in the future would be to rename functions at the IR level in the ThinLTOBitcodeWriter according to the .symver directives.


I think so, in the importer we would end up redirecting all references (including direct calls) to go through the jump table, so we need to make sure that the jump table points to the right function.

This revision is now accepted and ready to land.Apr 19 2018, 11:31 AM

I started thinking about renaming but it's complicated by the fact that there are different usages of the symver directive that slightly change the renaming logic. For now I'm going to keep it as is but I've also submitted to make sure that builds fail correctly if multiple mismatched symvers are emitted.

This revision was automatically updated to reflect the committed changes.