[ELF] Do not try to assign a memory region to a non-allocatable section
authorIgor Kudrin <ikudrin@accesssoftek.com>
Mon, 15 Nov 2021 08:59:39 +0000 (15:59 +0700)
committerIgor Kudrin <ikudrin@accesssoftek.com>
Mon, 15 Nov 2021 08:59:39 +0000 (15:59 +0700)
commit66691de94cd7b7b5d2d9ae1d12e99259a8eae5b1
tree15959fd5c457af5692addf44c9ddea8225ec15d6
parent7cf887b9501ea90f9890dad8127d1404c6e34f94
[ELF] Do not try to assign a memory region to a non-allocatable section

Non-allocatable sections are not part of the memory image of the
program, so there is no need to find memory regions for them either
matching properties or handling explicit assignments. The early test
and return help to simplify LinkerScript::findMemoryRegion() a bit.

Differential Revision: https://reviews.llvm.org/D113768
lld/ELF/LinkerScript.cpp
lld/test/ELF/linkerscript/memory-nonalloc.test [new file with mode: 0644]