The warning "ignoring memory region assignment for non-allocatable section" should be generated under the following conditions:
- sections without SHF_ALLOC attribute and,
- presence of input sections or data commands (ByteCommand)
The goal of the change is to reduce spurious warnings that are generated for some output sections that have no input section.
I think this will also suppress the warning for something like:
Which I note that GNU ld makes SHF_ALLOC but LLD does not, which is a separate issue, but I think we should keep the warning for this case until that can be changed. Perhaps worth warning when the size is non zero or whether the sec contains data generating commands.