Make -fwhole-program to work with incremental LTO linking
Update documentation of -fwhole-program which was wrongly
claiming that it is useless with LTO whole it is useful for LTO without plugin
and extends -fwhole-program to also work with incremental linking.
This is useful when building kernel where the incremental link is de-facto fina
binary and only some explicitly marked symbols needs to remain.
Bootstrapped/regtested x86_64-linux, comitted.
gcc/ChangeLog:
2022-12-21 Jan Hubicka <hubicka@ucw.cz>
* doc/invoke.texi: Fix documentation of -fwhole-program with LTO
and document behaviour for incremental linking.
gcc/lto/ChangeLog:
2022-12-21 Jan Hubicka <hubicka@ucw.cz>
* lto-common.cc (lto_resolution_read): With incremental linking
and whole program ignore turn LDPR_PREVAILING_DEF_IRONLY to
LDPR_PREVAILING_DEF_IRONLY_EXP
* lto-lang.cc (lto_post_options): Do not clear flag_whole_program
for incremental link