libabigail/tests/data/test-diff-dwarf/test9-v1.cc
Dodji Seketeli d08e5181f2 Support TLS variables
* src/abg-ir.cc (elf_symbol::is_variable): Accept TLS objects as
	variables too.
	* src/abg-dwarf-reader.cc (eval_last_constant_dwarf_sub_expr)
	(die_location_address): Add an output parameter to say if the
	resulting constant value is a tls address or not.
	(lookup_public_variable_symbol_from_elf): Use the proper
	elf_symbol::is_variable() method, rather than trying to figure out
	the low levels of what a variable is here.  Also, cleanup the
	condition.
	(read_context::load_symbol_maps): Consider symbols of type
	STT_TLS, when loading symbols for variables.  Also, to avoir
	symbols that are for versions, filter out symbols of type
	STT_OBJECT and with a SHN_ABS section index.
	(read_context::get_variable_address): If the address is for a tls
	variable, do no try to adjust the address to arrange for things
	like prelink.  As that doesn't seem to affect TLS variables.
	(dwarf_expr_eval_context::set_tls_addr): New data member.
	(dwarf_expr_eval_context::dwarf_expr_eval_context): Initialize it.
	(dwarf_expr_eval_context::set_tls_address): New accessors.
	(dwarf_expr_eval_context::op_manipulates_stack): Handle
	DW_OP_GNU_push_tls_address, a bit like DW_OP_form_tls_address, but
	then, its result is a constant.  Set the
	dwarf_expr_eval_context::set_tls_addr flag when these two OPs are
	run.
	(die_member_offset): Adjust to the new signature of
	eval_last_constant_dwarf_sub_expr.
	* tests/data/test-diff-dwarf/libtest9-v0.so: New test input.
	* tests/data/test-diff-dwarf/libtest9-v1.so: Likewise.
	* tests/data/test-diff-dwarf/test9-report.txt: Likewise
	* tests/data/test-diff-dwarf/test9-v0.cc: Source code for the
	first input.
	* tests/data/test-diff-dwarf/test9-v1.cc: Source code for the
	second input.
	* tests/test-diff-dwarf.cc: Run this harness on the two new inputs
	above.
	* tests/Makefile.am: Add the new inputs to the source distribution.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2014-08-19 13:50:23 +02:00

10 lines
177 B
C++

// To build this, type:
// g++ -g -Wall -shared -o libtest9-v1.so test9-v1.cc
__thread char global_var0;
__thread int global_var1;
__thread unsigned global_var2;
void
foo()
{
}