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

This patch comes from
The bug entry is

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  <>

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

	* 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.

TEST=the unittest in the patch passe
4 files changed
tree: 60aeea071dc3742783e9255a53caacaa5c411638
  3. gdb-7.11/