OSDN Git Service

objtool: Add elf_create_section_pair()
authorJosh Poimboeuf <jpoimboe@kernel.org>
Tue, 30 May 2023 17:20:59 +0000 (10:20 -0700)
committerJosh Poimboeuf <jpoimboe@kernel.org>
Wed, 7 Jun 2023 17:03:17 +0000 (10:03 -0700)
commit6342a20efbd8b70d169c325b2c27a8a8f96388d5
treecd0a2d698c8914194d1524ae09a4219017cf0309
parentff4082730c2aaff3706232266e09d1ae4b350521
objtool: Add elf_create_section_pair()

When creating an annotation section, allocate the reloc section data at
the beginning.  This simplifies the data model a bit and also saves
memory due to the removal of malloc() in elf_rebuild_reloc_section().

With allyesconfig + CONFIG_DEBUG_INFO:

- Before: peak heap memory consumption: 53.49G
- After:  peak heap memory consumption: 49.02G

Link: https://lore.kernel.org/r/048e908f3ede9b66c15e44672b6dda992b1dae3e.1685464332.git.jpoimboe@kernel.org
Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>
tools/objtool/arch/powerpc/include/arch/elf.h
tools/objtool/arch/x86/include/arch/elf.h
tools/objtool/check.c
tools/objtool/elf.c
tools/objtool/include/objtool/elf.h
tools/objtool/orc_gen.c