https://llvm.org/bugs/show_bug.cgi?id=26968
Bug ID: 26968 Summary: i386 lld produces incorrect fatal error "SHF_MERGE section size must be a multiple of sh_entsize" linking FreeBSD/i386 userland Product: lld Version: unspecified Hardware: PC URL: http://reviews.llvm.org/D18222 OS: FreeBSD Status: NEW Severity: normal Priority: P Component: All Bugs Assignee: unassignedb...@nondot.org Reporter: ema...@freebsd.org CC: llvm-bugs@lists.llvm.org Classification: Unclassified lld considers sh_entsize == 0 a fatal error in a SHF_MERGE section. if (!EntSize || Sec.sh_size % EntSize) fatal("SHF_MERGE section size must be a multiple of sh_entsize"); In a FreeBSD/i386 buildworld many objects have SHF_MERGE with sh_entsize == 0, and this shouldn't be a fatal error. At a minimum we can just return false. For reference here is an example readelf -S from one of the objects: /tank/emaste/obj/i386.i386/tank/emaste/src/freebsd/tmp/usr/lib/crt1.o There are 14 section headers, starting at offset 0x68c: Section Headers: [Nr] Name Type Addr Off Size ES Flg Lk Inf Al [ 0] NULL 00000000 000000 000000 00 0 0 0 [ 1] .eh_frame PROGBITS 00000000 000034 000034 00 A 0 0 4 [ 2] .note.tag NOTE 00000000 000068 000030 00 A 0 0 4 [ 3] .rodata PROGBITS 00000000 000098 000001 00 AMS 0 0 1 [ 4] .text PROGBITS 00000000 0000a0 0001aa 00 AX 0 0 16 [ 5] .data PROGBITS 00000000 00024c 000004 00 WA 0 0 4 [ 6] .bss NOBITS 00000000 000250 000004 00 WA 0 0 4 [ 7] .rel.text REL 00000000 000250 0000b8 08 I 12 4 4 [ 8] .comment PROGBITS 00000000 000308 00005d 00 MS 0 0 1 [ 9] .rel.eh_frame REL 00000000 000368 000008 08 I 12 1 4 [10] .rel.data REL 00000000 000370 000008 08 I 12 5 4 [11] .shstrtab STRTAB 00000000 000548 00005d 00 0 0 1 [12] .symtab SYMTAB 00000000 000378 0001d0 10 13 21 4 [13] .strtab STRTAB 00000000 0005a5 0000e5 00 0 0 1 As an aside, it would be useful to have the file name in the error message too. -- 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