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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 1 Sep 2022 21:23:52 +0200
From:   Peter Zijlstra <peterz@...radead.org>
To:     Sathvika Vasireddy <sv@...ux.ibm.com>
Cc:     linuxppc-dev@...ts.ozlabs.org, jpoimboe@...hat.com,
        linux-kernel@...r.kernel.org, aik@...abs.ru, mpe@...erman.id.au,
        mingo@...hat.com, christophe.leroy@...roup.eu, rostedt@...dmis.org,
        mbenes@...e.cz, npiggin@...il.com, chenzhongjin@...wei.com,
        naveen.n.rao@...ux.vnet.ibm.com
Subject: Re: [PATCH v2 10/16] objtool: Use target file class size instead of
 a compiled constant

On Mon, Aug 29, 2022 at 11:22:17AM +0530, Sathvika Vasireddy wrote:
> From: Christophe Leroy <christophe.leroy@...roup.eu>
> 
> In order to allow using objtool on cross-built kernels,
> determine size of long from elf data instead of using
> sizeof(long) at build time.
> 
> For the time being this covers only mcount.
> 
> Signed-off-by: Christophe Leroy <christophe.leroy@...roup.eu>

Acked-by: Peter Zijlstra (Intel) <peterz@...radead.org>

> ---
>  tools/objtool/check.c               | 16 +++++++++-------
>  tools/objtool/elf.c                 |  8 ++++++--
>  tools/objtool/include/objtool/elf.h |  8 ++++++++
>  3 files changed, 23 insertions(+), 9 deletions(-)
> 
> diff --git a/tools/objtool/check.c b/tools/objtool/check.c
> index a948b2551520..0ecf41ee73f0 100644
> --- a/tools/objtool/check.c
> +++ b/tools/objtool/check.c
> @@ -851,9 +851,9 @@ static int create_ibt_endbr_seal_sections(struct objtool_file *file)
>  static int create_mcount_loc_sections(struct objtool_file *file)
>  {
>  	struct section *sec;
> -	unsigned long *loc;
>  	struct instruction *insn;
>  	int idx;
> +	int addrsize = elf_class_addrsize(file->elf);

If there is a respin, please make this a reverse-x-mas-tree thingy.

>  
>  	sec = find_section_by_name(file->elf, "__mcount_loc");
>  	if (sec) {
> @@ -869,23 +869,25 @@ static int create_mcount_loc_sections(struct objtool_file *file)

> --- a/tools/objtool/elf.c
> +++ b/tools/objtool/elf.c
> @@ -1124,6 +1124,7 @@ static struct section *elf_create_rela_reloc_section(struct elf *elf, struct sec
>  {
>  	char *relocname;
>  	struct section *sec;
> +	int addrsize = elf_class_addrsize(elf);
>  

idem.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ