PT_LOAD and PT_GNU_RELRO segment overlap

Commit 325ba6fb34 excluded degenerate zero length PT_LOAD segments,
but that only fixed part of the problem, which was that the load
segment limits were not calculated properly.

PR 22845
* elf.c (IS_TBSS): Define.
(_bfd_elf_map_sections_to_segments): Use IS_TBSS.
(assign_file_positions_for_non_load_sections): Revert last change.
Properly calculate load segment limits to compare against relro limits.

This change is backport of dbc88fc14992c556b94e77de563a8f7abcb0b653
  - https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=dbc88fc14992c556b94e77de563a8f7abcb0b653
to binutils-2.27.

Bug: http://b/135627985

Change-Id: I793d6b1c8082bef1b1c46662d194790d5e7d7577
1 file changed
tree: c87788ca9c2732637baaf5cc9db30e8e630be9dd
  1. binutils-2.27/
  2. build.py
  3. do_build.py
  4. OWNERS
  5. pylintrc