Before, superfluous warnings were emitted for the following two cases:
- When from symbol was in a discarded section. The profile should be thought of as affiliated to the section. It makes sense to ignore the profile if the section is discarded.
- When to symbol was in a shared object. The object file containing the profile may not know about the to symbol, which can reside in another object file (useful profile) or a shared object (not useful as symbols in the shared object are fixed and unorderable). It makes sense to ignore the profile from the object file.
Note, the warning when to symbol was undefined was suppressed in D53044, which is still useful for --symbol-ordering-file=
This patch silences the warnings. The check is actually more relaxed (no
warnings if either From or To is not Defined) for simplicity and I don't
see a compelling reason to warn on more cases.