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.