On 1/7/19 3:34 PM, John Paul Adrian Glaubitz wrote: > According to the build log, the affected image is "boot.img": > > if test x0 = x1; then ../grub-macho2img boot.image boot.img; else objcopy > -O a.out-sunos-big --strip-unneeded -R .note -R .comment -R > .note.gnu.build-id -R .MIPS.abiflags -R .reginfo -R .rel.dyn -R > .note.gnu.gold-version -R .ARM.exidx boot.image boot.img; fi > objcopy:boot.img: invalid bfd target > > And looking the output of file, it seems that boot.img (and some other images) > is indeed not ELF: > > glaubitz@kyoto:~$ file /usr/lib/grub/sparc64-ieee1275/boot.img > /usr/lib/grub/sparc64-ieee1275/boot.img: SPARC executable > glaubitz@kyoto:~$ file /usr/lib/grub/sparc64-ieee1275/cdboot.img > /usr/lib/grub/sparc64-ieee1275/cdboot.img: SPARC executable > glaubitz@kyoto:~$ file /usr/lib/grub/sparc64-ieee1275/diskboot.img > /usr/lib/grub/sparc64-ieee1275/diskboot.img: data > glaubitz@kyoto:~$ > > These images should be of ELF type on your machine. Some more comparision:
glaubitz@kyoto:~/grub-debian/test$ find . -name "*.img" -exec file {} \; ./usr/lib/grub/sparc64-ieee1275/diskboot.img: data ./usr/lib/grub/sparc64-ieee1275/cdboot.img: data ./usr/lib/grub/sparc64-ieee1275/kernel.img: ELF 64-bit MSB executable, SPARC V9, relaxed memory ordering, version 1 (SYSV), statically linked, stripped ./usr/lib/grub/sparc64-ieee1275/boot.img: data glaubitz@kyoto:~/grub-debian/test$ find /usr/lib/grub/sparc64-ieee1275/ -name "*.img" -exec file {} \; /usr/lib/grub/sparc64-ieee1275/diskboot.img: data /usr/lib/grub/sparc64-ieee1275/cdboot.img: SPARC executable /usr/lib/grub/sparc64-ieee1275/kernel.img: ELF 64-bit MSB executable, SPARC V9, relaxed memory ordering, version 1 (SYSV), statically linked, stripped /usr/lib/grub/sparc64-ieee1275/boot.img: SPARC executable glaubitz@kyoto:~/grub-debian/test$ diff -u ./usr/lib/grub/sparc64-ieee1275/diskboot.img /usr/lib/grub/sparc64-ieee1275/diskboot.img glaubitz@kyoto:~/grub-debian/test$ diff -u ./usr/lib/grub/sparc64-ieee1275/cdboot.img /usr/lib/grub/sparc64-ieee1275/cdboot.img Binary files ./usr/lib/grub/sparc64-ieee1275/cdboot.img and /usr/lib/grub/sparc64-ieee1275/cdboot.img differ glaubitz@kyoto:~/grub-debian/test$ diff -u ./usr/lib/grub/sparc64-ieee1275/kernel.img /usr/lib/grub/sparc64-ieee1275/kernel.img Binary files ./usr/lib/grub/sparc64-ieee1275/kernel.img and /usr/lib/grub/sparc64-ieee1275/kernel.img differ glaubitz@kyoto:~/grub-debian/test$ diff -u ./usr/lib/grub/sparc64-ieee1275/cdboot.img /usr/lib/grub/sparc64-ieee1275/cdboot.img Binary files ./usr/lib/grub/sparc64-ieee1275/cdboot.img and /usr/lib/grub/sparc64-ieee1275/cdboot.img differ glaubitz@kyoto:~/grub-debian/test$ And with the help of xxd: glaubitz@kyoto:~/grub-debian/test$ diff -u ~/grub-boot-old.diff ~/grub-boot-new.diff --- /home/glaubitz/grub-boot-old.diff 2019-01-07 15:40:01.075758523 +0100 +++ /home/glaubitz/grub-boot-new.diff 2019-01-07 15:39:56.383751925 +0100 @@ -1,32 +1,30 @@ -00000000: 0103 0107 0000 01e0 0000 0000 0000 0000 ................ -00000010: 0000 0000 0000 4000 0000 0000 0000 0000 ......@......... -00000020: 4000 0051 a010 000c 0000 0000 0000 0000 @..Q............ +00000000: 4000 0051 a010 000c 0000 0000 0000 0000 @..Q............ +00000010: 0000 0000 0000 0000 0000 0000 0000 0000 ................ +00000020: 0000 0000 0000 0000 0000 0000 0000 0000 ................ 00000030: 0000 0000 0000 0000 0000 0000 0000 0000 ................ 00000040: 0000 0000 0000 0000 0000 0000 0000 0000 ................ 00000050: 0000 0000 0000 0000 0000 0000 0000 0000 ................ 00000060: 0000 0000 0000 0000 0000 0000 0000 0000 ................ 00000070: 0000 0000 0000 0000 0000 0000 0000 0000 ................ -00000080: 0000 0000 0000 0000 0000 0000 0000 0000 ................ -00000090: 0000 0000 0000 0000 0000 0000 0000 0000 ................ -000000a0: 0000 0000 0000 0400 0000 4200 6669 6e64 ..........B.find -000000b0: 6465 7669 6365 002f 6368 6f73 656e 0067 device./chosen.g -000000c0: 6574 7072 6f70 0073 7464 6f75 7400 7772 etprop.stdout.wr -000000d0: 6974 6500 626f 6f74 7061 7468 006f 7065 ite.bootpath.ope -000000e0: 6e00 7365 656b 0072 6561 6400 6578 6974 n.seek.read.exit -000000f0: 0047 5255 4220 0000 9405 e0bd 4000 000d .GRUB ......@... -00000100: 9610 2004 9005 e0cc 9410 0000 1080 000c .. ............. -00000110: 8210 2001 8210 2004 c274 6100 9210 0014 .. ... ..ta..... -00000120: 1080 0007 9005 e09f 1080 0004 9210 0016 ................ -00000130: 9005 e0ae 9210 0015 8210 2003 9a10 2001 .......... ... . -00000140: d074 6000 c274 6008 da74 6010 d274 6018 .t`..t`..t`..t`. -00000150: d474 6020 d674 6028 d874 6030 81c4 0000 .t` .t`(.t`0.... -00000160: 9010 0011 ae10 000f 2300 0014 9005 e08c ........#....... -00000170: 7fff ffe6 9205 e097 e85c 6020 02fd 3fe2 .........\` ..?. -00000180: 9405 e0a7 9604 6100 7fff ffe3 9810 2400 ......a.......$. -00000190: ea04 6100 02f5 7fdc 9405 e0d1 7fff ffe5 ..a............. -000001a0: 9610 2005 9605 e008 d20a c000 0ac2 4004 .. ...........@. -000001b0: 9405 e0b4 7fff ffd8 9810 2078 9005 e0bd .......... x.... -000001c0: 7fff ffd2 9205 e008 ec5c 6020 02f5 bfcb .........\` .... -000001d0: 9005 e0c2 9410 0000 7fff ffd4 d65d e080 .............].. -000001e0: 9005 e0c7 d405 e088 7fff ffd0 9610 2200 ..............". -000001f0: d405 e088 9fc2 8000 0100 0000 bb44 aa55 .............D.U +00000080: 0000 0000 0000 0400 0000 4200 6669 6e64 ..........B.find +00000090: 6465 7669 6365 002f 6368 6f73 656e 0067 device./chosen.g +000000a0: 6574 7072 6f70 0073 7464 6f75 7400 7772 etprop.stdout.wr +000000b0: 6974 6500 626f 6f74 7061 7468 006f 7065 ite.bootpath.ope +000000c0: 6e00 7365 656b 0072 6561 6400 6578 6974 n.seek.read.exit +000000d0: 0047 5255 4220 0000 9405 e0bd 4000 000d .GRUB ......@... +000000e0: 9610 2004 9005 e0cc 9410 0000 1080 000c .. ............. +000000f0: 8210 2001 8210 2004 c274 6100 9210 0014 .. ... ..ta..... +00000100: 1080 0007 9005 e09f 1080 0004 9210 0016 ................ +00000110: 9005 e0ae 9210 0015 8210 2003 9a10 2001 .......... ... . +00000120: d074 6000 c274 6008 da74 6010 d274 6018 .t`..t`..t`..t`. +00000130: d474 6020 d674 6028 d874 6030 81c4 0000 .t` .t`(.t`0.... +00000140: 9010 0011 ae10 000f 2300 0014 9005 e08c ........#....... +00000150: 7fff ffe6 9205 e097 e85c 6020 02fd 3fe2 .........\` ..?. +00000160: 9405 e0a7 9604 6100 7fff ffe3 9810 2400 ......a.......$. +00000170: ea04 6100 02f5 7fdc 9405 e0d1 7fff ffe5 ..a............. +00000180: 9610 2005 9605 e008 d20a c000 0ac2 4004 .. ...........@. +00000190: 9405 e0b4 7fff ffd8 9810 2078 9005 e0bd .......... x.... +000001a0: 7fff ffd2 9205 e008 ec5c 6020 02f5 bfcb .........\` .... +000001b0: 9005 e0c2 9410 0000 7fff ffd4 d65d e080 .............].. +000001c0: 9005 e0c7 d405 e088 7fff ffd0 9610 2200 ..............". +000001d0: d405 e088 9fc2 8000 0100 0000 bb44 aa55 .............D.U glaubitz@kyoto:~/grub-debian/test$ I guess I need to modify the linker flags to explicitly create the images as ELF. Adrian -- .''`. John Paul Adrian Glaubitz : :' : Debian Developer - glaub...@debian.org `. `' Freie Universitaet Berlin - glaub...@physik.fu-berlin.de `- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913