https://llvm.org/bugs/show_bug.cgi?id=31678
Bug ID: 31678 Summary: [ELF] - Incompatible emulation should not lead to error Product: lld Version: unspecified Hardware: PC OS: Linux Status: NEW Severity: normal Priority: P Component: ELF Assignee: unassignedb...@nondot.org Reporter: gri...@accesssoftek.com CC: llvm-bugs@lists.llvm.org Classification: Unclassified Created attachment 17853 --> https://llvm.org/bugs/attachment.cgi?id=17853&action=edit reproduce I found that when tried to link "arch/x86/realmode/rm" component of linux kernel, LLD reports: ld: arch/x86/realmode/rm/header.o is incompatible with elf_x86_64 ld: error: arch/x86/realmode/rm/header.o is incompatible with elf_x86_64 ld: arch/x86/realmode/rm/trampoline_64.o is incompatible with elf_x86_64 All objects are i386, but invocation contains -m elf_x86_64 and we report a error. That does not seem to be correct. I found some description here: http://stackoverflow.com/questions/38951492/linkers-emulation-vs-output-format And performed a test. Linked reproduce using bfd with -m elf_x86_64 and -m i386. Both runs successfully output a "Intel 80386" binary. Segments have different offset/alignment though: -m elf_x86_64: Program Headers: Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align LOAD 0x200000 0x00000000 0x00000000 0x05258 0x05258 RWE 0x200000 GNU_STACK 0x000000 0x00000000 0x00000000 0x00000 0x00000 RWE 0x10 -m i386: Program Headers: Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align LOAD 0x001000 0x00000000 0x00000000 0x05258 0x05258 RWE 0x1000 GNU_STACK 0x000000 0x00000000 0x00000000 0x00000 0x00000 RWE 0x10 So -m affects on some constants and should not emit error in this case. I am going to investigate it more and fix. Comments are welcome. -- You are receiving this mail because: You are on the CC list for the bug.
_______________________________________________ llvm-bugs mailing list llvm-bugs@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs