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]
Date:   Thu, 18 Jun 2020 13:38:13 -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 27/51] objtool: mcount: Reduce usage of _size wrapper

Use a new loc_size parameter to append_func() rather than
use the wrapper's _size macro directly.

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

diff --git a/tools/objtool/recordmcount.h b/tools/objtool/recordmcount.h
index fcc4f1a74d60..a74a80b3356e 100644
--- a/tools/objtool/recordmcount.h
+++ b/tools/objtool/recordmcount.h
@@ -72,6 +72,7 @@ static int append_func(uint_t const *const mloc0,
 			uint_t const *const mlocp,
 			Elf_Rel const *const mrel0,
 			Elf_Rel const *const mrelp,
+			unsigned int const loc_size,
 			unsigned int const rel_entsize,
 			unsigned int const symsec_sh_link)
 {
@@ -84,14 +85,14 @@ static int append_func(uint_t const *const mloc0,
 	/* add section: __mcount_loc */
 	mcount_loc_sec = elf_create_section(lf,
 		mc_name + (sizeof(Elf_Rela) == rel_entsize) + strlen(".rel"),
-		_size, mlocp - mloc0);
+		loc_size, mlocp - mloc0);
 	if (!mcount_loc_sec)
 		return -1;
 	// created mcount_loc_sec->sh.sh_size = (void *)mlocp - (void *)mloc0;
 	mcount_loc_sec->sh.sh_link = 0;
 	mcount_loc_sec->sh.sh_info = 0;
-	mcount_loc_sec->sh.sh_addralign = _size;
-	// created mcount_loc_sec->sh.sh_entsize = _size;
+	mcount_loc_sec->sh.sh_addralign = loc_size;
+	// created mcount_loc_sec->sh.sh_entsize = loc_size;
 
 	// assert mcount_loc_sec->data->d_size == (void *)mlocp - (void *)mloc0
 	memcpy(mcount_loc_sec->data->d_buf, mloc0,
@@ -108,7 +109,7 @@ static int append_func(uint_t const *const mloc0,
 	reloc_sec->sh.sh_flags = 0; /* clear SHF_ALLOC */
 	reloc_sec->sh.sh_link = find_section_by_name(lf, ".symtab")->idx;
 	reloc_sec->sh.sh_info = mcount_loc_sec->idx;
-	reloc_sec->sh.sh_addralign = _size;
+	reloc_sec->sh.sh_addralign = loc_size;
 
 	// assert reloc_sec->data->d_size == (void *)mrelp - (void *)mrel0
 	memcpy(reloc_sec->data->d_buf, mrel0, reloc_sec->data->d_size);
@@ -227,7 +228,7 @@ static int do_func(unsigned const reltype)
 	}
 	if (!result && mloc0 != mlocp)
 		result = append_func(mloc0, mlocp, mrel0, mrelp,
-				     rel_entsize, symsec_sh_link);
+				     _size, rel_entsize, symsec_sh_link);
 out:
 	free(mrel0);
 	free(mloc0);
-- 
2.20.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ