Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1225893

Re: [PATCH] vmcore: replace Elf64_Ehdr/Elf32_Ehdr with elfhdr

From Dave Young <dyoung@redhat.com>
Newsgroups linux.kernel
Subject Re: [PATCH] vmcore: replace Elf64_Ehdr/Elf32_Ehdr with elfhdr
Date 2015-09-16 11:40 +0200
Message-ID <q9hm4-uy-27@gated-at.bofh.it> (permalink)
References <q9b6W-8hW-1@gated-at.bofh.it> <q9b6W-8hW-9@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Cc kexec list.

On 09/16/15 at 10:58am, yanjiang.jin@windriver.com wrote:
> From: Yanjiang Jin <yanjiang.jin@windriver.com>
> 
> Function parse_crash_elf_headers() reads e_ident[EI_CLASS] then decides to
> call parse_crash_elf64_headers() or parse_crash_elf32_headers().
> But this happens in run time, not compile time. So compiler will report
> the below warning:
> 
> In file included from include/linux/elf.h:4:0,
>                  from fs/proc/vmcore.c:13:
> fs/proc/vmcore.c: In function 'parse_crash_elf32_headers':
> arch/mips/include/asm/elf.h:258:23: warning: initializatio
> n from incompatible pointer type
>   struct elfhdr *__h = (hdr);     \
>                        ^
> fs/proc/vmcore.c:1071:4: note: in expansion of macro 'elf_
> check_arch'
>    !elf_check_arch(&ehdr) ||
>     ^
> 
> Signed-off-by: Yanjiang Jin <yanjiang.jin@windriver.com>
> ---
>  fs/proc/vmcore.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/fs/proc/vmcore.c b/fs/proc/vmcore.c
> index 4e61388..576bb26 100644
> --- a/fs/proc/vmcore.c
> +++ b/fs/proc/vmcore.c
> @@ -999,7 +999,7 @@ static void free_elfcorebuf(void)
>  static int __init parse_crash_elf64_headers(void)
>  {
>  	int rc=0;
> -	Elf64_Ehdr ehdr;
> +	struct elfhdr ehdr;
>  	u64 addr;
>  
>  	addr = elfcorehdr_addr;
> @@ -1055,7 +1055,7 @@ fail:
>  static int __init parse_crash_elf32_headers(void)
>  {
>  	int rc=0;
> -	Elf32_Ehdr ehdr;
> +	struct elfhdr ehdr;
>  	u64 addr;
>  
>  	addr = elfcorehdr_addr;
> -- 
> 1.9.1
> 
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] vmcore: replace Elf64_Ehdr/Elf32_Ehdr with elfhdr <yanjiang.jin@windriver.com> - 2015-09-16 05:00 +0200
  [PATCH] vmcore: replace Elf64_Ehdr/Elf32_Ehdr with elfhdr <yanjiang.jin@windriver.com> - 2015-09-16 05:00 +0200
    Re: [PATCH] vmcore: replace Elf64_Ehdr/Elf32_Ehdr with elfhdr Dave Young <dyoung@redhat.com> - 2015-09-16 11:40 +0200
    Re: [PATCH] vmcore: replace Elf64_Ehdr/Elf32_Ehdr with elfhdr Minfei Huang <mhuang@redhat.com> - 2015-09-16 12:40 +0200
      Re: [PATCH] vmcore: replace Elf64_Ehdr/Elf32_Ehdr with elfhdr Minfei Huang <mhuang@redhat.com> - 2015-09-16 12:50 +0200
      Re: [PATCH] vmcore: replace Elf64_Ehdr/Elf32_Ehdr with elfhdr yjin <yanjiang.jin@windriver.com> - 2015-09-17 11:40 +0200
        Re: [PATCH] vmcore: replace Elf64_Ehdr/Elf32_Ehdr with elfhdr Minfei Huang <mhuang@redhat.com> - 2015-09-18 07:50 +0200

csiph-web