<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 --- - Try to better optimize .eh_frame"
href="https://llvm.org/bugs/show_bug.cgi?id=25942">25942</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Try to better optimize .eh_frame
</td>
</tr>
<tr>
<th>Product</th>
<td>new-bugs
</td>
</tr>
<tr>
<th>Version</th>
<td>unspecified
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>Linux
</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>new bugs
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>rafael.espindola@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>grimar@accesssoftek.com, llvm-bugs@lists.llvm.org, ruiu@google.com
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>The .eh_frame sections that MC produces always have an alignment of 8. This is
some because
* Some .eh_frame sections can actually require such alignment (they have a 8
byte pointer).
* A 32 bit zero after a FDE/CIE is interpreted as a terminator.
The net result is that a simple linker might add padding when concatenating a
.eh_frame section with alignment of 8 if it follows one that is not a multiple
of 8 bytes.
To make sure every .eh_frame is a multiple of 8 bytes, we use
EmitValueToAlignment which sets the section alignment.
This solves the problem for simple linkers, but causes problem for linker that
optimize .eh_frame. Now they don't know the alignment requirement of each
cie/fde and have to compensate for it, sometimes making the output .eh_frame
section larger than with a simple linker :-(
It might be possible to do better. Some options
* Assume that all linkers these days process .eh_frame specially and don't pad
the last FDE to make the section a multiple of 8 bytes.
* Still make it a multiple of 8 bytes, but be careful to not increase the
section alignment.
With that lld could then remember the alignment of each fde/cie.</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>