diff options
author | Josh Poimboeuf <jpoimboe@kernel.org> | 2023-05-30 10:20:59 -0700 |
---|---|---|
committer | Josh Poimboeuf <jpoimboe@kernel.org> | 2023-06-07 10:03:17 -0700 |
commit | 6342a20efbd8b70d169c325b2c27a8a8f96388d5 (patch) | |
tree | cd0a2d698c8914194d1524ae09a4219017cf0309 /tools/objtool/arch/x86/include | |
parent | ff4082730c2aaff3706232266e09d1ae4b350521 (diff) |
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>
Diffstat (limited to 'tools/objtool/arch/x86/include')
-rw-r--r-- | tools/objtool/arch/x86/include/arch/elf.h | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/tools/objtool/arch/x86/include/arch/elf.h b/tools/objtool/arch/x86/include/arch/elf.h index ac14987cf687..7131f7f51a4e 100644 --- a/tools/objtool/arch/x86/include/arch/elf.h +++ b/tools/objtool/arch/x86/include/arch/elf.h @@ -1,8 +1,13 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ #ifndef _OBJTOOL_ARCH_ELF #define _OBJTOOL_ARCH_ELF -#define R_NONE R_X86_64_NONE -#define R_ABS64 R_X86_64_64 -#define R_ABS32 R_X86_64_32 +#define R_NONE R_X86_64_NONE +#define R_ABS32 R_X86_64_32 +#define R_ABS64 R_X86_64_64 +#define R_DATA32 R_X86_64_PC32 +#define R_DATA64 R_X86_64_PC32 +#define R_TEXT32 R_X86_64_PC32 +#define R_TEXT64 R_X86_64_PC32 #endif /* _OBJTOOL_ARCH_ELF */ |