https://bugs.llvm.org/show_bug.cgi?id=44683
Bug ID: 44683
Summary: file_magic identifies file with two leading null bytes
as a COFF object
Product: libraries
Version: trunk
Hardware: PC
OS: Linux
Status: NEW
Severity: enhancement
Priority: P
Component: Object
Assignee: unassignedb...@nondot.org
Reporter: s...@chromium.org
CC: llvm-bugs@lists.llvm.org
This is because the first two bytes of COFF is the machine type and machine
type 0 is IMAGE_FILE_MACHINE_UNKNOWN.
See:
https://docs.microsoft.com/en-us/windows/win32/debug/pe-format#machine-types
Is is a minor annoyance when dealing with rust archives because rust archives
because they seem to include a rust metadata file .. which means running
llvm-nm on them always generates a strange error such as:
`llvm-nm: error: libtest.a(rust.metadata.bin) The end of the file was
unexpectedly encountered
`
llvm-nm ignores non-object files but it thinks this file is a COFF object
becasue the file starts with bunch of leading zeros.
I think we can perhaps modify file_magic to be a little less eager when
identifying COFF objects.
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs