summaryrefslogtreecommitdiff
path: root/tools/objtool/check.c
diff options
context:
space:
mode:
authorJosh Poimboeuf <jpoimboe@kernel.org>2023-05-30 10:21:12 -0700
committerJosh Poimboeuf <jpoimboe@kernel.org>2023-06-07 10:03:26 -0700
commitec24b927c1fbfc91cf7a48276d9fd92072b17d3b (patch)
treee8db701fb40cd41929765aa257e72b6311d3120a /tools/objtool/check.c
parent02b54001066364aee72bc4c802b42a96c6e0dc1f (diff)
objtool: Get rid of reloc->rel[a]
Get the relocation entry info from the underlying rsec->data. With allyesconfig + CONFIG_DEBUG_INFO: - Before: peak heap memory consumption: 35.12G - After: peak heap memory consumption: 29.93G Link: https://lore.kernel.org/r/2be32323de6d8cc73179ee0ff14b71f4e7cefaa0.1685464332.git.jpoimboe@kernel.org Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>
Diffstat (limited to 'tools/objtool/check.c')
-rw-r--r--tools/objtool/check.c20
1 files changed, 7 insertions, 13 deletions
diff --git a/tools/objtool/check.c b/tools/objtool/check.c
index 7fb6467178cb..47ff130a9460 100644
--- a/tools/objtool/check.c
+++ b/tools/objtool/check.c
@@ -968,7 +968,7 @@ static int create_mcount_loc_sections(struct objtool_file *file)
if (!reloc)
return -1;
- set_reloc_type(reloc, addr_size == 8 ? R_ABS64 : R_ABS32);
+ set_reloc_type(file->elf, reloc, addr_size == 8 ? R_ABS64 : R_ABS32);
idx++;
}
@@ -1363,10 +1363,8 @@ static void annotate_call_site(struct objtool_file *file,
* noinstr text.
*/
if (opts.hack_noinstr && insn->sec->noinstr && sym->profiling_func) {
- if (reloc) {
- set_reloc_type(reloc, R_NONE);
- elf_write_reloc(file->elf, reloc);
- }
+ if (reloc)
+ set_reloc_type(file->elf, reloc, R_NONE);
elf_write_insn(file->elf, insn->sec,
insn->offset, insn->len,
@@ -1392,10 +1390,8 @@ static void annotate_call_site(struct objtool_file *file,
if (sibling)
WARN_INSN(insn, "tail call to __fentry__ !?!?");
if (opts.mnop) {
- if (reloc) {
- set_reloc_type(reloc, R_NONE);
- elf_write_reloc(file->elf, reloc);
- }
+ if (reloc)
+ set_reloc_type(file->elf, reloc, R_NONE);
elf_write_insn(file->elf, insn->sec,
insn->offset, insn->len,
@@ -1874,10 +1870,8 @@ static int handle_jump_alt(struct objtool_file *file,
if (opts.hack_jump_label && special_alt->key_addend & 2) {
struct reloc *reloc = insn_reloc(file, orig_insn);
- if (reloc) {
- set_reloc_type(reloc, R_NONE);
- elf_write_reloc(file->elf, reloc);
- }
+ if (reloc)
+ set_reloc_type(file->elf, reloc, R_NONE);
elf_write_insn(file->elf, orig_insn->sec,
orig_insn->offset, orig_insn->len,
arch_nop_insn(orig_insn->len));