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

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 5 10:06:44 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
----------------
MaskRay wrote:

The difference in section header table offsets is due to less alignment padding  by coincidence.

---

> `.nonalloc : { *(.nonalloc) } > MEM`

lld reports `warning: ignoring memory region assignment for non-allocatable section '.nonalloc'`.

lld also supports an error (e.g. `error: memory region 'ram' not declared` for `memory-err.s`) but its precedence is lower than the non-allocatable warning.

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


More information about the llvm-commits mailing list