<html>
<head>
<base href="https://llvm.org/bugs/" />
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW --- - i386 lld produces incorrect fatal error "SHF_MERGE section size must be a multiple of sh_entsize" linking FreeBSD/i386 userland"
href="https://llvm.org/bugs/show_bug.cgi?id=26968">26968</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>i386 lld produces incorrect fatal error "SHF_MERGE section size must be a multiple of sh_entsize" linking FreeBSD/i386 userland
</td>
</tr>
<tr>
<th>Product</th>
<td>lld
</td>
</tr>
<tr>
<th>Version</th>
<td>unspecified
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>URL</th>
<td>http://reviews.llvm.org/D18222
</td>
</tr>
<tr>
<th>OS</th>
<td>FreeBSD
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>All Bugs
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>emaste@freebsd.org
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>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.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>