Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'objtool-core-2025-05-25' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull objtool updates from Ingo Molnar:

- Speed up SHT_GROUP reindexing (Josh Poimboeuf)

- Fix up st_info in COMDAT group section (Rong Xu)

* tag 'objtool-core-2025-05-25' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
objtool: Speed up SHT_GROUP reindexing
objtool: Fix up st_info in COMDAT group section

+38 -1
+37 -1
tools/objtool/elf.c
··· 572 572 return -1; 573 573 } 574 574 575 + static int mark_group_syms(struct elf *elf) 576 + { 577 + struct section *symtab, *sec; 578 + struct symbol *sym; 579 + 580 + symtab = find_section_by_name(elf, ".symtab"); 581 + if (!symtab) { 582 + ERROR("no .symtab"); 583 + return -1; 584 + } 585 + 586 + list_for_each_entry(sec, &elf->sections, list) { 587 + if (sec->sh.sh_type == SHT_GROUP && 588 + sec->sh.sh_link == symtab->idx) { 589 + sym = find_symbol_by_index(elf, sec->sh.sh_info); 590 + if (!sym) { 591 + ERROR("%s: can't find SHT_GROUP signature symbol", 592 + sec->name); 593 + return -1; 594 + } 595 + 596 + sym->group_sec = sec; 597 + } 598 + } 599 + 600 + return 0; 601 + } 602 + 575 603 /* 576 604 * @sym's idx has changed. Update the relocs which reference it. 577 605 */ ··· 773 745 774 746 /* 775 747 * Move the first global symbol, as per sh_info, into a new, higher 776 - * symbol index. This fees up a spot for a new local symbol. 748 + * symbol index. This frees up a spot for a new local symbol. 777 749 */ 778 750 first_non_local = symtab->sh.sh_info; 779 751 old = find_symbol_by_index(elf, first_non_local); ··· 790 762 791 763 if (elf_update_sym_relocs(elf, old)) 792 764 return NULL; 765 + 766 + if (old->group_sec) { 767 + old->group_sec->sh.sh_info = new_idx; 768 + mark_sec_changed(elf, old->group_sec, true); 769 + } 793 770 794 771 new_idx = first_non_local; 795 772 } ··· 1066 1033 goto err; 1067 1034 1068 1035 if (read_symbols(elf)) 1036 + goto err; 1037 + 1038 + if (mark_group_syms(elf)) 1069 1039 goto err; 1070 1040 1071 1041 if (read_relocs(elf))
+1
tools/objtool/include/objtool/elf.h
··· 72 72 u8 ignore : 1; 73 73 struct list_head pv_target; 74 74 struct reloc *relocs; 75 + struct section *group_sec; 75 76 }; 76 77 77 78 struct reloc {