This continues direction shown in D43069.
I suggest to keep sections that are explicitly assigned to segment in script.
With that code can be simplified (as shown in diff).
Also with that it might be possible to get rid of Live flag of output section (if we want).