Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp2365181pxp; Fri, 18 Mar 2022 09:04:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwtznrWJGfb+mfHYjvK8gfyRlWdKdYjcr+qUzoFAd2NUn58N+hS3ULDKsVUasXyOmTU+b45 X-Received: by 2002:a63:dd47:0:b0:381:2bb3:86ba with SMTP id g7-20020a63dd47000000b003812bb386bamr8474780pgj.381.1647619460613; Fri, 18 Mar 2022 09:04:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647619460; cv=none; d=google.com; s=arc-20160816; b=aaG7C901p7/9eNz1clujQILaqbFfYWZfF7LIF5LB2PH4sF4tlX1794kDQ7vd6tLHGE 669rbhLuLmLpZG+bchZOEN579IiZyq39I0CUR3ZBiFlijEEM2w5LYFo2V0spZdRprQus UFxOV0H7tTXD12Wr/Bp98UVdy/fcIS0jdQgLlgIi+EviEQ00orkRz9gBj3iw+Qqyytje zYDacJBg9JIvdrfycuJwaIWI+znaUaB+esJeL7EnlcsJXyIBrZckMc2ujBFqlo83RdKE FqGccF/xBibq3NqG27l2zxOpkaFBStGffr2HIDLuV666xDEfnpslCiPilquC+x2qcpDb fiRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=1dxESL4wrWhiNiFzfmUFeh1MGvu9VOj/ATKHLuRWj7s=; b=NyW+/vw5GG+UF7pMVIsSFEd/hUOK+Km/0t8ALsQ3qL/5Nog2hFw5ZPMuJLfcmVTf5j 6MuiNFkiFVjS5V7O7lIUIFH4ymtKQeo5GhKU+51rwLNvySxyMVd7R0vYUPeQ7lRcZNBI 3eZ+iuulUgkR7mnFQQ1Ct19A6xaf0CGzDmxhwMTl0b0QFJBTr9/u15Csa8tnzV0rAJSo 7JegcmWfnFvmS4526bBLwS8cU3vTye7xyGKFHIO1eCUiR0/4V3sWNJYR4cy2NDCCo7R8 wV87SvCXN6BJZfCIvK7m+rCpJ1NXZCg46neQZa3maoCxzof1hPyypOv6Ftj+eykehMVZ ZG/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=OXQd9p66; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g1-20020a639f01000000b003816043ef94si5726158pge.393.2022.03.18.09.04.04; Fri, 18 Mar 2022 09:04:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=OXQd9p66; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235466AbiCRKzZ (ORCPT + 99 others); Fri, 18 Mar 2022 06:55:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44408 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235468AbiCRKzR (ORCPT ); Fri, 18 Mar 2022 06:55:17 -0400 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D2CC3173378 for ; Fri, 18 Mar 2022 03:53:56 -0700 (PDT) Received: from pps.filterd (m0098399.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 22I7vjir011346; Fri, 18 Mar 2022 10:53:32 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pp1; bh=1dxESL4wrWhiNiFzfmUFeh1MGvu9VOj/ATKHLuRWj7s=; b=OXQd9p66lTsez6l02+Ds20iaUihnIbI15MLXxprpeprpJrklKSanzryKs+R46Fn6qUij gGnL9AO8dIqa8RaElvnDmEappCeyPDrZn5NFOtDSpO+RerfagfXE0euRn/b5c8nBsu23 kuOlBDblfW5Iss2J7Z/fCjXIDj1DvQyMuQhNSLIsRf4D076bNjzb/ZX/0VKqzCTbxsuH KkSQo+iXtb9gNrAMAuCRt7IfCTHLhTM6hojjK+b0a+7SuT5LY4mK6kMnwHOxCceZDk3j UH27YR6rU4K/yYw6bTvbn8ObW1hD3rl3V2chH9MDJwERoAL7Q4M2jXqiyfU21yXYrQym 9A== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 3ev2s51p5s-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 18 Mar 2022 10:53:31 +0000 Received: from m0098399.ppops.net (m0098399.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.43/8.16.0.43) with SMTP id 22IAqtK8017577; Fri, 18 Mar 2022 10:53:31 GMT Received: from ppma04ams.nl.ibm.com (63.31.33a9.ip4.static.sl-reverse.com [169.51.49.99]) by mx0a-001b2d01.pphosted.com with ESMTP id 3ev2s51p5a-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 18 Mar 2022 10:53:31 +0000 Received: from pps.filterd (ppma04ams.nl.ibm.com [127.0.0.1]) by ppma04ams.nl.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 22IArRmZ026929; Fri, 18 Mar 2022 10:53:28 GMT Received: from b06cxnps4074.portsmouth.uk.ibm.com (d06relay11.portsmouth.uk.ibm.com [9.149.109.196]) by ppma04ams.nl.ibm.com with ESMTP id 3erk595b2c-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 18 Mar 2022 10:53:28 +0000 Received: from d06av24.portsmouth.uk.ibm.com (d06av24.portsmouth.uk.ibm.com [9.149.105.60]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 22IArQ8j19726780 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 18 Mar 2022 10:53:26 GMT Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 6EC2C42047; Fri, 18 Mar 2022 10:53:26 +0000 (GMT) Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 7655E4203F; Fri, 18 Mar 2022 10:53:23 +0000 (GMT) Received: from li-c3569c4c-1ef8-11b2-a85c-ee139cda3133.ibm.com.com (unknown [9.43.86.72]) by d06av24.portsmouth.uk.ibm.com (Postfix) with ESMTP; Fri, 18 Mar 2022 10:53:23 +0000 (GMT) From: Sathvika Vasireddy To: linuxppc-dev@lists.ozlabs.org Cc: jpoimboe@redhat.com, peterz@infradead.org, linux-kernel@vger.kernel.org, aik@ozlabs.ru, mpe@ellerman.id.au, rostedt@goodmis.org, naveen.n.rao@linux.vnet.ibm.com, sv@linux.ibm.com Subject: [RFC PATCH 1/3] objtool: Move common code to utils.c Date: Fri, 18 Mar 2022 16:21:38 +0530 Message-Id: <20220318105140.43914-2-sv@linux.ibm.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20220318105140.43914-1-sv@linux.ibm.com> References: <20220318105140.43914-1-sv@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: 28vsj1gaIiAWR3ol53GRSKjETyNUnhZe X-Proofpoint-GUID: 8aqvLo5e6oisQn81p_U3MNdYm4m88s_g X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.850,Hydra:6.0.425,FMLib:17.11.64.514 definitions=2022-03-18_08,2022-03-15_01,2022-02-23_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 spamscore=0 lowpriorityscore=0 bulkscore=0 mlxlogscore=999 suspectscore=0 malwarescore=0 clxscore=1015 mlxscore=0 adultscore=0 priorityscore=1501 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2202240000 definitions=main-2203180058 X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch moves common code to utils.c file. Code from this file will be reused across check.c and mcount.c (will be introduced in the coming patches). Also, ensure that this change works well with existing commands. Signed-off-by: Sathvika Vasireddy --- tools/objtool/Build | 1 + tools/objtool/check.c | 178 +----------------------- tools/objtool/include/objtool/check.h | 2 - tools/objtool/include/objtool/utils.h | 28 ++++ tools/objtool/orc_gen.c | 1 + tools/objtool/utils.c | 192 ++++++++++++++++++++++++++ 6 files changed, 223 insertions(+), 179 deletions(-) create mode 100644 tools/objtool/include/objtool/utils.h create mode 100644 tools/objtool/utils.c diff --git a/tools/objtool/Build b/tools/objtool/Build index b7222d5cc7bc..161fd451241a 100644 --- a/tools/objtool/Build +++ b/tools/objtool/Build @@ -12,6 +12,7 @@ objtool-y += builtin-check.o objtool-y += builtin-orc.o objtool-y += elf.o objtool-y += objtool.o +objtool-y += utils.o objtool-y += libstring.o objtool-y += libctype.o diff --git a/tools/objtool/check.c b/tools/objtool/check.c index 7c33ec67c4a9..161dd181d9d4 100644 --- a/tools/objtool/check.c +++ b/tools/objtool/check.c @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include @@ -33,19 +34,6 @@ static struct cfi_init_state initial_func_cfi; static struct cfi_state init_cfi; static struct cfi_state func_cfi; -struct instruction *find_insn(struct objtool_file *file, - struct section *sec, unsigned long offset) -{ - struct instruction *insn; - - hash_for_each_possible(file->insn_hash, insn, hash, sec_offset_hash(sec, offset)) { - if (insn->sec == sec && insn->offset == offset) - return insn; - } - - return NULL; -} - static struct instruction *next_insn_same_sec(struct objtool_file *file, struct instruction *insn) { @@ -342,86 +330,8 @@ static void *cfi_hash_alloc(unsigned long size) return cfi_hash; } -static unsigned long nr_insns; static unsigned long nr_insns_visited; -/* - * Call the arch-specific instruction decoder for all the instructions and add - * them to the global instruction list. - */ -static int decode_instructions(struct objtool_file *file) -{ - struct section *sec; - struct symbol *func; - unsigned long offset; - struct instruction *insn; - int ret; - - for_each_sec(file, sec) { - - if (!(sec->sh.sh_flags & SHF_EXECINSTR)) - continue; - - if (strcmp(sec->name, ".altinstr_replacement") && - strcmp(sec->name, ".altinstr_aux") && - strncmp(sec->name, ".discard.", 9)) - sec->text = true; - - if (!strcmp(sec->name, ".noinstr.text") || - !strcmp(sec->name, ".entry.text")) - sec->noinstr = true; - - for (offset = 0; offset < sec->sh.sh_size; offset += insn->len) { - insn = malloc(sizeof(*insn)); - if (!insn) { - WARN("malloc failed"); - return -1; - } - memset(insn, 0, sizeof(*insn)); - INIT_LIST_HEAD(&insn->alts); - INIT_LIST_HEAD(&insn->stack_ops); - - insn->sec = sec; - insn->offset = offset; - - ret = arch_decode_instruction(file, sec, offset, - sec->sh.sh_size - offset, - &insn->len, &insn->type, - &insn->immediate, - &insn->stack_ops); - if (ret) - goto err; - - hash_add(file->insn_hash, &insn->hash, sec_offset_hash(sec, insn->offset)); - list_add_tail(&insn->list, &file->insn_list); - nr_insns++; - } - - list_for_each_entry(func, &sec->symbol_list, list) { - if (func->type != STT_FUNC || func->alias != func) - continue; - - if (!find_insn(file, sec, func->offset)) { - WARN("%s(): can't find starting instruction", - func->name); - return -1; - } - - sym_for_each_insn(file, func, insn) - insn->func = func; - } - } - - if (stats) - printf("nr_insns: %lu\n", nr_insns); - - return 0; - -err: - free(insn); - return ret; -} - /* * Read the pv_ops[] .data table to find the static initialized values. */ @@ -731,49 +641,6 @@ static int create_retpoline_sites_sections(struct objtool_file *file) return 0; } -static int create_mcount_loc_sections(struct objtool_file *file) -{ - struct section *sec; - unsigned long *loc; - struct instruction *insn; - int idx; - - sec = find_section_by_name(file->elf, "__mcount_loc"); - if (sec) { - INIT_LIST_HEAD(&file->mcount_loc_list); - WARN("file already has __mcount_loc section, skipping"); - return 0; - } - - if (list_empty(&file->mcount_loc_list)) - return 0; - - idx = 0; - list_for_each_entry(insn, &file->mcount_loc_list, call_node) - idx++; - - sec = elf_create_section(file->elf, "__mcount_loc", 0, sizeof(unsigned long), idx); - if (!sec) - return -1; - - idx = 0; - list_for_each_entry(insn, &file->mcount_loc_list, call_node) { - - loc = (unsigned long *)sec->data->d_buf + idx; - memset(loc, 0, sizeof(unsigned long)); - - if (elf_add_reloc_to_insn(file->elf, sec, - idx * sizeof(unsigned long), - R_X86_64_64, - insn->sec, insn->offset)) - return -1; - - idx++; - } - - return 0; -} - /* * Warnings shouldn't be reported for ignored functions. */ @@ -1013,38 +880,6 @@ __weak bool arch_is_retpoline(struct symbol *sym) return false; } -#define NEGATIVE_RELOC ((void *)-1L) - -static struct reloc *insn_reloc(struct objtool_file *file, struct instruction *insn) -{ - if (insn->reloc == NEGATIVE_RELOC) - return NULL; - - if (!insn->reloc) { - if (!file) - return NULL; - - insn->reloc = find_reloc_by_dest_range(file->elf, insn->sec, - insn->offset, insn->len); - if (!insn->reloc) { - insn->reloc = NEGATIVE_RELOC; - return NULL; - } - } - - return insn->reloc; -} - -static void remove_insn_ops(struct instruction *insn) -{ - struct stack_op *op, *tmp; - - list_for_each_entry_safe(op, tmp, &insn->stack_ops, list) { - list_del(&op->list); - free(op); - } -} - static void annotate_call_site(struct objtool_file *file, struct instruction *insn, bool sibling) { @@ -1256,17 +1091,6 @@ static int add_jump_destinations(struct objtool_file *file) return 0; } -static struct symbol *find_call_destination(struct section *sec, unsigned long offset) -{ - struct symbol *call_dest; - - call_dest = find_func_by_offset(sec, offset); - if (!call_dest) - call_dest = find_symbol_by_offset(sec, offset); - - return call_dest; -} - /* * Find the destination instructions for all calls. */ diff --git a/tools/objtool/include/objtool/check.h b/tools/objtool/include/objtool/check.h index 6cfff078897f..d4e378c7aa30 100644 --- a/tools/objtool/include/objtool/check.h +++ b/tools/objtool/include/objtool/check.h @@ -79,8 +79,6 @@ static inline bool is_jump(struct instruction *insn) return is_static_jump(insn) || is_dynamic_jump(insn); } -struct instruction *find_insn(struct objtool_file *file, - struct section *sec, unsigned long offset); #define for_each_insn(file, insn) \ list_for_each_entry(insn, &file->insn_list, list) diff --git a/tools/objtool/include/objtool/utils.h b/tools/objtool/include/objtool/utils.h new file mode 100644 index 000000000000..f808a66dd0a8 --- /dev/null +++ b/tools/objtool/include/objtool/utils.h @@ -0,0 +1,28 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ +/* + * Copyright (C) 2017 Josh Poimboeuf + */ + +#ifndef UTILS_H +#define UTILS_H + +#include +#include +#include + +int decode_instructions(struct objtool_file *file); +struct reloc *insn_reloc(struct objtool_file *file, struct instruction *insn); +void remove_insn_ops(struct instruction *insn); +struct symbol *find_call_destination(struct section *sec, unsigned long offset); +int create_mcount_loc_sections(struct objtool_file *file); +struct instruction *find_insn(struct objtool_file *file, + struct section *sec, unsigned long offset); + +#define sym_for_each_insn(file, sym, insn) \ + for (insn = find_insn(file, sym->sec, sym->offset); \ + insn && &insn->list != &file->insn_list && \ + insn->sec == sym->sec && \ + insn->offset < sym->offset + sym->len; \ + insn = list_next_entry(insn, list)) + +#endif /* UTILS_H */ diff --git a/tools/objtool/orc_gen.c b/tools/objtool/orc_gen.c index dd3c64af9db2..383c5f2f0658 100644 --- a/tools/objtool/orc_gen.c +++ b/tools/objtool/orc_gen.c @@ -10,6 +10,7 @@ #include #include +#include #include #include diff --git a/tools/objtool/utils.c b/tools/objtool/utils.c new file mode 100644 index 000000000000..d1fc6a123a6e --- /dev/null +++ b/tools/objtool/utils.c @@ -0,0 +1,192 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * Copyright (C) 2017 Josh Poimboeuf + */ + +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include +#include + +struct instruction *find_insn(struct objtool_file *file, + struct section *sec, unsigned long offset) +{ + struct instruction *insn; + + hash_for_each_possible(file->insn_hash, insn, hash, sec_offset_hash(sec, offset)) { + if (insn->sec == sec && insn->offset == offset) + return insn; + } + + return NULL; +} + +#define NEGATIVE_RELOC ((void *)-1L) + +struct reloc *insn_reloc(struct objtool_file *file, struct instruction *insn) +{ + if (insn->reloc == NEGATIVE_RELOC) + return NULL; + + if (!insn->reloc) { + if (!file) + return NULL; + + insn->reloc = find_reloc_by_dest_range(file->elf, insn->sec, + insn->offset, insn->len); + if (!insn->reloc) { + insn->reloc = NEGATIVE_RELOC; + return NULL; + } + } + + return insn->reloc; +} +void remove_insn_ops(struct instruction *insn) +{ + struct stack_op *op, *tmp; + + list_for_each_entry_safe(op, tmp, &insn->stack_ops, list) { + list_del(&op->list); + free(op); + } +} + + +struct symbol *find_call_destination(struct section *sec, unsigned long offset) +{ + struct symbol *call_dest; + + call_dest = find_func_by_offset(sec, offset); + if (!call_dest) + call_dest = find_symbol_by_offset(sec, offset); + + return call_dest; +} + +static unsigned long nr_insns; + +int decode_instructions(struct objtool_file *file) +{ + struct section *sec; + struct symbol *func; + unsigned long offset; + struct instruction *insn; + int ret; + + for_each_sec(file, sec) { + + if (!(sec->sh.sh_flags & SHF_EXECINSTR)) + continue; + + if (strcmp(sec->name, ".altinstr_replacement") && + strcmp(sec->name, ".altinstr_aux") && + strncmp(sec->name, ".discard.", 9)) + sec->text = true; + + if (!strcmp(sec->name, ".noinstr.text") || + !strcmp(sec->name, ".entry.text")) + sec->noinstr = true; + + for (offset = 0; offset < sec->sh.sh_size; offset += insn->len) { + insn = malloc(sizeof(*insn)); + if (!insn) { + WARN("malloc failed"); + return -1; + } + memset(insn, 0, sizeof(*insn)); + INIT_LIST_HEAD(&insn->alts); + INIT_LIST_HEAD(&insn->stack_ops); + + insn->sec = sec; + insn->offset = offset; + + ret = arch_decode_instruction(file, sec, offset, + sec->sh.sh_size - offset, + &insn->len, &insn->type, + &insn->immediate, + &insn->stack_ops); + if (ret) + goto err; + + hash_add(file->insn_hash, &insn->hash, sec_offset_hash(sec, insn->offset)); + list_add_tail(&insn->list, &file->insn_list); + nr_insns++; + } + + list_for_each_entry(func, &sec->symbol_list, list) { + if (func->type != STT_FUNC || func->alias != func) + continue; + + if (!find_insn(file, sec, func->offset)) { + WARN("%s(): can't find starting instruction", + func->name); + return -1; + } + + sym_for_each_insn(file, func, insn) + insn->func = func; + } + } + + if (stats) + printf("nr_insns: %lu\n", nr_insns); + + return 0; + +err: + free(insn); + return ret; +} + +int create_mcount_loc_sections(struct objtool_file *file) +{ + struct section *sec; + unsigned long *loc; + struct instruction *insn; + int idx; + + sec = find_section_by_name(file->elf, "__mcount_loc"); + if (sec) { + INIT_LIST_HEAD(&file->mcount_loc_list); + WARN("file already has __mcount_loc section, skipping"); + return 0; + } + + if (list_empty(&file->mcount_loc_list)) + return 0; + + idx = 0; + list_for_each_entry(insn, &file->mcount_loc_list, call_node) + idx++; + + sec = elf_create_section(file->elf, "__mcount_loc", 0, sizeof(unsigned long), idx); + if (!sec) + return -1; + + idx = 0; + list_for_each_entry(insn, &file->mcount_loc_list, call_node) { + + loc = (unsigned long *)sec->data->d_buf + idx; + memset(loc, 0, sizeof(unsigned long)); + + if (elf_add_reloc_to_insn(file->elf, sec, + idx * sizeof(unsigned long), + R_X86_64_64, + insn->sec, insn->offset)) + return -1; + + idx++; + } + + return 0; +} -- 2.31.1