Skip to content

Commit

Permalink
Auto merge of #118568 - DianQK:no-builtins-symbols, r=pnkfelix
Browse files Browse the repository at this point in the history
Avoid adding builtin functions to `symbols.o`

We found performance regressions in #113923. The problem seems to be that `--gc-sections` does not remove these symbols. I tested that lld removes these symbols, but ld and gold do not.

I found that `used` adds symbols to `symbols.o` at https://github.com/rust-lang/rust/blob/3e202ead604be31f4c1a5798a296953d3159da7e/compiler/rustc_codegen_ssa/src/back/linker.rs#L1786-L1791.
The PR removes builtin functions.

Note that under LTO, ld still preserves these symbols. (lld will still remove them.)

The first commit also fixes #118559. But I think the second commit also makes sense.
  • Loading branch information
bors committed Dec 7, 2023
2 parents 9819762 + 64e4bad commit db90722
Showing 0 changed files with 0 additions and 0 deletions.

0 comments on commit db90722

Please sign in to comment.