Commit 503e129
committed
Auto merge of rust-lang#118568 - DianQK:no-builtins-symbols, r=pnkfelix
Avoid adding builtin functions to `symbols.o`
We found performance regressions in rust-lang#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 rust-lang#118559. But I think the second commit also makes sense.File tree
6 files changed
+30
-4
lines changed- compiler
- rustc_codegen_llvm/src/back
- rustc_codegen_ssa/src/back
- rustc_middle/src/middle
- src/tools/miri/src/bin
- tests/run-make/no-builtins-symbols
6 files changed
+30
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
63 | | - | |
| 63 | + | |
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
105 | 105 | | |
106 | 106 | | |
107 | 107 | | |
| 108 | + | |
108 | 109 | | |
109 | 110 | | |
110 | 111 | | |
111 | 112 | | |
112 | 113 | | |
113 | | - | |
114 | | - | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
115 | 117 | | |
116 | 118 | | |
117 | 119 | | |
118 | 120 | | |
119 | 121 | | |
120 | 122 | | |
121 | | - | |
122 | 123 | | |
123 | 124 | | |
124 | 125 | | |
| |||
138 | 139 | | |
139 | 140 | | |
140 | 141 | | |
| 142 | + | |
141 | 143 | | |
142 | 144 | | |
143 | 145 | | |
| |||
150 | 152 | | |
151 | 153 | | |
152 | 154 | | |
| 155 | + | |
153 | 156 | | |
154 | 157 | | |
155 | 158 | | |
| |||
198 | 201 | | |
199 | 202 | | |
200 | 203 | | |
| 204 | + | |
201 | 205 | | |
202 | 206 | | |
203 | 207 | | |
| |||
214 | 218 | | |
215 | 219 | | |
216 | 220 | | |
| 221 | + | |
217 | 222 | | |
218 | 223 | | |
219 | 224 | | |
| |||
233 | 238 | | |
234 | 239 | | |
235 | 240 | | |
| 241 | + | |
236 | 242 | | |
237 | 243 | | |
238 | 244 | | |
| |||
245 | 251 | | |
246 | 252 | | |
247 | 253 | | |
| 254 | + | |
248 | 255 | | |
249 | 256 | | |
250 | 257 | | |
| |||
264 | 271 | | |
265 | 272 | | |
266 | 273 | | |
| 274 | + | |
267 | 275 | | |
268 | 276 | | |
269 | 277 | | |
| |||
289 | 297 | | |
290 | 298 | | |
291 | 299 | | |
| 300 | + | |
292 | 301 | | |
293 | 302 | | |
294 | 303 | | |
| |||
306 | 315 | | |
307 | 316 | | |
308 | 317 | | |
| 318 | + | |
309 | 319 | | |
310 | 320 | | |
311 | 321 | | |
| |||
346 | 356 | | |
347 | 357 | | |
348 | 358 | | |
| 359 | + | |
349 | 360 | | |
350 | 361 | | |
351 | 362 | | |
| |||
362 | 373 | | |
363 | 374 | | |
364 | 375 | | |
| 376 | + | |
365 | 377 | | |
366 | 378 | | |
367 | 379 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| 38 | + | |
| 39 | + | |
38 | 40 | | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
39 | 44 | | |
40 | 45 | | |
41 | 46 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
165 | 165 | | |
166 | 166 | | |
167 | 167 | | |
| 168 | + | |
168 | 169 | | |
169 | 170 | | |
170 | 171 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
0 commit comments