1
0
Fork 0
alistair23-linux/arch/mips/boot/tools
Harvey Hunt 828a54287c MIPS: tools: Fix relocs tool compiler warnings
When using clang as HOSTCC, the following warnings appear:

In file included from arch/mips/boot/tools/relocs_64.c:27:0:
arch/mips/boot/tools/relocs.c: In function ‘read_relocs’:
arch/mips/boot/tools/relocs.c:397:4: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
    ELF_R_SYM(rel->r_info) = elf32_to_cpu(ELF_R_SYM(rel->r_info));
    ^~~~~~~~~
arch/mips/boot/tools/relocs.c:397:4: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
arch/mips/boot/tools/relocs.c: In function ‘walk_relocs’:
arch/mips/boot/tools/relocs.c:491:4: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
    Elf_Sym *sym = &sh_symtab[ELF_R_SYM(rel->r_info)];
    ^~~~~~~
arch/mips/boot/tools/relocs.c: In function ‘do_reloc’:
arch/mips/boot/tools/relocs.c:502:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
  unsigned r_type = ELF_R_TYPE(rel->r_info);
  ^~~~~~~~
arch/mips/boot/tools/relocs.c: In function ‘do_reloc_info’:
arch/mips/boot/tools/relocs.c:641:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
   rel_type(ELF_R_TYPE(rel->r_info)),
   ^~~~~~~~

Fix them by making Elf64_Mips_Rela a union

Signed-off-by: Harvey Hunt <harvey.hunt@imgtec.com>
Acked-by: Matt Redfearn <matt.redfearn@imgtec.com>
Cc: linux-mips@linux-mips.org
Cc: linux-kernel@vger.kernel.org
Patchwork: https://patchwork.linux-mips.org/patch/13683/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2016-08-03 09:00:55 +02:00
..
.gitignore MIPS: tools: Build relocs tool 2016-05-13 14:02:02 +02:00
Makefile MIPS: tools: Add relocs tool 2016-05-13 14:02:01 +02:00
relocs.c MIPS: tools: Add relocs tool 2016-05-13 14:02:01 +02:00
relocs.h MIPS: tools: Add relocs tool 2016-05-13 14:02:01 +02:00
relocs_32.c MIPS: tools: Add relocs tool 2016-05-13 14:02:01 +02:00
relocs_64.c MIPS: tools: Fix relocs tool compiler warnings 2016-08-03 09:00:55 +02:00
relocs_main.c MIPS: tools: Add relocs tool 2016-05-13 14:02:01 +02:00