Commit 1952671
Peter Zijlstra
objtool: Optimize elf_dirty_reloc_sym()
When moving a symbol in the symtab its index changes and any reloc
referring that symtol-table-index will need to be rewritten too.
In order to facilitate this, objtool simply marks the whole reloc
section 'changed' which will cause the whole section to be
re-generated.
However, finding the relocs that use any given symbol is implemented
rather crudely -- a fully iteration of all sections and their relocs.
Given that some builds have over 20k sections (kallsyms etc..)
iterating all that for *each* symbol moved takes a bit of time.
Instead have each symbol keep a list of relocs that reference it.
This *vastly* improves build times for certain configs.
Reported-by: Borislav Petkov <[email protected]>
Signed-off-by: Peter Zijlstra (Intel) <[email protected]>
Link: https://lkml.kernel.org/r/[email protected]1 parent 0c3e806 commit 1952671
2 files changed
+12
-17
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
356 | 356 | | |
357 | 357 | | |
358 | 358 | | |
| 359 | + | |
359 | 360 | | |
360 | 361 | | |
361 | 362 | | |
| |||
557 | 558 | | |
558 | 559 | | |
559 | 560 | | |
| 561 | + | |
560 | 562 | | |
561 | 563 | | |
562 | 564 | | |
| |||
573 | 575 | | |
574 | 576 | | |
575 | 577 | | |
576 | | - | |
577 | | - | |
578 | | - | |
579 | | - | |
580 | | - | |
581 | | - | |
582 | | - | |
| 578 | + | |
583 | 579 | | |
584 | | - | |
585 | | - | |
586 | | - | |
587 | | - | |
588 | | - | |
589 | | - | |
590 | | - | |
| 580 | + | |
| 581 | + | |
591 | 582 | | |
592 | 583 | | |
593 | 584 | | |
| |||
902 | 893 | | |
903 | 894 | | |
904 | 895 | | |
| 896 | + | |
905 | 897 | | |
906 | 898 | | |
907 | | - | |
908 | 899 | | |
909 | | - | |
| 900 | + | |
| 901 | + | |
910 | 902 | | |
911 | 903 | | |
912 | 904 | | |
| |||
947 | 939 | | |
948 | 940 | | |
949 | 941 | | |
950 | | - | |
| 942 | + | |
951 | 943 | | |
952 | 944 | | |
953 | 945 | | |
954 | 946 | | |
955 | 947 | | |
956 | 948 | | |
| 949 | + | |
957 | 950 | | |
958 | 951 | | |
959 | 952 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
| 65 | + | |
65 | 66 | | |
66 | 67 | | |
67 | 68 | | |
| |||
73 | 74 | | |
74 | 75 | | |
75 | 76 | | |
| 77 | + | |
76 | 78 | | |
77 | 79 | | |
78 | 80 | | |
| |||
0 commit comments