libabigail/tests/data/test-read-write/test27.xml
Dodji Seketeli a7492fea56 Support ELF symbol visibility property
This patch models the ELF symbol visibility property and support
ignoring function and variable symbols that are HIDDEN and INTERNAL,
even if they have default binding.

	* include/abg-ir.h (enum elf_symbol::visibility): Define new enum.
	(elf_symbol::{elf_symbol, create}): Take a visibility parameter.
	(elf_symbol::{set, get}_visibility): Declare new accessors.
	(string_to_elf_symbol_binding): Declare new function.
	* src/abg-ir.cc (elf_symbol::priv::visibility_): New data member.
	(elf_symbol::priv::priv): Adjust.
	(elf_symbol::elf_symbol): Take a visibility parameter.
	(elf_symbol::create): Likewise
	(elf_symbol::{s,g}et_visibility): Define new accessors.
	(elf_symbol::is_public): Adjust.
	(operator<<(std::ostream&, elf_symbol::visibility)): Define new
	operator.
	(string_to_elf_symbol_visibility): Define new function.
	* src/abg-dwarf-reader.cc (stv_to_elf_symbol_visibility): Define
	new static function.
	(lookup_symbol_from_sysv_hash_tab)
	(lookup_symbol_from_gnu_hash_tab, lookup_symbol_from_symtab)
	(create_default_var_sym, create_default_fn_sym): Adjust.
	* src/abg-reader.cc (read_elf_symbol_binding): Define new
	function.
	(build_elf_symbol): Adjust.
	* src/abg-writer.cc (write_elf_symbol_visibility): Define new
	function.
	* tests/data/test-annotate/libtest23.so.abi: Adjust.
	* tests/data/test-annotate/libtest24-drop-fns-2.so.abi: Adjust.
	* tests/data/test-annotate/libtest24-drop-fns.so.abi: Adjust.
	* tests/data/test-annotate/test0.abi: Adjust.
	* tests/data/test-annotate/test1.abi: Adjust.
	* tests/data/test-annotate/test13-pr18894.so.abi: Adjust.
	* tests/data/test-annotate/test14-pr18893.so.abi: Adjust.
	* tests/data/test-annotate/test15-pr18892.so.abi: Adjust.
	* tests/data/test-annotate/test17-pr19027.so.abi: Adjust.
	* tests/data/test-annotate/test18-pr19037-libvtkRenderingLIC-6.1.so.abi:
	Adjust.
	* tests/data/test-annotate/test19-pr19023-libtcmalloc_and_profiler.so.abi:
	Adjust.
	* tests/data/test-annotate/test2.so.abi: Adjust.
	* tests/data/test-annotate/test20-pr19025-libvtkParallelCore-6.1.so.abi:
	Adjust.
	* tests/data/test-annotate/test21-pr19092.so.abi: Adjust.
	* tests/data/test-annotate/test3.so.abi: Adjust.
	* tests/data/test-annotate/test4.so.abi: Adjust.
	* tests/data/test-annotate/test5.o.abi: Adjust.
	* tests/data/test-annotate/test6.so.abi: Adjust.
	* tests/data/test-annotate/test7.so.abi: Adjust.
	* tests/data/test-annotate/test8-qualified-this-pointer.so.abi:
	Adjust.
	* tests/data/test-read-dwarf/libtest23.so.abi: Adjust.
	* tests/data/test-read-dwarf/libtest24-drop-fns-2.so.abi: Adjust.
	* tests/data/test-read-dwarf/libtest24-drop-fns.so.abi: Adjust.
	* tests/data/test-read-dwarf/test0.abi: Adjust.
	* tests/data/test-read-dwarf/test1.abi: Adjust.
	* tests/data/test-read-dwarf/test10-pr18818-gcc.so.abi: Adjust.
	* tests/data/test-read-dwarf/test11-pr18828.so.abi: Adjust.
	* tests/data/test-read-dwarf/test12-pr18844.so.abi: Adjust.
	* tests/data/test-read-dwarf/test13-pr18894.so.abi: Adjust.
	* tests/data/test-read-dwarf/test14-pr18893.so.abi: Adjust.
	* tests/data/test-read-dwarf/test15-pr18892.so.abi: Adjust.
	* tests/data/test-read-dwarf/test16-pr18904.so.abi: Adjust.
	* tests/data/test-read-dwarf/test17-pr19027.so.abi: Adjust.
	* tests/data/test-read-dwarf/test18-pr19037-libvtkRenderingLIC-6.1.so.abi:
	Adjust.
	* tests/data/test-read-dwarf/test19-pr19023-libtcmalloc_and_profiler.so.abi:
	Adjust.
	* tests/data/test-read-dwarf/test2.so.abi: Adjust.
	* tests/data/test-read-dwarf/test20-pr19025-libvtkParallelCore-6.1.so.abi:
	Adjust.
	* tests/data/test-read-dwarf/test21-pr19092.so.abi: Adjust.
	* tests/data/test-read-dwarf/test22-pr19097-libstdc++.so.6.0.17.so.abi:
	Adjust.
	* tests/data/test-read-dwarf/test3.so.abi: Adjust.
	* tests/data/test-read-dwarf/test4.so.abi: Adjust.
	* tests/data/test-read-dwarf/test5.o.abi: Adjust.
	* tests/data/test-read-dwarf/test6.so.abi: Adjust.
	* tests/data/test-read-dwarf/test7.so.abi: Adjust.
	* tests/data/test-read-dwarf/test8-qualified-this-pointer.so.abi:
	Adjust.
	* tests/data/test-read-dwarf/test9-pr18818-clang.so.abi: Adjust.
	* tests/data/test-read-write/test26.xml: Adjust.
	* tests/data/test-read-write/test27.xml: Adjust.
	* tests/data/test-read-write/test28-without-std-fns-ref.xml:
	Adjust.
	* tests/data/test-read-write/test28-without-std-vars-ref.xml:
	Adjust.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2017-07-03 17:45:47 +02:00

31 lines
1.8 KiB
XML

<abi-corpus path='repr7' architecture='elf-amd-x86_64'>
<elf-function-symbols>
<elf-symbol name='_Z2fni' type='func-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/>
</elf-function-symbols>
<elf-variable-symbols>
<elf-symbol name='fnptr0' type='object-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/>
<elf-symbol name='fnptr1' type='object-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/>
</elf-variable-symbols>
<abi-instr version='1.0' address-size='64' path='../../../repr7.cc' language='LANG_C_plus_plus'>
<type-decl name='void' id='type-id-1'/>
<type-decl name='int' size-in-bits='32' id='type-id-2'/>
<function-decl name='fn' mangled-name='_Z2fni' filepath='../../../repr7.cc' line='3' column='1' visibility='default' binding='global' size-in-bits='64' elf-symbol-id='_Z2fni'>
<parameter type-id='type-id-2'/>
<return type-id='type-id-1'/>
</function-decl>
<pointer-type-def type-id='type-id-3' size-in-bits='64' id='type-id-4'/>
<var-decl name='fnptr0' type-id='type-id-4' mangled-name='fnptr0' visibility='default' filepath='../../../repr7.cc' line='1' column='1' elf-symbol-id='fnptr0'/>
<type-decl name='double' size-in-bits='64' id='type-id-5'/>
<pointer-type-def type-id='type-id-6' size-in-bits='64' id='type-id-7'/>
<var-decl name='fnptr1' type-id='type-id-7' mangled-name='fnptr1' visibility='default' filepath='../../../repr7.cc' line='7' column='1' elf-symbol-id='fnptr1'/>
<function-type size-in-bits='64' id='type-id-6'>
<parameter type-id='type-id-5'/>
<return type-id='type-id-5'/>
</function-type>
<function-type size-in-bits='64' id='type-id-3'>
<parameter type-id='type-id-2'/>
<return type-id='type-id-1'/>
</function-type>
</abi-instr>
</abi-corpus>