From 30a941ca9f463d0d862e5c3dfdb5a867fd2dcb40 Mon Sep 17 00:00:00 2001 From: Petr Machata Date: Wed, 1 Aug 2012 21:41:36 +0200 Subject: [PATCH] Test case for handling archives with 64-bit symbol table Signed-off-by: Petr Machata --- tests/ChangeLog | 7 ++++++ tests/Makefile.am | 6 +++-- tests/run-test-archive64.sh | 43 ++++++++++++++++++++++++++++++++++++ tests/testarchive64.a.bz2 | Bin 0 -> 834 bytes 4 files changed, 54 insertions(+), 2 deletions(-) create mode 100755 tests/run-test-archive64.sh create mode 100644 tests/testarchive64.a.bz2 diff --git a/tests/ChangeLog b/tests/ChangeLog index 8c2547c3c..2291b62b8 100644 --- a/tests/ChangeLog +++ b/tests/ChangeLog @@ -1,3 +1,10 @@ +2012-08-01 Petr Machata + + * run-test-archive64.sh: New test. + * testarchive64.a.bz2: New testfile. + * Makefile.am (TESTS): Add run-test-archive64.sh. + (EXTRA_DIST): Likewise. + 2012-08-01 Mark Wielaard * run-nm-self.sh: New test. diff --git a/tests/Makefile.am b/tests/Makefile.am index 061586923..d0f4e80a0 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -83,7 +83,8 @@ TESTS = run-arextract.sh run-arsymtest.sh newfile test-nlist \ run-test-flag-nobits.sh run-prelink-addr-test.sh \ run-dwarf-getstring.sh run-rerequest_tag.sh run-typeiter.sh \ run-readelf-d.sh run-readelf-gdb_index.sh run-unstrip-n.sh \ - run-low_high_pc.sh run-macro-test.sh run-elf_cntl_gelf_getshdr.sh + run-low_high_pc.sh run-macro-test.sh run-elf_cntl_gelf_getshdr.sh \ + run-test-archive64.sh if !STANDALONE check_PROGRAMS += msg_tst md5-sha1-test @@ -167,7 +168,8 @@ EXTRA_DIST = run-arextract.sh run-arsymtest.sh \ run-unstrip-n.sh testcore-rtlib.bz2 testcore-rtlib-ppc.bz2 \ run-low_high_pc.sh testfile_low_high_pc.bz2 \ run-macro-test.sh testfile-macinfo.bz2 testfile-macros.bz2 \ - run-elf_cntl_gelf_getshdr.sh + run-elf_cntl_gelf_getshdr.sh \ + run-test-archive64.sh testarchive64.a.bz2 installed_TESTS_ENVIRONMENT = libdir=$(DESTDIR)$(libdir) \ bindir=$(DESTDIR)$(bindir) \ diff --git a/tests/run-test-archive64.sh b/tests/run-test-archive64.sh new file mode 100755 index 000000000..26552ac95 --- /dev/null +++ b/tests/run-test-archive64.sh @@ -0,0 +1,43 @@ +#! /bin/sh +# Copyright (C) 2012 Red Hat, Inc. +# This file is part of elfutils. +# +# This file is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# elfutils is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +. $srcdir/test-subr.sh + +# The test archive was produced on an s390x machine using the +# following command sequence: +# echo 'int aaa(void){}' | gcc -x c /dev/stdin -c -o aaa.o +# echo 'int bbb(void){} int bbb2(void){}' | gcc -x c /dev/stdin -c -o bbb.o +# echo 'int ccc(void){} int ccc2(void){} int ccc3(void){}' \ +# | gcc -x c /dev/stdin -c -o ccc.o +# ar cru testarchive64.a aaa.o bbb.o ccc.o +testfiles testarchive64.a + +testrun_compare ../src/readelf -c testarchive64.a <<\EOF + +Index of archive 'testarchive64.a' has 7 entries: +Archive member 'aaa.o' contains: + aaa +Archive member 'bbb.o' contains: + bbb + bbb2 +Archive member 'ccc.o' contains: + ccc + ccc2 + ccc3 +EOF + +exit 0 diff --git a/tests/testarchive64.a.bz2 b/tests/testarchive64.a.bz2 new file mode 100644 index 0000000000000000000000000000000000000000..4b54603312a12ab89b3c948a3f8e3428762262c6 GIT binary patch literal 834 zc-jF%1HJr0T4*^jL0KkKStNqV?9ZeAZP#p00000000000010lXwjh2plAR9003kF003wVfCCOR zG-%Lh&@=!5001%o001-wKmmsu8Z>A$Xc_P000^TAOOJ>NG5=ciKO&3H1!ys zN#z?Unnp*drb9!~H1#p4+J~gVHm1=U4s)f~;rUw_;`17%_Tyq#EJQ|xvgK{|bewrL zO}Oq&9-9$55`(y)HEjF|Bv2rM$G6PSxCM4g=;VTqhzeN%f)@dU1Yk`3n;Q8&&Tlh& znT5_XHtP`tYe@!I*xJ#tt+lFPshc7qKfhNVt{qvKxx94Qe`mh-U!D41!`p8mdG46E zT7m5R%o3;@%p9SqkxtXqdG9_oE7#c8qPa*xBF0f*+K|f7mXL<)3_5J93?f4ap$sVu zFu({KkRorefVv|Hr^3LURuEGA2z&!r?7nx`MLXIh`RC9V`Z4s&w8 z>o45U8F0EUQSP?#`>b?8xMl_|WE$A;uqA9%Fo#@10a`*9L4m?DKj=Dajd2!Cu!Kw( z$~OcJPBvd?>M{XGD9G45l*HhyPgwTl@k@G&n3zuRz&mdM`v;AzYkUpq6vSy~v{9%b zsFjE^LYPX4z|_&I18Us;6$j%(#oL(u1A?A7hxKK(cpn3@`J7Fe2SI_Omf_uetxqY! z(ee&K`y1$OFzruLh-t(_XQ|!7IRiK=jXc|JoXo8nn0Q9kjmFcjIZX3GqkJ)iM5g{g z<<{6V$3T{_vYDOs{c&h~y90uU+95DrTVITRuVBDH6 M