checkpoint-restore / criu

Checkpoint/Restore tool
criu.org
Other
2.79k stars 565 forks source link

pie: Mark __export_*() functions as externally_visible #2279

Closed avagin closed 9 months ago

avagin commented 9 months ago

GCC's lto source:

> To avoid this problem the compiler must assume that it sees the
> whole program when doing link-time optimization.  Strictly
> speaking, the whole program is rarely visible even at link-time.
> Standard system libraries are usually linked dynamically or not
> provided with the link-time information.  In GCC, the whole
> program option (@option{-fwhole-program}) asserts that every
> function and variable defined in the current compilation
> unit is static, except for function @code{main} (note: at
> link time, the current unit is the union of all objects compiled
> with LTO).  Since some functions and variables need to
> be referenced externally, for example by another DSO or from an
> assembler file, GCC also provides the function and variable
> attribute @code{externally_visible} which can be used to disable
> the effect of @option{-fwhole-program} on a specific symbol.

As far as I read gcc's source, ipa_comdats() will avoid placing symbols that are either already in a user-defined section or have externally_visible attribute into new optimized gcc sections.

codecov-commenter commented 9 months ago

Codecov Report

Attention: 136 lines in your changes are missing coverage. Please review.

Comparison is base (4c1a2ac) 70.63% compared to head (62ca092) 70.54%. Report is 162 commits behind head on criu-dev.

:exclamation: Current head 62ca092 differs from pull request most recent head 70b5f43. Consider uploading reports for the commit 70b5f43 to get more accurate results

Additional details and impacted files ```diff @@ Coverage Diff @@ ## criu-dev #2279 +/- ## ============================================ - Coverage 70.63% 70.54% -0.09% ============================================ Files 132 132 Lines 33434 33509 +75 ============================================ + Hits 23615 23640 +25 - Misses 9819 9869 +50 ``` | [Files](https://app.codecov.io/gh/checkpoint-restore/criu/pull/2279?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=checkpoint-restore) | Coverage Δ | | |---|---|---| | [criu/apparmor.c](https://app.codecov.io/gh/checkpoint-restore/criu/pull/2279?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=checkpoint-restore#diff-Y3JpdS9hcHBhcm1vci5j) | `54.01% <100.00%> (ø)` | | | [criu/include/image.h](https://app.codecov.io/gh/checkpoint-restore/criu/pull/2279?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=checkpoint-restore#diff-Y3JpdS9pbmNsdWRlL2ltYWdlLmg=) | `100.00% <ø> (ø)` | | | [criu/include/parasite.h](https://app.codecov.io/gh/checkpoint-restore/criu/pull/2279?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=checkpoint-restore#diff-Y3JpdS9pbmNsdWRlL3BhcmFzaXRlLmg=) | `100.00% <ø> (ø)` | | | [criu/include/restorer.h](https://app.codecov.io/gh/checkpoint-restore/criu/pull/2279?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=checkpoint-restore#diff-Y3JpdS9pbmNsdWRlL3Jlc3RvcmVyLmg=) | `100.00% <ø> (ø)` | | | [criu/include/rst\_info.h](https://app.codecov.io/gh/checkpoint-restore/criu/pull/2279?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=checkpoint-restore#diff-Y3JpdS9pbmNsdWRlL3JzdF9pbmZvLmg=) | `100.00% <ø> (ø)` | | | [criu/include/util.h](https://app.codecov.io/gh/checkpoint-restore/criu/pull/2279?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=checkpoint-restore#diff-Y3JpdS9pbmNsdWRlL3V0aWwuaA==) | `70.37% <ø> (-29.63%)` | :arrow_down: | | [criu/include/vma.h](https://app.codecov.io/gh/checkpoint-restore/criu/pull/2279?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=checkpoint-restore#diff-Y3JpdS9pbmNsdWRlL3ZtYS5o) | `100.00% <100.00%> (ø)` | | | [criu/libnetlink.c](https://app.codecov.io/gh/checkpoint-restore/criu/pull/2279?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=checkpoint-restore#diff-Y3JpdS9saWJuZXRsaW5rLmM=) | `75.26% <ø> (-0.27%)` | :arrow_down: | | [criu/mem.c](https://app.codecov.io/gh/checkpoint-restore/criu/pull/2279?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=checkpoint-restore#diff-Y3JpdS9tZW0uYw==) | `86.30% <ø> (+0.95%)` | :arrow_up: | | [criu/namespaces.c](https://app.codecov.io/gh/checkpoint-restore/criu/pull/2279?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=checkpoint-restore#diff-Y3JpdS9uYW1lc3BhY2VzLmM=) | `69.48% <ø> (ø)` | | | ... and [30 more](https://app.codecov.io/gh/checkpoint-restore/criu/pull/2279?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=checkpoint-restore) | | ... and [9 files with indirect coverage changes](https://app.codecov.io/gh/checkpoint-restore/criu/pull/2279/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=checkpoint-restore)

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.