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 B764E1A682A; Thu, 2 Jul 2026 16:38:31 +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=1783010313; cv=none; b=fpNRjU6O3S4eHBU0dhjS9KKk0w3zOqyI0GIwZpHZxJDnBs/LJAsLlCFufSTcGmmbm9aAQl0RO5JZSxEq4rGuswjal7Pw4rQJ6NAdwcTZc0cUi/L/ne8SMsyLF9/4DMZHTtlWrG1bWvABCvK2kGfUZBjlA7jTcPHd7eaqBotUvms= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783010313; c=relaxed/simple; bh=+nMBBF3+qEdwF80EZohmSZfLtmLu14sFa2XQJuSJG1A=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=gV/cgLPU2tlCxE6HzOVEzTZcQU/CB5+RJWKkZ4Aqm1v9RgWMlYJwZYSFqCsrNiBklPRfOtgBXKe92UCC3DbAmhab3fvzR0AXJ0tUXCY5SG5fEAbyX4iOQw5vNRVC+IVz5VNO4AgpxT1/Rk3xzfxNsTiHoWjthwjLWjFtGfofQt8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=TqzEqc6F; 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="TqzEqc6F" Received: by smtp.kernel.org (Postfix) with ESMTPSA id F2B8F1F000E9; Thu, 2 Jul 2026 16:38:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1783010311; bh=78H5iUnNE9ff1mf9ryBaRmb7wepuCECrnEq6bdnbgLc=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=TqzEqc6FdAnu687RW44P208XCG5VEREa0RdPcLUveLfh7sa6rMzHP20PkYrawYzBe PZmC8oFU5N3zOAEHVcXhJTX8/Z6aBUyZYDuIznuTpvsNoeGor8+D+91Z4MyWHieCM4 aPUFUBHGAGdXjefcdTrF+QIRhyF5heeKtMKvgLEU= 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.12 059/204] scripts/sorttable: Remove unneeded Elf_Rel Date: Thu, 2 Jul 2026 18:18:36 +0200 Message-ID: <20260702155119.900155393@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260702155118.667618796@linuxfoundation.org> References: <20260702155118.667618796@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.12-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);