[SLOF] sloffs: tool to read and write SLOF images

Thomas Huth thuth at redhat.com
Thu Jun 16 05:36:13 AEST 2016


On 15.06.2016 10:29, Adrian Reber wrote:
> This brings the sloffs code to read, copy and append files to an existing
> boot_rom.bin from my repository at https://lisas.de/~adrian/slof/slof.git/ .
> 
> This code was written in 2008 and all patches have been cherry-picked
> without modifications. Only the last patch (13/13) updates the code
> to work with today's compilers.

Cool, thanks for posting it! I also gave it a try, and it works for me 
fine with the current boot_rom.bin images, too.

However, I still get some compiler warnings here (gcc 4.8.5):

sloffs.c: In function ‘sloffs_dump’:
sloffs.c:434:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
  if (be64_to_cpu(*(uint64_t *)header->date)) {
  ^
sloffs.c:435:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
   printf("%04x", be16_to_cpu(*(uint16_t *)(header->date + 2)));
   ^
sloffs.c:445:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
  if (be64_to_cpu(*(uint64_t *)header->mdate)) {
  ^
sloffs.c:446:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
   printf("%04x", be16_to_cpu(*(uint16_t *)(header->mdate + 2)));
   ^

We already changed most Makefiles of SLOF to use -fno-strict-aliasing,
so we should maybe use that for tools/Makefile, too - or simply
fix the aliasing problems ;-)

 Thomas



More information about the SLOF mailing list