This patch changes segment size, when last section in the segment is removed. Segment also can be removed completely when it doesn't contain section (such behavior differs from GNU objcopy which leaves empty segment with warning).
This patch changes way section and segment layout is calculated and is a base for --update-section, --pad-to and few other options.