Commit 959806e
committed
Merge commit 7a66a26658f4 from llvm git (by Fangrui Song):
--discard-locals/--discard-all: allow and keep symbols referenced by relocations
In GNU objcopy, symbols referenced by relocations are retained. Our
COFF (https://reviews.llvm.org/D56480) and Mach-O
(https://reviews.llvm.org/D75104) ports port the behavior, but the ELF
port doesn't.
This PR implements the behavior for ELF.
Close #47468 (tcl has a use case that requires `strip -x tclStubLib.o`
to strip local symbols not referenced by relocations.)
Pull Request: llvm/llvm-project#130704
PR: 258820
Approved by: dim
Differential Revision: https://reviews.freebsd.org/D521981 parent e6253ea commit 959806e
1 file changed
+13
-12
lines changedLines changed: 13 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
368 | 368 | | |
369 | 369 | | |
370 | 370 | | |
371 | | - | |
| 371 | + | |
372 | 372 | | |
373 | 373 | | |
374 | 374 | | |
| |||
390 | 390 | | |
391 | 391 | | |
392 | 392 | | |
393 | | - | |
394 | | - | |
395 | | - | |
396 | | - | |
397 | | - | |
398 | | - | |
399 | | - | |
400 | 393 | | |
401 | 394 | | |
402 | 395 | | |
403 | 396 | | |
404 | 397 | | |
405 | | - | |
406 | | - | |
407 | | - | |
408 | | - | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
409 | 410 | | |
410 | 411 | | |
411 | 412 | | |
| |||
0 commit comments