Android NDK r19 Beta 1 (build 5106443)
Fix debugging of stripped PIE executables with padded PT_TLS

Certain PIE executables produced by gold cannot be debugged by gdb after
being stripped. GDB requires program headers of PIE executables to match,
and those checks may fail due to adjustments made during stripping.

One case of this occurs because strip recomputes the memsz of PT_TLS and
does not add alignment, while gold does. This is another variant of PR
11786, so apply the same fix of relaxing the program header matching.

gdb/ChangeLog:

	PR gdb/11786
	* solib-svr4.c (svr4_exec_displacement): Ignore memsz fields
	for PT_TLS segments.

gdb/testsuite/ChangeLog:

	PR gdb/11786
	* gdb.base/gcore-tls-pie.c: New file.
	* gdb.base/gcore-tls-pie.exp: New file.

(cherry picked from commit be2d111a878e1422c921226bc7714131a5c470fa)

Change-Id: I33ea8f871d74f8822f5c836c1edcafb53cfc7beb
6 files changed
tree: c1f3c6004da548ee3c393ae32d9ecaa6dafdd478
  1. gdb-7.11/
  2. gdb-8.0.1/
  3. build-gdb.sh
  4. build.py