[lld] [ELF] Orphan placement: remove hasInputSections condition (PR #93761)

Peter Smith via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 5 08:23:49 PDT 2024


================
@@ -16,22 +16,21 @@
 ## The output file must include all sections.
 # RUN: llvm-readelf -S %t/a.elf | FileCheck %s
 
-# CHECK:      There are 12 section headers, starting at offset 0x2140:
+# CHECK:      There are 12 section headers, starting at offset 0x2138:
 # CHECK:      [Nr] Name         Type      Address          Off    Size   ES Flg Lk Inf Al
 # CHECK-NEXT: [ 0]              NULL      0000000000000000 000000 000000 00     0  0   0
 # CHECK-NEXT: [ 1] .nonalloc    PROGBITS  0000000000000000 001064 001000 00 W   0  0   1
----------------
smithp35 wrote:

I can't comment on the line, this is a forward reference. In the linker script
```
.nonalloc : { *(.nonalloc) } > MEM
```
MEM does not exist, only MEM and MEM1. GNU ld gives a warning in this case
```
ld.bfd:/data_nvme0n1/work/llvm-project/build/tools/lld/test/ELF/linkerscript/Output/memory-nonalloc-no-warn.test.tmp/a.lds:10: warning: memory region `MEM' not declared
```
As a noalloc section MEM may have been intentional, but my guess is that it was a typo.



https://github.com/llvm/llvm-project/pull/93761


More information about the llvm-commits mailing list