<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 - Don't abort printing of dynamic table if dynamic string address is invalid"
href="https://bugs.llvm.org/show_bug.cgi?id=40864">40864</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Don't abort printing of dynamic table if dynamic string address is invalid
</td>
</tr>
<tr>
<th>Product</th>
<td>tools
</td>
</tr>
<tr>
<th>Version</th>
<td>trunk
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>Windows NT
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>enhancement
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>llvm-readobj
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>jh7370.2008@my.bristol.ac.uk
</td>
</tr>
<tr>
<th>CC</th>
<td>jh7370.2008@my.bristol.ac.uk, llvm-bugs@lists.llvm.org
</td>
</tr></table>
<p>
<div>
<pre>This issue is similar to, but not the same as <a class="bz_bug_link
bz_status_NEW "
title="NEW - Don't abort printing of dynamic table if string reference is invalid"
href="show_bug.cgi?id=40807">bug 40807</a>. For the following yaml
input, which contains a DT_STRTAB value pointing well outside the address
space, llvm-readobj aborts with "LLVM ERROR: Virtual address is not in any
segment".
--- !ELF
FileHeader:
Class: ELFCLASS64
Data: ELFDATA2LSB
Type: ET_EXEC
Machine: EM_X86_64
Sections:
- Name: .dynamic
Type: SHT_DYNAMIC
Address: 0x1000
Entries:
- Tag: DT_STRTAB
Value: 0x2000000
- Tag: DT_STRSZ
Value: 10
- Tag: DT_NEEDED
Value: 1
ProgramHeaders:
- Type: PT_LOAD
VAddr: 0x1000
Sections:
- Section: .dynamic
- Type: PT_DYNAMIC
VAddr: 0x1000
Sections:
- Section: .dynamic
Better would be to emit a regular error somewhere and not to attempt lookups.
This is what GNU readelf does:
readelf: Warning: Virtual address 0x2000000 not located in any PT_LOAD segment.
readelf: Error: Unable to determine the length of the dynamic string table
Dynamic section at offset 0x1f0 contains 4 entries:
Tag Type Name/Value
0x0000000000000005 (STRTAB) 0x2000000
0x000000000000000a (STRSZ) 10 (bytes)
0x0000000000000001 (NEEDED) 0x1
0x0000000000000000 (NULL) 0x0
(I don't know why it complains about being unable to determine the legnth of
the dynamic string table).</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>