200_Dpkg_Shlibs.t 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386
  1. # -*- mode: cperl;-*-
  2. #
  3. # This program is free software; you can redistribute it and/or modify
  4. # it under the terms of the GNU General Public License as published by
  5. # the Free Software Foundation; either version 2 of the License, or
  6. # (at your option) any later version.
  7. #
  8. # This program is distributed in the hope that it will be useful,
  9. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. # GNU General Public License for more details.
  12. #
  13. # You should have received a copy of the GNU General Public License
  14. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  15. use Test::More tests => 63;
  16. use IO::String;
  17. use strict;
  18. use warnings;
  19. use_ok('Dpkg::Shlibs');
  20. my @tmp;
  21. my @save_paths = @Dpkg::Shlibs::librarypaths;
  22. @Dpkg::Shlibs::librarypaths = ();
  23. my $srcdir = $ENV{srcdir} || '.';
  24. $srcdir .= '/t/200_Dpkg_Shlibs';
  25. Dpkg::Shlibs::parse_ldso_conf("t.tmp/ld.so.conf");
  26. use Data::Dumper;
  27. is_deeply([qw(/nonexistant32 /nonexistant/lib64
  28. /usr/local/lib /nonexistant/lib128 )],
  29. \@Dpkg::Shlibs::librarypaths, "parsed library paths");
  30. use_ok('Dpkg::Shlibs::Objdump');
  31. my $obj = Dpkg::Shlibs::Objdump::Object->new;
  32. open my $objdump, '<', "$srcdir/objdump.dbd-pg"
  33. or die "$srcdir/objdump.dbd-pg: $!";
  34. $obj->_parse($objdump);
  35. close $objdump;
  36. ok(!$obj->is_public_library(), 'Pg.so is not a public library');
  37. ok(!$obj->is_executable(), 'Pg.so is not an executable');
  38. open $objdump, '<', "$srcdir/objdump.ls"
  39. or die "$srcdir/objdump.ls: $!";
  40. $obj->reset();
  41. $obj->_parse($objdump);
  42. close $objdump;
  43. ok(!$obj->is_public_library(), 'ls is not a public library');
  44. ok($obj->is_executable(), 'ls is an executable');
  45. my $sym = $obj->get_symbol('optarg@GLIBC_2.0');
  46. ok($sym, 'optarg@GLIBC_2.0 exists');
  47. ok(!$sym->{'defined'}, 'R_*_COPY relocations are taken into account');
  48. # Non-regression test for #506139
  49. $sym = $obj->get_symbol('singlespace');
  50. ok($sym, 'version less symbol separated by a single space are correctly parsed');
  51. open $objdump, '<', "$srcdir/objdump.libc6-2.6"
  52. or die "$srcdir/objdump.libc6-2.6: $!";
  53. $obj->reset();
  54. $obj->_parse($objdump);
  55. close $objdump;
  56. ok($obj->is_public_library(), 'libc6 is a public library');
  57. ok(!$obj->is_executable(), 'libc6 is not an executable');
  58. is($obj->{SONAME}, 'libc.so.6', 'SONAME');
  59. is($obj->{HASH}, '0x13d99c', 'HASH');
  60. is($obj->{GNU_HASH}, '0x194', 'GNU_HASH');
  61. is($obj->{format}, 'elf32-i386', 'format');
  62. is_deeply($obj->{flags}, { DYNAMIC => 1, HAS_SYMS => 1, D_PAGED => 1 }, 'flags');
  63. is_deeply($obj->{NEEDED}, [ 'ld-linux.so.2' ], 'NEEDED');
  64. is_deeply([ $obj->get_needed_libraries ], [ 'ld-linux.so.2' ], 'NEEDED');
  65. $sym = $obj->get_symbol('_sys_nerr@GLIBC_2.3');
  66. is_deeply( $sym, { name => '_sys_nerr', version => 'GLIBC_2.3',
  67. soname => 'libc.so.6', objid => 'libc.so.6',
  68. section => '.rodata', dynamic => 1,
  69. debug => '', type => 'O', weak => '',
  70. local => '', global => 1, visibility => '',
  71. hidden => 1, defined => 1 }, 'Symbol' );
  72. $sym = $obj->get_symbol('_IO_stdin_used');
  73. is_deeply( $sym, { name => '_IO_stdin_used', version => '',
  74. soname => 'libc.so.6', objid => 'libc.so.6',
  75. section => '*UND*', dynamic => 1,
  76. debug => '', type => ' ', weak => 1,
  77. local => '', global => '', visibility => '',
  78. hidden => '', defined => '' }, 'Symbol 2' );
  79. my @syms = $obj->get_exported_dynamic_symbols;
  80. is( scalar @syms, 2231, 'defined && dynamic' );
  81. @syms = $obj->get_undefined_dynamic_symbols;
  82. is( scalar @syms, 9, 'undefined && dynamic' );
  83. my $obj_old = Dpkg::Shlibs::Objdump::Object->new;
  84. open $objdump, '<', "$srcdir/objdump.libc6-2.3"
  85. or die "$srcdir/objdump.libc6-2.3: $!";
  86. $obj_old->_parse($objdump);
  87. close $objdump;
  88. use_ok('Dpkg::Shlibs::SymbolFile');
  89. use_ok('Dpkg::Shlibs::Symbol');
  90. my $sym_file = Dpkg::Shlibs::SymbolFile->new(file => "$srcdir/symbol_file.tmp");
  91. my $sym_file_dup = Dpkg::Shlibs::SymbolFile->new(file => "$srcdir/symbol_file.tmp");
  92. my $sym_file_old = Dpkg::Shlibs::SymbolFile->new(file => "$srcdir/symbol_file.tmp");
  93. $sym_file->merge_symbols($obj_old, "2.3.6.ds1-13");
  94. $sym_file_old->merge_symbols($obj_old, "2.3.6.ds1-13");
  95. ok( $sym_file->has_object('libc.so.6'), 'SONAME in sym file' );
  96. $sym_file->merge_symbols($obj, "2.6-1");
  97. ok( $sym_file->get_new_symbols($sym_file_old), 'has new symbols' );
  98. ok( $sym_file_old->get_lost_symbols($sym_file), 'has lost symbols' );
  99. is( $sym_file_old->lookup_symbol('__bss_start@Base', ['libc.so.6']),
  100. undef, 'internal symbols are blacklisted');
  101. $sym = $sym_file->lookup_symbol('_errno@GLIBC_2.0', ['libc.so.6'], 1);
  102. isa_ok($sym, 'Dpkg::Shlibs::Symbol');
  103. is_deeply($sym, Dpkg::Shlibs::Symbol->new( 'symbol' => '_errno@GLIBC_2.0',
  104. 'minver' => '2.3.6.ds1-13', 'dep_id' => 0,
  105. 'deprecated' => '2.6-1', 'depends' => '',
  106. 'soname' => 'libc.so.6' ), 'deprecated symbol');
  107. # Wildcard test
  108. $sym = Dpkg::Shlibs::Symbol->new(symbol => '*@GLIBC_PRIVATE', minver => '2.3.6.wildcard');
  109. $sym_file_old->add_symbol('libc.so.6', $sym);
  110. $sym_file_old->merge_symbols($obj, "2.6-1");
  111. $sym = $sym_file_old->lookup_symbol('__nss_services_lookup@GLIBC_PRIVATE', ['libc.so.6']);
  112. is_deeply($sym, Dpkg::Shlibs::Symbol->new( 'symbol' => '__nss_services_lookup@GLIBC_PRIVATE',
  113. 'minver' => '2.3.6.wildcard', 'dep_id' => 0,
  114. 'deprecated' => 0, 'depends' => '',
  115. 'soname' => 'libc.so.6' ), 'wildcarded symbol');
  116. # Save -> Load test
  117. use File::Temp;
  118. my $save_file = new File::Temp;
  119. $sym_file->save($save_file->filename);
  120. $sym_file_dup->load($save_file->filename);
  121. $sym_file_dup->{file} = "$srcdir/symbol_file.tmp";
  122. is_deeply($sym_file_dup, $sym_file, 'save -> load' );
  123. # Test include mechanism of SymbolFile
  124. $sym_file = Dpkg::Shlibs::SymbolFile->new(file => "$srcdir/symbols.include-1");
  125. $sym = $sym_file->lookup_symbol('symbol_before@Base', ['libfake.so.1']);
  126. is_deeply($sym, Dpkg::Shlibs::Symbol->new( 'symbol' => 'symbol_before@Base',
  127. 'minver' => '0.9', 'dep_id' => 0, 'deprecated' => 0,
  128. 'depends' => 'libfake1 #MINVER#', 'soname' => 'libfake.so.1' ),
  129. 'symbol before include not lost');
  130. $sym = $sym_file->lookup_symbol('symbol_after@Base', ['libfake.so.1']);
  131. is_deeply($sym, Dpkg::Shlibs::Symbol->new( 'symbol' => 'symbol_after@Base',
  132. 'minver' => '1.1', 'dep_id' => 0, 'deprecated' => 0,
  133. 'depends' => 'libfake1 #MINVER#', 'soname' => 'libfake.so.1' ),
  134. 'symbol after include not lost');
  135. $sym = $sym_file->lookup_symbol('symbol1_fake1@Base', ['libfake.so.1']);
  136. is_deeply($sym, Dpkg::Shlibs::Symbol->new( 'symbol' => 'symbol1_fake1@Base',
  137. 'minver' => '1.0', 'dep_id' => 0, 'deprecated' => 0,
  138. 'depends' => 'libfake1 #MINVER#', 'soname' => 'libfake.so.1' ),
  139. 'overrides order with #include');
  140. $sym = $sym_file->lookup_symbol('symbol3_fake1@Base', ['libfake.so.1']);
  141. is_deeply($sym, Dpkg::Shlibs::Symbol->new ( 'symbol' => 'symbol3_fake1@Base',
  142. 'minver' => '0', 'dep_id' => 0, 'deprecated' => 0,
  143. 'depends' => 'libfake1 #MINVER#', 'soname' => 'libfake.so.1' ),
  144. 'overrides order with #include');
  145. is($sym_file->get_smallest_version('libfake.so.1'), "0",
  146. 'get_smallest_version with null version');
  147. $sym = $sym_file->lookup_symbol('symbol_in_libdivert@Base', ['libdivert.so.1']);
  148. is_deeply($sym, Dpkg::Shlibs::Symbol->new ( 'symbol' => 'symbol_in_libdivert@Base',
  149. 'minver' => '1.0~beta1', 'dep_id' => 0, 'deprecated' => 0,
  150. 'depends' => 'libdivert1 #MINVER#', 'soname' => 'libdivert.so.1'),
  151. '#include can change current object');
  152. $sym_file = Dpkg::Shlibs::SymbolFile->new(file => "$srcdir/symbols.include-2");
  153. $sym = $sym_file->lookup_symbol('symbol1_fake2@Base', ['libfake.so.1']);
  154. is_deeply($sym, Dpkg::Shlibs::Symbol->new ( 'symbol' => 'symbol1_fake2@Base',
  155. 'minver' => '1.0', 'dep_id' => 1, 'deprecated' => 0,
  156. 'depends' => 'libvirtualfake', 'soname' => 'libfake.so.1' ),
  157. 'overrides order with circular #include');
  158. is($sym_file->get_smallest_version('libfake.so.1'), "1.0",
  159. 'get_smallest_version');
  160. # Check dump output
  161. my $io = IO::String->new();
  162. $sym_file->dump($io, package => "libfake1");
  163. is(${$io->string_ref()},
  164. 'libfake.so.1 libfake1 #MINVER#
  165. | libvirtualfake
  166. * Build-Depends-Package: libfake-dev
  167. symbol1_fake2@Base 1.0 1
  168. symbol2_fake2@Base 1.0
  169. symbol3_fake2@Base 1.1
  170. ', "Dump of $srcdir/symbols.include-2");
  171. # Check parsing of objdump output on ia64 (local symbols
  172. # without versions and with visibility attribute)
  173. $obj = Dpkg::Shlibs::Objdump::Object->new;
  174. open $objdump, '<', "$srcdir/objdump.glib-ia64"
  175. or die "$srcdir/objdump.glib-ia64: $!";
  176. $obj->_parse($objdump);
  177. close $objdump;
  178. $sym = $obj->get_symbol('IA__g_free');
  179. is_deeply( $sym, { name => 'IA__g_free', version => '',
  180. soname => 'libglib-2.0.so.0', objid => 'libglib-2.0.so.0',
  181. section => '.text', dynamic => 1,
  182. debug => '', type => 'F', weak => '',
  183. local => 1, global => '', visibility => 'hidden',
  184. hidden => '', defined => 1 },
  185. 'symbol with visibility without version' );
  186. ####### Test symbol tagging support ######
  187. # Parsing/dumping
  188. # Template mode
  189. $sym_file = Dpkg::Shlibs::SymbolFile->new(file => "$srcdir/symbols.tags.in", arch => 'amd64');
  190. $sym_file->save($save_file->filename, template_mode => 1);
  191. $sym_file_dup = Dpkg::Shlibs::SymbolFile->new(file => $save_file, arch => 'amd64');
  192. $sym_file_dup->{file} = "$srcdir/symbols.tags.in";
  193. is_deeply($sym_file_dup, $sym_file, 'template save -> load' );
  194. is( system("diff -u '$srcdir/symbols.tags.in' '" . $save_file->filename . "' >&2"), 0, "symbols.tags.in template dumped identical" );
  195. # Dumping in non-template mode (amd64) (test for arch, subst tags)
  196. $io = IO::String->new();
  197. $sym_file->dump($io);
  198. is(${$io->string_ref()},
  199. 'libsymboltags.so.1 libsymboltags1 #MINVER#
  200. | libsymboltags1 (>= 1.1)
  201. symbol11_optional@Base 1.1 1
  202. symbol21_amd64@Base 2.1
  203. symbol31_randomtag@Base 3.1
  204. symbol51_untagged@Base 5.1
  205. ', "template vs. non-template on amd64" );
  206. # Dumping in non-template mode (i386) (test for arch, subst tags)
  207. $io = IO::String->new();
  208. $sym_file = Dpkg::Shlibs::SymbolFile->new(file => "$srcdir/symbols.tags.in", arch => 'i386');
  209. $sym_file_dup = Dpkg::Shlibs::SymbolFile->new(file => "$srcdir/symbols.tags.in", arch => 'i386');
  210. $sym_file->dump($io);
  211. is(${$io->string_ref()},
  212. 'libsymboltags.so.1 libsymboltags1 #MINVER#
  213. | libsymboltags1 (>= 1.1)
  214. symbol11_optional@Base 1.1 1
  215. symbol22_i386@Base 2.2
  216. symbol31_randomtag@Base 3.1
  217. symbol41_i386_and_optional@Base 4.1
  218. symbol51_untagged@Base 5.1
  219. ', "template vs. non-template on i386" );
  220. ok (defined $sym_file->{objects}{'libsymboltags.so.1'}{syms}{'symbol21_amd64@Base'},
  221. "syms keys are symbol names without quotes");
  222. # Preload objdumps
  223. my $tags_obj_i386 = Dpkg::Shlibs::Objdump::Object->new();
  224. open $objdump, '<', "$srcdir/objdump.tags-i386" or die "$srcdir/objdump.tags-i386: $!";
  225. $tags_obj_i386->_parse($objdump);
  226. close $objdump;
  227. $sym_file->merge_symbols($tags_obj_i386, '100.MISSING');
  228. is_deeply($sym_file, $sym_file_dup, "is objdump.tags-i386 and symbols.tags.in in sync");
  229. my $tags_obj_amd64 = Dpkg::Shlibs::Objdump::Object->new();
  230. open $objdump, '<', "$srcdir/objdump.tags-amd64" or die "$srcdir/objdump.tags-amd64: $!";
  231. $tags_obj_amd64->_parse($objdump);
  232. close $objdump;
  233. # Merge/get_{new,lost} tests for optional tag:
  234. # - disappeared
  235. my $symbol11 = $tags_obj_i386->get_symbol('symbol11_optional@Base');
  236. delete $tags_obj_i386->{dynsyms}{'symbol11_optional@Base'};
  237. $sym_file->merge_symbols($tags_obj_i386, '100.MISSING');
  238. $sym = $sym_file->lookup_symbol('symbol11_optional@Base', ['libsymboltags.so.1'], 1);
  239. is_deeply($sym, Dpkg::Shlibs::Symbol->new( 'symbol' => 'symbol11_optional@Base', 'symbol_templ' => 'symbol11_optional@Base',
  240. 'minver' => '1.1', 'dep_id' => 1, 'deprecated' => '100.MISSING',
  241. 'depends' => 'libsymboltags1 (>= 1.1)', 'soname' => 'libsymboltags.so.1',
  242. 'tags' => { 'optional' => undef }, 'tagorder' => [ 'optional' ] ),
  243. 'disappered optional symbol gets deprecated');
  244. $sym_file->merge_symbols($tags_obj_i386, '101.MISSING');
  245. $sym = $sym_file->lookup_symbol('symbol11_optional@Base', ['libsymboltags.so.1'], 1);
  246. is_deeply($sym, Dpkg::Shlibs::Symbol->new( 'symbol' => 'symbol11_optional@Base', 'symbol_templ' => 'symbol11_optional@Base',
  247. 'minver' => '1.1', 'dep_id' => 1, 'deprecated' => '101.MISSING',
  248. 'depends' => 'libsymboltags1 (>= 1.1)', 'soname' => 'libsymboltags.so.1',
  249. 'tags' => { 'optional' => undef }, 'tagorder' => [ 'optional' ] ),
  250. 'deprecated text of MISSING optional symbol gets rebumped each merge');
  251. is( scalar($sym_file->get_lost_symbols($sym_file_dup)), 0, "missing optional symbol is not LOST");
  252. # - reappeared (undeprecate, minver should be 1.1, not 100.MISSED)
  253. $tags_obj_i386->add_dynamic_symbol($symbol11);
  254. $sym_file->merge_symbols($tags_obj_i386, '100.MISSING');
  255. $sym = $sym_file->lookup_symbol('symbol11_optional@Base', ['libsymboltags.so.1']);
  256. is_deeply($sym, Dpkg::Shlibs::Symbol->new( 'symbol' => 'symbol11_optional@Base', 'symbol_templ' => 'symbol11_optional@Base',
  257. 'minver' => '1.1', 'dep_id' => 1, 'deprecated' => 0,
  258. 'depends' => 'libsymboltags1 (>= 1.1)', 'soname' => 'libsymboltags.so.1',
  259. 'tags' => { 'optional' => undef }, 'tagorder' => [ 'optional' ] ),
  260. 'reappered optional symbol gets undeprecated + minver');
  261. is( scalar($sym_file->get_lost_symbols($sym_file_dup) +
  262. $sym_file->get_new_symbols($sym_file_dup)), 0, "reappeared optional symbol: neither NEW nor LOST");
  263. # Merge/get_{new,lost} tests for arch tag:
  264. # - arch specific appears on wrong arch: 'arch' tag should be removed
  265. my $symbol21 = $tags_obj_amd64->get_symbol('symbol21_amd64@Base');
  266. $tags_obj_i386->add_dynamic_symbol($symbol21);
  267. $sym_file->merge_symbols($tags_obj_i386, '100.MISSING');
  268. $sym = $sym_file->lookup_symbol('symbol21_amd64@Base', ['libsymboltags.so.1']);
  269. is_deeply($sym, Dpkg::Shlibs::Symbol->new( 'symbol' => 'symbol21_amd64@Base', 'symbol_templ' => 'symbol21_amd64@Base',
  270. 'symbol_quoted' => "'", 'minver' => '2.1', 'dep_id' => 0, 'deprecated' => 0,
  271. 'depends' => 'libsymboltags1 #MINVER#', 'soname' => 'libsymboltags.so.1' ),
  272. 'symbol appears on foreign arch, arch tag should be removed');
  273. @tmp = map { $_->get_symbolname() } $sym_file->get_new_symbols($sym_file_dup);
  274. is_deeply( \@tmp, [ 'symbol21_amd64@Base' ], "symbol from foreign arch is NEW");
  275. is( $sym->get_symbolspec(1), ' symbol21_amd64@Base 2.1', 'no tags => no quotes in the symbol name' );
  276. # - arch specific symbol disappears
  277. delete $tags_obj_i386->{dynsyms}{'symbol22_i386@Base'};
  278. delete $tags_obj_i386->{dynsyms}{'symbol41_i386_and_optional@Base'};
  279. $sym_file->merge_symbols($tags_obj_i386, '100.MISSING');
  280. $sym = $sym_file->lookup_symbol('symbol22_i386@Base', ['libsymboltags.so.1'], 1);
  281. is_deeply($sym, Dpkg::Shlibs::Symbol->new( 'symbol' => 'symbol22_i386@Base', 'symbol_templ' => 'symbol22_i386@Base',
  282. 'minver' => '2.2', 'dep_id' => 0, 'deprecated' => '100.MISSING',
  283. 'depends' => 'libsymboltags1 #MINVER#', 'soname' => 'libsymboltags.so.1',
  284. 'tags' => { 'arch' => '!amd64 !ia64 !alpha' }, 'tagorder' => [ 'arch' ] ),
  285. 'disappeared arch specific symbol gets deprecated');
  286. $sym = $sym_file->lookup_symbol('symbol41_i386_and_optional@Base', ['libsymboltags.so.1'], 1);
  287. is_deeply($sym, Dpkg::Shlibs::Symbol->new( 'symbol' => 'symbol41_i386_and_optional@Base',
  288. 'symbol_templ' => 'symbol41_i386_and_optional@Base', 'symbol_quoted' => '"',
  289. 'minver' => '4.1', 'dep_id' => 0, 'deprecated' => '100.MISSING',
  290. 'depends' => 'libsymboltags1 #MINVER#', 'soname' => 'libsymboltags.so.1',
  291. 'tags' => { 'arch' => 'i386', 'optional' => 'reason' }, 'tagorder' => [ 'arch', 'optional' ] ),
  292. 'disappeared optional arch specific symbol gets deprecated');
  293. @tmp = map { $_->get_symbolname() } $sym_file->get_lost_symbols($sym_file_dup);
  294. is_deeply( \@tmp, [ 'symbol22_i386@Base' ], "missing arch specific is LOST, but optional arch specific isn't");
  295. # Tests for tagged #includes
  296. $sym_file = Dpkg::Shlibs::SymbolFile->new(file => "$srcdir/symbols.include-3", arch => 'i386');
  297. $sym = $sym_file->lookup_symbol('symbol2_fake1@Base', ['libsymboltags.so.2']);
  298. is_deeply($sym, Dpkg::Shlibs::Symbol->new( 'symbol' => 'symbol2_fake1@Base',
  299. 'minver' => '1.0', 'depends' => 'libsymboltags2', 'soname' => 'libsymboltags.so.2',
  300. 'tags' => { 'optional' => undef, 'random tag' => 'random value' },
  301. 'tagorder' => [ 'optional', 'random tag' ] ),
  302. 'symbols from #included file inherits tags');
  303. $sym = $sym_file->lookup_symbol('symbol41_i386_and_optional@Base', ['libsymboltags.so.1']);
  304. is_deeply($sym, Dpkg::Shlibs::Symbol->new( 'symbol' => 'symbol41_i386_and_optional@Base',
  305. 'symbol_templ' => 'symbol41_i386_and_optional@Base', symbol_quoted => '"',
  306. 'minver' => '4.1', 'depends' => 'libsymboltags1 #MINVER#', 'soname' => 'libsymboltags.so.1',
  307. 'tags' => { 'optional' => 'reason', 't' => 'v', 'arch' => 'i386' },
  308. 'tagorder' => [ 'optional', 't', 'arch' ] ),
  309. 'symbols in #included file can override tag values');
  310. $sym = $sym_file->lookup_symbol('symbol51_untagged@Base', ['libsymboltags.so.1']);
  311. is_deeply($sym, Dpkg::Shlibs::Symbol->new( 'symbol' => 'symbol51_untagged@Base',
  312. 'minver' => '5.1', 'depends' => 'libsymboltags1 #MINVER#', 'soname' => 'libsymboltags.so.1',
  313. 'tags' => { 'optional' => 'from parent', 't' => 'v' },
  314. 'tagorder' => [ 'optional', 't' ] ),
  315. 'symbols are properly cloned when #including');