Skip to contentSkip to conversation

qemu-binfmt-conf.sh: Fix m68k_mask

PATCH In review Andreas Schwab 3 participants 4 messages Mar 21, 2017 – Mar 22, 2017 exec and binfmt

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 qemu-binfmt-conf.sh: Fix m68k_mask

The m68k mask should not remove the low bit of the ELF version field and should ignore the OS/ABI field.

---
 scripts/qemu-binfmt-conf.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/qemu-binfmt-conf.sh +1 -1
index 0f1aa63872..484bcf166e 100755
@@ -47,7 +47,7 @@ ppc64le_mask='\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\x
 ppc64le_family=ppcle
 
 m68k_magic='\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x04'
-m68k_mask='\xff\xff\xff\xff\xff\xff\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff'
+m68k_mask='\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff'
 m68k_family=m68k
 
 # FIXME: We could use the other endianness on a MIPS host.
Signature · 7 lines
2.12.0


-- 
Andreas Schwab, SUSE Labs, [email protected]
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."
#1 lore raw
Quoted 2 lines · Andreas Schwab

The m68k mask should not remove the low bit of the ELF version field and should ignore the OS/ABI field.

Did you encounter a problem with a real binary here? ... then it might be worth to mention it in the patch description and the patch should likely be included into QEMU 2.9. Or is this just cosmetics? ... then it should rather be included in 2.10 later, I think.

Thomas

Quoted 19 lines
---
 scripts/qemu-binfmt-conf.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/qemu-binfmt-conf.sh +1 -1
index 0f1aa63872..484bcf166e 100755
@@ -47,7 +47,7 @@ ppc64le_mask='\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\x
 ppc64le_family=ppcle
 
 m68k_magic='\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x04'
-m68k_mask='\xff\xff\xff\xff\xff\xff\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff'
+m68k_mask='\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff'
 m68k_family=m68k
 
 # FIXME: We could use the other endianness on a MIPS host.
#2 lore raw
Quoted 5 lines · Thomas Huth
Quoted 2 lines · Andreas Schwab

The m68k mask should not remove the low bit of the ELF version field and should ignore the OS/ABI field.

Did you encounter a problem with a real binary here?

Yes, some binaries are using ELFOSABI_GNU instead of ELFOSABI_SYSV. All other patterns already ignore the OS/ABI field.

Andreas.

Signature · 3 lines
Andreas Schwab, SUSE Labs, [email protected]
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."
Reviewed-by
#3 lore raw
Quoted 10 lines · Andreas Schwab
Quoted 5 lines · Thomas Huth
Quoted 2 lines · Andreas Schwab

The m68k mask should not remove the low bit of the ELF version field and should ignore the OS/ABI field.

Did you encounter a problem with a real binary here?

Yes, some binaries are using ELFOSABI_GNU instead of ELFOSABI_SYSV. All other patterns already ignore the OS/ABI field.

Yes, I've also seen this.