diff options
| author | Roland McGrath <[email protected]> | 2010-04-21 17:54:33 -0700 |
|---|---|---|
| committer | Roland McGrath <[email protected]> | 2010-04-21 17:54:33 -0700 |
| commit | 29ac69dea1640adbe9a19d158f4ea702f8f4223c (patch) | |
| tree | 3f654d692760f5d07926874052c89b0193966cf3 /tests | |
| parent | 410dee79e799d66fc816859c3b0bf40bcc6ae647 (diff) | |
| parent | f5ed5445c123ce861fbcffd3505ed814086a3a01 (diff) | |
Merge commit 'elfutils-0.146' into dwarf
Conflicts:
tests/Makefile.am
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/ChangeLog | 15 | ||||
| -rw-r--r-- | tests/Makefile.am | 10 | ||||
| -rw-r--r-- | tests/msg_tst.c | 2 | ||||
| -rwxr-xr-x | tests/run-test-flag-nobits.sh | 30 | ||||
| -rw-r--r-- | tests/test-flag-nobits.c | 43 |
5 files changed, 96 insertions, 4 deletions
diff --git a/tests/ChangeLog b/tests/ChangeLog index 2d72ee39..83b4b747 100644 --- a/tests/ChangeLog +++ b/tests/ChangeLog @@ -1,3 +1,18 @@ +2010-04-14 Roland McGrath <[email protected]> + + * Makefile.am (EXTRA_DIST): Add run-test-flag-nobits.sh here too. + +2010-04-10 Ulrich Drepper <[email protected]> + + * msg_tst.c: Adjust expected error message. + +2010-04-01 Petr Machata <[email protected]> + + * test-flag-nobits.c: New test. + * run-test-flag-nobits.sh: And its wrapper. + * Makefile.am (noinst_PROGRAMS, TESTS): Add them. + (test_flag_nobits_LDADD): New variable. + 2009-12-13 Roland McGrath <[email protected]> * run-dwarfcmp-self.sh: Move the hairiest/largest cases to last. diff --git a/tests/Makefile.am b/tests/Makefile.am index c7ce6d50..b3ae88fb 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -59,7 +59,9 @@ noinst_PROGRAMS = arextract arsymtest newfile saridx scnnames sectiondump \ dwfl-bug-addr-overflow arls dwfl-bug-fd-leak \ dwfl-addr-sect dwfl-bug-report early-offscn \ dwfl-bug-getmodules dwarf-getmacros addrcfi \ - dwarf-print dwarf_edit + dwarf-print dwarf_edit \ + test-flag-nobits + asm_TESTS = asm-tst1 asm-tst2 asm-tst3 asm-tst4 asm-tst5 \ asm-tst6 asm-tst7 asm-tst8 asm-tst9 @@ -86,7 +88,8 @@ TESTS = run-arextract.sh run-arsymtest.sh newfile test-nlist \ run-disasm-x86.sh run-disasm-x86-64.sh \ run-early-offscn.sh run-dwarf-getmacros.sh \ run-dwarfcmp-self.sh run-dwarflint-self.sh run-dwarf-attributes.sh \ - run-dwarf_edit.sh run-dwarfcmp-test-self.sh + run-dwarf_edit.sh run-dwarfcmp-test-self.sh \ + run-test-flag-nobits.sh # run-show-ciefde.sh if !STANDALONE @@ -119,7 +122,7 @@ EXTRA_DIST = run-arextract.sh run-arsymtest.sh \ run-find-prologues.sh run-allregs.sh run-native-test.sh \ run-addrname-test.sh run-dwfl-bug-offline-rel.sh \ run-dwfl-addr-sect.sh run-early-offscn.sh \ - run-dwarf-getmacros.sh \ + run-dwarf-getmacros.sh run-test-flag-nobits.sh \ run-dwarfcmp-self.sh run-dwarfcmp-test-self.sh \ run-dwarflint-self.sh run-dwarf-attributes.sh run-dwarf_edit.sh \ testfile15.bz2 testfile15.debug.bz2 \ @@ -246,6 +249,7 @@ dwfl_addr_sect_LDADD = $(libdw) $(libebl) $(libelf) $(libmudflap) -ldl sha1_tst_LDADD = $(libeu) $(libmudflap) dwarf_getmacros_LDADD = $(libdw) $(libmudflap) addrcfi_LDADD = $(libdw) $(libebl) $(libelf) $(libmudflap) -ldl +test_flag_nobits_LDADD = $(libelf) $(libmudflap) if GCOV check: check-am coverage diff --git a/tests/msg_tst.c b/tests/msg_tst.c index db078533..f2390962 100644 --- a/tests/msg_tst.c +++ b/tests/msg_tst.c @@ -64,7 +64,7 @@ static struct { ELF_E_INVALID_COMMAND, "invalid command" }, { ELF_E_WRONG_ORDER_EHDR, "executable header not created first" }, { ELF_E_FD_DISABLED, "file descriptor disabled" }, - { ELF_E_FD_MISMATCH, "archive/member fildes mismatch" }, + { ELF_E_FD_MISMATCH, "archive/member file descriptor mismatch" }, { ELF_E_OFFSET_RANGE, "offset out of range" }, { ELF_E_NOT_NUL_SECTION, "cannot manipulate null section" }, { ELF_E_DATA_MISMATCH, "data/scn mismatch" }, diff --git a/tests/run-test-flag-nobits.sh b/tests/run-test-flag-nobits.sh new file mode 100755 index 00000000..1fae6603 --- /dev/null +++ b/tests/run-test-flag-nobits.sh @@ -0,0 +1,30 @@ +#! /bin/sh +# Copyright (C) 2010 Red Hat, Inc. +# This file is part of Red Hat elfutils. +# +# Red Hat elfutils 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; version 2 of the License. +# +# Red Hat 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 Red Hat elfutils; if not, write to the Free Software Foundation, +# Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA. +# +# Red Hat elfutils is an included package of the Open Invention Network. +# An included package of the Open Invention Network is a package for which +# Open Invention Network licensees cross-license their patents. No patent +# license is granted, either expressly or impliedly, by designation as an +# included package. Should you wish to participate in the Open Invention +# Network licensing program, please visit www.openinventionnetwork.com +# <http://www.openinventionnetwork.com>. + +. $srcdir/test-subr.sh + +testfiles testfile + +testrun ./test-flag-nobits testfile diff --git a/tests/test-flag-nobits.c b/tests/test-flag-nobits.c new file mode 100644 index 00000000..3a79da91 --- /dev/null +++ b/tests/test-flag-nobits.c @@ -0,0 +1,43 @@ +/* Copyright (C) 2010 Red Hat, Inc. + This file is part of Red Hat elfutils. + + Red Hat elfutils 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; version 2 of the License. + + Red Hat 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 Red Hat elfutils; if not, write to the Free Software Foundation, + Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA. + + Red Hat elfutils is an included package of the Open Invention Network. + An included package of the Open Invention Network is a package for which + Open Invention Network licensees cross-license their patents. No patent + license is granted, either expressly or impliedly, by designation as an + included package. Should you wish to participate in the Open Invention + Network licensing program, please visit www.openinventionnetwork.com + <http://www.openinventionnetwork.com>. */ + +#include <fcntl.h> +#include <stdlib.h> +#include <gelf.h> + +int +main (int argc, char **argv) +{ + if (argc != 2) + abort (); + + elf_version (EV_CURRENT); + + int fd = open64 (argv[1], O_RDONLY); + Elf *stripped = elf_begin (fd, ELF_C_READ, NULL); + + Elf_Scn *scn = NULL; + while ((scn = elf_nextscn (stripped, scn)) != NULL) + elf_flagdata (elf_getdata (scn, NULL), ELF_C_SET, ELF_F_DIRTY); +} |
