summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorRoland McGrath <[email protected]>2008-04-01 02:30:05 +0000
committerRoland McGrath <[email protected]>2008-04-01 02:30:05 +0000
commit13b69609bcd5638e6194d940855fea3dd0519605 (patch)
treeffaa63b3cd050285d68ebc6c437c012edb59ddf9 /tests
parentd11f9cbecac4a5ac3848a68597028d1924f3ff6b (diff)
backends/
* sparc_symbol.c (sparc_symbol_type_name): New function. (sparc_dynamic_tag_name): New function. (sparc_dynamic_tag_check): New function. * sparc_init.c (sparc_init): Initialize those hooks. libebl/ * ebldynamictagname.c (ebl_dynamic_tag_name): Use hex for unknown tag.
Diffstat (limited to 'tests')
-rw-r--r--tests/ChangeLog7
-rw-r--r--tests/Makefile.am8
-rw-r--r--tests/early-offscn.c60
-rwxr-xr-xtests/run-early-offscn.sh32
4 files changed, 104 insertions, 3 deletions
diff --git a/tests/ChangeLog b/tests/ChangeLog
index 502d0ab3..d9d74692 100644
--- a/tests/ChangeLog
+++ b/tests/ChangeLog
@@ -1,3 +1,10 @@
+2008-03-31 Roland McGrath <[email protected]>
+
+ * run-early-offscn.sh: New file.
+ * early-offscn.c: New file.
+ * Makefile.am (noinst_PROGRAMS, TESTS, EXTRA_DIST): Add them.
+ (early_offscn_LDADD): New variable.
+
2008-03-19 Roland McGrath <[email protected]>
* run-addrname-test.sh: Add a new case.
diff --git a/tests/Makefile.am b/tests/Makefile.am
index a058e589..f0b20e9d 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -59,7 +59,7 @@ noinst_PROGRAMS = arextract arsymtest newfile saridx scnnames sectiondump \
show-abbrev hash newscn ecp dwflmodtest \
find-prologues funcretval allregs rdwrmmap \
dwfl-bug-addr-overflow arls dwfl-bug-fd-leak \
- dwfl-addr-sect dwfl-bug-report
+ dwfl-addr-sect dwfl-bug-report early-offscn
# get-ciefde
asm_TESTS = asm-tst1 asm-tst2 asm-tst3 asm-tst4 asm-tst5 \
asm-tst6 asm-tst7 asm-tst8 asm-tst9
@@ -84,7 +84,8 @@ TESTS = run-arextract.sh run-arsymtest.sh newfile test-nlist \
dwfl-bug-addr-overflow run-addrname-test.sh \
dwfl-bug-fd-leak dwfl-bug-report \
run-dwfl-bug-offline-rel.sh run-dwfl-addr-sect.sh \
- run-disasm-x86.sh run-disasm-x86-64.sh
+ run-disasm-x86.sh run-disasm-x86-64.sh \
+ run-early-offscn.sh
# run-show-ciefde.sh
if !STANDALONE
@@ -115,7 +116,7 @@ EXTRA_DIST = run-arextract.sh run-arsymtest.sh \
run-addrscopes.sh run-strings-test.sh run-funcscopes.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-dwfl-addr-sect.sh run-early-offscn.sh \
testfile15.bz2 testfile15.debug.bz2 \
testfile16.bz2 testfile16.debug.bz2 \
testfile17.bz2 testfile17.debug.bz2 \
@@ -190,6 +191,7 @@ hash_LDADD = $(libelf) $(libmudflap)
test_nlist_LDADD = $(libelf) $(libmudflap)
msg_tst_LDADD = $(libelf) $(libmudflap)
newscn_LDADD = $(libelf) $(libmudflap)
+early_offscn_LDADD = $(libelf) $(libmudflap)
ecp_LDADD = $(libelf) $(libmudflap)
update1_LDADD = $(libelf) $(libmudflap)
update2_LDADD = $(libelf) $(libmudflap)
diff --git a/tests/early-offscn.c b/tests/early-offscn.c
new file mode 100644
index 00000000..8778d506
--- /dev/null
+++ b/tests/early-offscn.c
@@ -0,0 +1,60 @@
+/* Copyright (C) 2008 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>. */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <errno.h>
+#include <error.h>
+#include <fcntl.h>
+#include <gelf.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+int
+main (int argc, char *argv[])
+{
+ if (argc < 2)
+ error (1, 0, "Usage: %s FILE OFFSET", argv[0]);
+
+ /* Set the ELF version. */
+ elf_version (EV_CURRENT);
+
+ /* Open the archive. */
+ int fd = open (argv[1], O_RDONLY);
+ if (fd < 0)
+ error (1, errno, "cannot open '%s'", argv[1]);
+
+ Elf *elf = elf_begin (fd, ELF_C_READ, NULL);
+ if (elf == NULL)
+ error (2, 0, "elf_begin: %s", elf_errmsg (-1));
+
+ Elf_Scn *scn = gelf_offscn (elf, strtoull (argv[2], NULL, 0));
+ if (scn == NULL)
+ error (3, 0, "gelf_offscn: %s", elf_errmsg (-1));
+
+ elf_end (elf);
+ return 0;
+}
diff --git a/tests/run-early-offscn.sh b/tests/run-early-offscn.sh
new file mode 100755
index 00000000..70be2192
--- /dev/null
+++ b/tests/run-early-offscn.sh
@@ -0,0 +1,32 @@
+#! /bin/sh
+# Copyright (C) 2008 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 ./early-offscn testfile 0x500
+
+exit 0