<html>
<head>
<base href="https://bugs.llvm.org/">
</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 - objcopy zero-size section, huge binaries"
href="https://bugs.llvm.org/show_bug.cgi?id=46299">46299</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>objcopy zero-size section, huge binaries
</td>
</tr>
<tr>
<th>Product</th>
<td>tools
</td>
</tr>
<tr>
<th>Version</th>
<td>10.0
</td>
</tr>
<tr>
<th>Hardware</th>
<td>Other
</td>
</tr>
<tr>
<th>OS</th>
<td>other
</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>llvm-objcopy/strip
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>vincent.hamp@higaski.at
</td>
</tr>
<tr>
<th>CC</th>
<td>alexander.v.shaposhnikov@gmail.com, jake.h.ehrlich@gmail.com, jh7370.2008@my.bristol.ac.uk, llvm-bugs@lists.llvm.org, rupprecht@google.com
</td>
</tr></table>
<p>
<div>
<pre>I'm expecting objcopy to create a binary from the attached ELF like this:
llvm-objcopy A.elf -O binary A.bin
Running size tells me that the binary should have 824B, yet the file I get is
384MB big.
Using readelf -e A.elf to inspect the section headers I can see that there is a
suspicious NULL section at the very beginning which is absolutely empty. Could
this be the reason why the binary gets so bloated?
Section Headers:
[Nr] Name Type Addr Off Size ES Flg Lk Inf
Al
[ 0] NULL 00000000 000000 000000 00 0 0
0
[ 1] .vector_table PROGBITS 08000000 001000 000010 00 A 0 0
4
[ 2] .version PROGBITS 08000010 001010 000010 00 A 0 0
1
[ 3] .text PROGBITS 08000020 001020 000308 00 AX 0 0
4
[ 4] .rodata PROGBITS 08000328 001328 000000 00 AX 0 0
1
[ 5] .ARM.exidx ARM_EXIDX 08000328 001328 000010 00 AL 3 0
4
[ 6] .preinit_array PROGBITS 08000338 001338 000000 00 A 0 0
1
[ 7] .init_array INIT_ARRAY 08000338 001338 000004 04 WA 0 0
4
[ 8] .fini_array FINI_ARRAY 0800033c 00133c 000004 04 WA 0 0
4
[ 9] .data PROGBITS 20000000 002000 000000 00 WA 0 0
1
[10] .data2 PROGBITS 10000000 002000 000000 00 WA 0 0
1
[11] .bss NOBITS 20000000 002000 0001ac 00 WA 0 0
512
[12] ._user_heap_stack PROGBITS 200001ac 002000 000e04 00 WA 0 0
1
[13] .ARM.attributes ARM_ATTRIBUTES 00000000 002e04 000049 00 0 0
1
[14] .debug_str PROGBITS 00000000 002e4d 004795 01 MS 0 0
1
[15] .debug_loc PROGBITS 00000000 0075e2 001709 00 0 0
1
[16] .debug_abbrev PROGBITS 00000000 008ceb 000d43 00 0 0
1
[17] .debug_info PROGBITS 00000000 009a2e 00a9f9 00 0 0
1
[18] .debug_ranges PROGBITS 00000000 014427 000148 00 0 0
1
[19] .comment PROGBITS 00000000 01456f 00002a 01 MS 0 0
1
[20] .debug_frame PROGBITS 00000000 01459c 00065c 00 0 0
4
[21] .debug_line PROGBITS 00000000 014bf8 0012bb 00 0 0
1
[22] .symtab SYMTAB 00000000 015eb4 000690 10 24 60
4
[23] .shstrtab STRTAB 00000000 016544 000106 00 0 0
1
[24] .strtab STRTAB 00000000 01664a 0004b5 00 0 0
1</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>