[BACKPORT] Avoid a report_fatal_error in sections().

Have it return a ErrorOr<Range> and delete section_begin and
section_end.

Backported from upstream revision r285807.

Test: presubmit
Bug: 161717501
Change-Id: I575b298f2aaf5bf8d2443d95dcf5817dd0a5b724
6 files changed