gdb: fix "optimized out" error with debug fission.

This patch comes from
https://sourceware.org/ml/gdb-patches/2016-04/msg00658.html
The bug entry is
https://sourceware.org/bugzilla/show_bug.cgi?id=19999

This patch fixes symtab/19999.
The problem here is that while we don't want to add the DWARF "base address"
for DWO files (where addresses come from .debug_addr where the base address
has already been added), we still need to add base_offset for PIE.

Regression tested on amd64-linux.

2016-04-29  Doug Evans  <dje@google.com>

	PR symtab/19999
	* dwarf2loc.c (dwarf2_find_location_expression): For DWO files still
	add base_offset.

	testsuite/
	* lib/dwarf.exp (build_executable_from_fission_assembler): Pass
	$options when building executable.
	* gdb.dwarf2/fission-loclists-pie.S: New file.
	* gdb.dwarf2/fission-loclists-pie.exp: New file.

BUG=chromium:439320
TEST=the unittest in the patch passe
4 files changed
tree: 60aeea071dc3742783e9255a53caacaa5c411638
  1. gdb-7.11/
  2. build-gdb.sh
  3. build.py