From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EA49E82866; Thu, 2 Jul 2026 16:49:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783010951; cv=none; b=cpp/esWOtcerX8kciQMUeOHA/xQ8aTFIAKxgOk0uvKEdxBlbafM/Qq6cDrt5dqbjZgojV30PEPI39dvsDgw99Vv9qpCLO+wsYGfxcUys0uFg/UXEFiUoJs3MXmw3k/yGeAmnO8DHFeLDJKI00kS/akB4+q9aiJ+/45Bu9k6a1Ao= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783010951; c=relaxed/simple; bh=5gJp86DDfZfjq24ACLNdStRiHsA3jech4hAnZgql91Q=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=CL2Q6l0uqV+Bq3kfvtYBsjocRBbngaEW/ihKYmA+5mOwtPBAkrmUfbe8/EntPx9mCAHuIAsEzOmXdjVtc39OJFjeYN5NVDhsXSFYSQXWwCRQNJ6C4xb/XcYgUuPLxiFw2IL0d6LsgGsCcfDHGkPwsV49rz2a9sqe+s8mKIqC27A= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=J7Rk0ZuV; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="J7Rk0ZuV" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 33A1F1F00A3F; Thu, 2 Jul 2026 16:49:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1783010949; bh=omHAUm/i9GraBxsKEdH9iRkO4ZWx+HG8D8+KJJ0AWd8=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=J7Rk0ZuV4hc/hAmNigwCjtS21K6iUOUQa+3biB+qk8seO9rNdr+RNYCDcROosqqJO xg464u5SeT4csxsKmlbrViZNSzhXblEk3zIUGepdQ0i/UsBKmTjnton9f/eYUqRgdo 8/Qv/e4uRzEZr770OSimpM7G7sGsuOBRvOib6IIs= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, bpf , Masami Hiramatsu , Mark Rutland , Mathieu Desnoyers , Andrew Morton , Peter Zijlstra , Linus Torvalds , Masahiro Yamada , Nathan Chancellor , Nicolas Schier , Zheng Yejian , Martin Kelly , Christophe Leroy , Josh Poimboeuf , "Steven Rostedt (Google)" , Andrey Grodzovsky Subject: [PATCH 6.6 046/175] scripts/sorttable: Remove unneeded Elf_Rel Date: Thu, 2 Jul 2026 18:19:07 +0200 Message-ID: <20260702155116.769094845@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260702155115.766838875@linuxfoundation.org> References: <20260702155115.766838875@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: bpf@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Steven Rostedt [ Upstream commit 6f2c2f93a190467cebd6ebd03feb49514fead5ca ] The code had references to initialize the Elf_Rel relocation tables, but it was never used. Remove it. Cc: bpf Cc: Masami Hiramatsu Cc: Mark Rutland Cc: Mathieu Desnoyers Cc: Andrew Morton Cc: Peter Zijlstra Cc: Linus Torvalds Cc: Masahiro Yamada Cc: Nathan Chancellor Cc: Nicolas Schier Cc: Zheng Yejian Cc: Martin Kelly Cc: Christophe Leroy Cc: Josh Poimboeuf Link: https://lore.kernel.org/20250105162344.515342233@goodmis.org Signed-off-by: Steven Rostedt (Google) Signed-off-by: Andrey Grodzovsky Signed-off-by: Greg Kroah-Hartman --- scripts/sorttable.h | 23 ++--------------------- 1 file changed, 2 insertions(+), 21 deletions(-) --- a/scripts/sorttable.h +++ b/scripts/sorttable.h @@ -26,7 +26,6 @@ #undef Elf_Addr #undef Elf_Ehdr #undef Elf_Shdr -#undef Elf_Rel #undef Elf_Sym #undef ELF_ST_TYPE #undef uint_t @@ -42,7 +41,6 @@ # define Elf_Addr Elf64_Addr # define Elf_Ehdr Elf64_Ehdr # define Elf_Shdr Elf64_Shdr -# define Elf_Rel Elf64_Rel # define Elf_Sym Elf64_Sym # define ELF_ST_TYPE ELF64_ST_TYPE # define uint_t uint64_t @@ -57,7 +55,6 @@ # define Elf_Addr Elf32_Addr # define Elf_Ehdr Elf32_Ehdr # define Elf_Shdr Elf32_Shdr -# define Elf_Rel Elf32_Rel # define Elf_Sym Elf32_Sym # define ELF_ST_TYPE ELF32_ST_TYPE # define uint_t uint32_t @@ -248,14 +245,10 @@ static int do_sort(Elf_Ehdr *ehdr, Elf32_Word *symtab_shndx = NULL; Elf_Sym *sort_needed_sym = NULL; Elf_Shdr *sort_needed_sec; - Elf_Rel *relocs = NULL; - int relocs_size = 0; uint32_t *sort_needed_loc; const char *secstrings; const char *strtab; char *extab_image; - int extab_index = 0; - int i; int idx; unsigned int shnum; unsigned int shstrndx; @@ -279,23 +272,15 @@ static int do_sort(Elf_Ehdr *ehdr, if (shnum == SHN_UNDEF) shnum = _r(&shdr[0].sh_size); - for (i = 0, s = shdr; s < shdr + shnum; i++, s++) { + for (s = shdr; s < shdr + shnum; s++) { idx = r(&s->sh_name); - if (!strcmp(secstrings + idx, "__ex_table")) { + if (!strcmp(secstrings + idx, "__ex_table")) extab_sec = s; - extab_index = i; - } if (!strcmp(secstrings + idx, ".symtab")) symtab_sec = s; if (!strcmp(secstrings + idx, ".strtab")) strtab_sec = s; - if ((r(&s->sh_type) == SHT_REL || - r(&s->sh_type) == SHT_RELA) && - r(&s->sh_info) == extab_index) { - relocs = (void *)ehdr + _r(&s->sh_offset); - relocs_size = _r(&s->sh_size); - } if (r(&s->sh_type) == SHT_SYMTAB_SHNDX) symtab_shndx = (Elf32_Word *)((const char *)ehdr + _r(&s->sh_offset)); @@ -397,10 +382,6 @@ static int do_sort(Elf_Ehdr *ehdr, extable_ent_size, compare_extable); } - /* If there were relocations, we no longer need them. */ - if (relocs) - memset(relocs, 0, relocs_size); - /* find the flag main_extable_sort_needed */ for (sym = (void *)ehdr + _r(&symtab_sec->sh_offset); sym < sym + _r(&symtab_sec->sh_size) / sizeof(Elf_Sym);