Commit 689b53da authored by Michael Spang's avatar Michael Spang
Browse files

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
parent a7e49fd0
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment