lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <7bf31e46fa228ea4d8e47f4767b2c6f2e4180942.1592510545.git.mhelsley@vmware.com>
Date:   Thu, 18 Jun 2020 13:37:53 -0700
From:   Matt Helsley <mhelsley@...are.com>
To:     <linux-kernel@...r.kernel.org>
CC:     Josh Poimboeuf <jpoimboe@...hat.com>,
        Peter Zijlstra <peterz@...radead.org>,
        Steven Rostedt <rostedt@...dmis.org>,
        Julien Thierry <jthierry@...hat.com>,
        Kamalesh Babulal <kamalesh@...ux.vnet.ibm.com>,
        Matt Helsley <mhelsley@...are.com>
Subject: [RFC][PATCH v5 07/51] objtool: mcount: Move nhdr into find_symtab()

Since it's no longer needed in the rest of do_func() we can move
it to where it's needed rather than pass it as a parameter.

Signed-off-by: Matt Helsley <mhelsley@...are.com>
---
 tools/objtool/recordmcount.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tools/objtool/recordmcount.h b/tools/objtool/recordmcount.h
index b46e855d32bf..4bd61c9d1fd5 100644
--- a/tools/objtool/recordmcount.h
+++ b/tools/objtool/recordmcount.h
@@ -229,9 +229,10 @@ static int get_shstrndx(Elf_Ehdr const *ehdr, Elf_Shdr const *shdr0)
 }
 
 static void find_symtab(Elf_Ehdr *const ehdr, Elf_Shdr const *shdr0,
-			unsigned const nhdr, Elf32_Word **symtab,
+			Elf32_Word **symtab,
 			Elf32_Word **symtab_shndx)
 {
+	unsigned const nhdr = get_shnum(ehdr, shdr0);
 	Elf_Shdr const *relhdr;
 	unsigned k;
 
@@ -593,7 +594,6 @@ static int do_func(Elf_Ehdr *const ehdr, char const *const fname,
 {
 	Elf_Shdr *const shdr0 = (Elf_Shdr *)(_w(ehdr->e_shoff)
 		+ (void *)ehdr);
-	unsigned const nhdr = get_shnum(ehdr, shdr0);
 	Elf_Shdr *const shstr = &shdr0[get_shstrndx(ehdr, shdr0)];
 	char const *const shstrtab = (char const *)(_w(shstr->sh_offset)
 		+ (void *)ehdr);
@@ -638,7 +638,7 @@ static int do_func(Elf_Ehdr *const ehdr, char const *const fname,
 		return -1;
 	}
 
-	find_symtab(ehdr, shdr0, nhdr, &symtab, &symtab_shndx);
+	find_symtab(ehdr, shdr0, &symtab, &symtab_shndx);
 
 	list_for_each_entry(sec, &lf->sections, list) {
 		char const *txtname;
-- 
2.20.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ