<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 - [Linker script] reference to a dead section"
href="https://bugs.llvm.org/show_bug.cgi?id=38750">38750</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>[Linker script] reference to a dead section
</td>
</tr>
<tr>
<th>Product</th>
<td>lld
</td>
</tr>
<tr>
<th>Version</th>
<td>unspecified
</td>
</tr>
<tr>
<th>Hardware</th>
<td>All
</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>ELF
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>pshung807@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr></table>
<p>
<div>
<pre>Can lld support the case below?
The expected LMA of .text is 0x80000, but lld generates zero.
LLD discards empty SectionCommands in adjustSectionsBeforeSorting; thus those
empty OutputSection are not assigned address in assignAddress.
This feature is supported by bfd linker.
3 # RUN: llvm-mc -filetype=obj -triple=riscv64- %s -o %t.o
4 # RUN: echo "SECTIONS { \
5 # RUN: . = 0x00080000; \
6 # RUN: .init : { KEEP(*(.init )) } \
7 # RUN:.text : AT(ALIGN(LOADADDR (.init) + SIZEOF (.init),
ALIGNOF(.init))) { *(.text .text.* ) }\
8 # RUN: }" > %t.script
9 # RUN: ld.lld -o %t -T %t.script %t.o
10 # RUN: llvm-readelf -program-headers %t | FileCheck %s
11 .text
12 .global _start
13 _start:
14 nop
15 nop
16 #CHECK: Program Headers:
17 #CHECK: Type Offset VirtAddr PhysAddr
FileSiz MemSiz Flg Align
18 #CHECK-NEXT: LOAD 0x{{[0-9a-fA-F]+}} 0x0000000000080000
0x0000000000080000 0x000008 0x000008 R E 0x10</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>