binutils-gdb/gdb/testsuite/gdb.threads
Jan Kratochvil fbd1b77155 Fix accessing TLS variables with no debug info
Since 2273f0ac95 ("change minsyms not to be relocated at
read-time"), printing TLS symbols of objfiles with a non-zero base
address, without debug info, fails.

E.g., with:

 $ mv /usr/lib/debug /usr/lib/debug-x

to get debug info out of the way, we get:

 $ echo 'int main(){}' | gcc -pthread -x c -
 $ ./gdb -q -ex start -ex 'p (int) errno' ./a.out
 Cannot access memory at address 0xffffef7c0698

instead of the expected:

 $1 = 0

The regression is not visible with glibc debuginfo installed.

The problem is that we compute the address of TLS minsyms incorrectly.

To trigger the problem, it is important that the variable is in an
objfile with a non-zero base address.  While glibc is a shared library
for 'errno', it's easier for the testcase to use PIE instead of a
shlib.  For TLS variables in PT_EXEC the regression obviously does not
happen.

gdb/ChangeLog
2017-09-06  Jan Kratochvil  <jan.kratochvil@redhat.com>

	* parse.c (find_minsym_type_and_address): Don't relocate addresses
	of TLS symbols.

gdb/testsuite/ChangeLog
2017-09-06  Jan Kratochvil  <jan.kratochvil@redhat.com>

	* gdb.threads/tls-nodebug-pie.c: New file.
	* gdb.threads/tls-nodebug-pie.exp: New file.
2017-09-06 12:32:46 +01:00
..
attach-into-signal.c update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
attach-into-signal.exp update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
attach-many-short-lived-threads.c update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
attach-many-short-lived-threads.exp testsuite: Introduce dejagnu_version 2017-03-13 18:02:07 -04:00
attach-stopped.c update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
attach-stopped.exp update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
bp_in_thread.c update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
bp_in_thread.exp update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
break-while-running.c update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
break-while-running.exp update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
clone-attach-detach.c update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
clone-attach-detach.exp update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
clone-new-thread-event.c update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
clone-new-thread-event.exp update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
clone-thread_db.c update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
clone-thread_db.exp update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
continue-pending-after-query.c update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
continue-pending-after-query.exp update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
continue-pending-status.c update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
continue-pending-status.exp update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
corethreads.c update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
corethreads.exp update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
create-fail.c update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
create-fail.exp update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
current-lwp-dead.c update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
current-lwp-dead.exp update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
dlopen-libpthread-lib.c update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
dlopen-libpthread.c update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
dlopen-libpthread.exp update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
execl.c update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
execl.exp update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
execl1.c update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
fork-child-threads.c update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
fork-child-threads.exp update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
fork-plus-threads.c update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
fork-plus-threads.exp update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
fork-thread-pending.c update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
fork-thread-pending.exp update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
forking-threads-plus-breakpoint.c update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
forking-threads-plus-breakpoint.exp update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
gcore-stale-thread.c update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
gcore-stale-thread.exp update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
gcore-thread.exp update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
hand-call-in-threads.c update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
hand-call-in-threads.exp update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
hand-call-new-thread.c update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
hand-call-new-thread.exp update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
ia64-sigill.c update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
ia64-sigill.exp update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
info-threads-cur-sal-2.c update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
info-threads-cur-sal.c update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
info-threads-cur-sal.exp update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
interrupt-while-step-over.c Fix PR18360 - internal error when using "interrupt -a" 2017-03-08 18:54:34 +00:00
interrupt-while-step-over.exp Fix PR18360 - internal error when using "interrupt -a" 2017-03-08 18:54:34 +00:00
interrupted-hand-call.c update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
interrupted-hand-call.exp update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
kill.c update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
kill.exp update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
killed.c update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
killed.exp update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
leader-exit.c update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
leader-exit.exp update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
linux-dp.c Remove testsuite compile errors with GCC5. 2015-01-25 18:50:56 +01:00
linux-dp.exp update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
local-watch-wrong-thread.c update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
local-watch-wrong-thread.exp update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
manythreads.c update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
manythreads.exp update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
multi-create-ns-info-thr.exp update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
multi-create.c update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
multi-create.exp update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
multiple-step-overs.c update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
multiple-step-overs.exp update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
names.c update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
names.exp update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
next-bp-other-thread.c update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
next-bp-other-thread.exp update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
next-while-other-thread-longjmps.c update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
next-while-other-thread-longjmps.exp update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
no-unwaited-for-left.c update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
no-unwaited-for-left.exp update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
non-ldr-exc-1.c update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
non-ldr-exc-1.exp update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
non-ldr-exc-2.c update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
non-ldr-exc-2.exp update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
non-ldr-exc-3.c update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
non-ldr-exc-3.exp update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
non-ldr-exc-4.c update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
non-ldr-exc-4.exp update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
non-ldr-exit.c update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
non-ldr-exit.exp update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
non-stop-fair-events.c update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
non-stop-fair-events.exp update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
pending-step.c update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
pending-step.exp update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
print-threads.c
print-threads.exp update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
process-dies-while-detaching.c update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
process-dies-while-detaching.exp update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
process-dies-while-handling-bp.c update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
process-dies-while-handling-bp.exp update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
pthread_cond_wait.c update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
pthread_cond_wait.exp update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
pthreads.c update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
pthreads.exp update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
queue-signal.c update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
queue-signal.exp update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
reconnect-signal.c update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
reconnect-signal.exp update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
schedlock.c update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
schedlock.exp update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
siginfo-threads.c update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
siginfo-threads.exp Stop assuming no-debug-info functions return int 2017-09-04 20:21:13 +01:00
signal-command-handle-nopass.c update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
signal-command-handle-nopass.exp update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
signal-command-multiple-signals-pending.c update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
signal-command-multiple-signals-pending.exp update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
signal-delivered-right-thread.c update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
signal-delivered-right-thread.exp update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
signal-sigtrap.c update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
signal-sigtrap.exp update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
signal-while-stepping-over-bp-other-thread.c update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
signal-while-stepping-over-bp-other-thread.exp Fix PR18360 - internal error when using "interrupt -a" 2017-03-08 18:54:34 +00:00
sigstep-threads.c update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
sigstep-threads.exp update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
sigthread.c
sigthread.exp update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
staticthreads.c update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
staticthreads.exp update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
step-bg-decr-pc-switch-thread.c update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
step-bg-decr-pc-switch-thread.exp update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
step-over-lands-on-breakpoint.c update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
step-over-lands-on-breakpoint.exp update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
step-over-trips-on-watchpoint.c update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
step-over-trips-on-watchpoint.exp update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
stepi-random-signal.c update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
stepi-random-signal.exp update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
switch-threads.c update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
switch-threads.exp update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
thread-execl.c update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
thread-execl.exp update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
thread-find.exp update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
thread-specific-bp.c update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
thread-specific-bp.exp Fix racy test in gdb.threads/thread-specific-bp.exp 2017-04-05 14:46:13 +01:00
thread-specific.c update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
thread-specific.exp update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
thread-unwindonsignal.exp update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
thread_check.c update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
thread_check.exp update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
thread_events.c update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
thread_events.exp update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
threadapply.c update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
threadapply.exp Fix removing inferiors from within "thread apply" commands 2017-04-19 13:12:23 +01:00
threxit-hop-specific.c update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
threxit-hop-specific.exp update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
tid-reuse.c update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
tid-reuse.exp update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
tls-main.c Remove testsuite compile errors with GCC5. 2015-01-25 18:50:56 +01:00
tls-nodebug-pie.c Fix accessing TLS variables with no debug info 2017-09-06 12:32:46 +01:00
tls-nodebug-pie.exp Fix accessing TLS variables with no debug info 2017-09-06 12:32:46 +01:00
tls-nodebug.c
tls-nodebug.exp Stop assuming no-debug-info variables have type int 2017-09-04 20:21:15 +01:00
tls-shared.c
tls-shared.exp update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
tls-so_extern.c update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
tls-so_extern.exp update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
tls-so_extern_main.c update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
tls-var-main.c update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
tls-var.c update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
tls-var.exp update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
tls.c
tls.exp update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
tls2.c update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
watchpoint-fork-child.c update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
watchpoint-fork-mt.c update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
watchpoint-fork-parent.c update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
watchpoint-fork-st.c update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
watchpoint-fork.exp update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
watchpoint-fork.h update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
watchthreads-reorder.c update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
watchthreads-reorder.exp update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
watchthreads.c update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
watchthreads.exp update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
watchthreads2.c update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
watchthreads2.exp update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
wp-replication.c update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
wp-replication.exp update copyright year range in GDB files 2017-01-01 10:52:34 +04:00