summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoland McGrath <roland@redhat.com>2008-12-03 03:41:58 +0000
committerRoland McGrath <roland@redhat.com>2008-12-03 03:41:58 +0000
commita845f68bf43f90e0670ed6b33154f2aff98ad46b (patch)
tree3bc6809479ef0de95b106f0f8616ca8cb0c02cc2
parenta4c9d281616090c46ffc4fc3234d64e915008e1a (diff)
downloadelfutils-a845f68bf43f90e0670ed6b33154f2aff98ad46b.tar.gz
src/
2008-12-02 Roland McGrath <roland@redhat.com> * readelf.c (count_dwflmod, process_file): Don't presume encoding of nonzero OFFSET argument to dwfl_getmodules.
-rw-r--r--backends/ChangeLog5
-rw-r--r--backends/Makefile.am2
-rw-r--r--backends/i386_corenote.c6
-rw-r--r--backends/x86_64_corenote.c5
-rw-r--r--backends/x86_corenote.c47
-rw-r--r--libdwfl/ChangeLog13
-rw-r--r--libdwfl/dwfl_getmodules.c62
-rw-r--r--libdwfl/dwfl_module_build_id.c5
-rw-r--r--libebl/ChangeLog4
-rw-r--r--libebl/eblcorenotetypename.c2
-rw-r--r--libelf/ChangeLog8
-rw-r--r--libelf/elf.h15
-rw-r--r--libelf/elf_getarhdr.c6
-rw-r--r--src/ChangeLog5
-rw-r--r--src/readelf.c13
-rw-r--r--tests/ChangeLog12
-rw-r--r--tests/Makefile.am4
-rw-r--r--tests/dwfl-bug-getmodules.c74
-rwxr-xr-xtests/run-dwfl-addr-sect.sh3
-rwxr-xr-xtests/run-strings-test.sh5
-rw-r--r--tests/test-subr.sh5
21 files changed, 249 insertions, 52 deletions
diff --git a/backends/ChangeLog b/backends/ChangeLog
index 5bf38a78..85609b15 100644
--- a/backends/ChangeLog
+++ b/backends/ChangeLog
@@ -5,6 +5,11 @@
2008-08-01 Roland McGrath <roland@redhat.com>
+ * x86_corenote.c: New file.
+ * Makefile.am (noinst_HEADERS): Add it.
+ * i386_corenote.c: Include it, use EXTRA_NOTES_IOPERM in EXTRA_NOTES.
+ * x86_64_corenote.c: Likewise.
+
* linux-core-note.c (prstatus_items): Use 'B' instead of 'b'
for sigpend and sighold.
diff --git a/backends/Makefile.am b/backends/Makefile.am
index ebf6b09e..5b552946 100644
--- a/backends/Makefile.am
+++ b/backends/Makefile.am
@@ -146,7 +146,7 @@ uninstall: uninstall-am
done
rmdir --ignore-fail-on-non-empty $(DESTDIR)$(libdir)/$(LIBEBL_SUBDIR)
-noinst_HEADERS = libebl_CPU.h common-reloc.c linux-core-note.c
+noinst_HEADERS = libebl_CPU.h common-reloc.c linux-core-note.c x86_corenote.c
EXTRA_DIST = $(foreach m,$(modules),$($(m)_SRCS)) $(modules:=_reloc.def)
CLEANFILES = *.gcno *.gcda \
diff --git a/backends/i386_corenote.c b/backends/i386_corenote.c
index 02d8ec38..c371c4c3 100644
--- a/backends/i386_corenote.c
+++ b/backends/i386_corenote.c
@@ -103,9 +103,8 @@ static const Ebl_Register_Location prxfpreg_regs[] =
#define EXTRA_NOTES \
EXTRA_REGSET (NT_PRFPXREG, 512, prxfpreg_regs) \
case NT_386_TLS: \
- return tls_info (descsz, regs_offset, nregloc, reglocs, nitems, items);
-
-#define NT_386_TLS 0x200 /* i386 TLS slots (struct user_desc) */
+ return tls_info (descsz, regs_offset, nregloc, reglocs, nitems, items); \
+ EXTRA_NOTES_IOPERM
static const Ebl_Core_Item tls_items[] =
{
@@ -131,4 +130,5 @@ tls_info (GElf_Word descsz, GElf_Word *regs_offset,
return 1;
}
+#include "x86_corenote.c"
#include "linux-core-note.c"
diff --git a/backends/x86_64_corenote.c b/backends/x86_64_corenote.c
index c2bc72e9..552ac88b 100644
--- a/backends/x86_64_corenote.c
+++ b/backends/x86_64_corenote.c
@@ -1,5 +1,5 @@
/* x86-64 specific core note handling.
- Copyright (C) 2005, 2007 Red Hat, Inc.
+ Copyright (C) 2005, 2007, 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
@@ -103,4 +103,7 @@ static const Ebl_Register_Location fpregset_regs[] =
};
#define FPREGSET_SIZE 512
+#define EXTRA_NOTES EXTRA_NOTES_IOPERM
+
+#include "x86_corenote.c"
#include "linux-core-note.c"
diff --git a/backends/x86_corenote.c b/backends/x86_corenote.c
new file mode 100644
index 00000000..7d550676
--- /dev/null
+++ b/backends/x86_corenote.c
@@ -0,0 +1,47 @@
+/* x86-specific core note handling, pieces common to x86-64 and i386.
+ Copyright (C) 2005, 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>. */
+
+#define EXTRA_NOTES_IOPERM \
+ case NT_386_IOPERM: \
+ return ioperm_info (descsz, regs_offset, nregloc, reglocs, nitems, items);
+
+static int
+ioperm_info (GElf_Word descsz, GElf_Word *regs_offset,
+ size_t *nregloc, const Ebl_Register_Location **reglocs,
+ size_t *nitems, const Ebl_Core_Item **items)
+{
+ static const Ebl_Core_Item ioperm_item =
+ { .type = ELF_T_WORD, .format = 'b', .name = "ioperm" };
+
+ if (descsz % 4 != 0)
+ return 0;
+
+ *regs_offset = 0;
+ *nregloc = 0;
+ *reglocs = NULL;
+ *nitems = 1;
+ *items = &ioperm_item;
+ return 1;
+}
diff --git a/libdwfl/ChangeLog b/libdwfl/ChangeLog
index e29c7d60..41ff69bc 100644
--- a/libdwfl/ChangeLog
+++ b/libdwfl/ChangeLog
@@ -1,3 +1,16 @@
+2008-12-02 Roland McGrath <roland@redhat.com>
+
+ * dwfl_getmodules.c (dwfl_getmodules): Typo fix in last change.
+
+2008-11-26 Roland McGrath <roland@redhat.com>
+
+ * dwfl_getmodules.c (dwfl_getmodules): Encode iteration style in
+ return value, and interpret encoded OFFSET argument.
+
+2008-10-07 Roland McGrath <roland@redhat.com>
+
+ * dwfl_module_build_id.c (check_notes): Fix typo in vaddr calculation.
+
2008-09-29 Roland McGrath <roland@redhat.com>
* segment.c (insert): Must realloc DWFL->lookup_module here too.
diff --git a/libdwfl/dwfl_getmodules.c b/libdwfl/dwfl_getmodules.c
index f205b899..7c6ab971 100644
--- a/libdwfl/dwfl_getmodules.c
+++ b/libdwfl/dwfl_getmodules.c
@@ -59,49 +59,55 @@ dwfl_getmodules (Dwfl *dwfl,
if (dwfl == NULL)
return -1;
+ /* We iterate through the linked list when it's all we have.
+ But continuing from an offset is slow that way. So when
+ DWFL->lookup_module is populated, we can instead keep our
+ place by jumping directly into the array. Since the actions
+ of a callback could cause it to get populated, we must
+ choose the style of place-holder when we return an offset,
+ and we encode the choice in the low bits of that value. */
+
Dwfl_Module *m = dwfl->modulelist;
- if (unlikely (dwfl->lookup_module == NULL))
+ if ((offset & 3) == 1)
{
+ offset >>= 2;
for (ptrdiff_t pos = 0; pos < offset; ++pos)
if (m == NULL)
return -1;
else
m = m->next;
- while (m != NULL)
- {
- ++offset;
- if ((*callback) (MODCB_ARGS (m), arg) != DWARF_CB_OK)
- return offset;
- m = m->next;
- }
}
- else
+ else if (((offset & 3) == 2) && likely (dwfl->lookup_module != NULL))
{
- if (offset > 0)
- {
- if ((size_t) offset - 1 == dwfl->lookup_elts)
- return 0;
+ offset >>= 2;
- if (unlikely ((size_t) offset - 1 > dwfl->lookup_elts))
- return -1;
+ if ((size_t) offset - 1 == dwfl->lookup_elts)
+ return 0;
- m = dwfl->lookup_module[offset - 1];
- if (unlikely (m == NULL))
- return -1;
- }
+ if (unlikely ((size_t) offset - 1 > dwfl->lookup_elts))
+ return -1;
- while (m != NULL)
- {
- int ok = (*callback) (MODCB_ARGS (m), arg);
- m = m->next;
- if (ok != DWARF_CB_OK)
- return (m == NULL
- ? (ptrdiff_t) dwfl->lookup_elts + 1
- : m->segment + 1);
- }
+ m = dwfl->lookup_module[offset - 1];
+ if (unlikely (m == NULL))
+ return -1;
+ }
+ else if (offset != 0)
+ {
+ __libdwfl_seterrno (DWFL_E_BADSTROFF);
+ return -1;
}
+ while (m != NULL)
+ {
+ int ok = (*callback) (MODCB_ARGS (m), arg);
+ ++offset;
+ m = m->next;
+ if (ok != DWARF_CB_OK)
+ return ((dwfl->lookup_module == NULL) ? ((offset << 2) | 1)
+ : (((m == NULL ? (ptrdiff_t) dwfl->lookup_elts + 1
+ : m->segment + 1) << 2) | 2));
+ }
return 0;
}
INTDEF (dwfl_getmodules)
diff --git a/libdwfl/dwfl_module_build_id.c b/libdwfl/dwfl_module_build_id.c
index 903b79c5..8725afbc 100644
--- a/libdwfl/dwfl_module_build_id.c
+++ b/libdwfl/dwfl_module_build_id.c
@@ -1,5 +1,5 @@
/* Return build ID information for a module.
- Copyright (C) 2007 Red Hat, Inc.
+ Copyright (C) 2007, 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
@@ -88,7 +88,8 @@ check_notes (Dwfl_Module *mod, bool set, Elf_Data *data, GElf_Addr data_vaddr)
"GNU", sizeof "GNU"))
return found_build_id (mod, set,
data->d_buf + desc_pos, nhdr.n_descsz,
- data_vaddr == NO_VADDR ? 0 : data_vaddr + pos);
+ data_vaddr == NO_VADDR ? 0
+ : data_vaddr + desc_pos);
return 0;
}
diff --git a/libebl/ChangeLog b/libebl/ChangeLog
index 57ac2c8c..51b3b705 100644
--- a/libebl/ChangeLog
+++ b/libebl/ChangeLog
@@ -1,3 +1,7 @@
+2008-08-01 Roland McGrath <roland@redhat.com>
+
+ * eblcorenotetypename.c: Handle NT_386_IOPERM.
+
2008-07-28 Roland McGrath <roland@redhat.com>
* eblauxvinfo.c (AUXV_TYPES): Add EXECFN.
diff --git a/libebl/eblcorenotetypename.c b/libebl/eblcorenotetypename.c
index d01932fc..9376cf57 100644
--- a/libebl/eblcorenotetypename.c
+++ b/libebl/eblcorenotetypename.c
@@ -56,7 +56,6 @@
#include <stdio.h>
#include <libeblP.h>
-
const char *
ebl_core_note_type_name (ebl, type, buf, len)
Ebl *ebl;
@@ -101,6 +100,7 @@ ebl_core_note_type_name (ebl, type, buf, len)
KNOWNSTYPE (PPC_VMX);
KNOWNSTYPE (PPC_SPE);
KNOWNSTYPE (386_TLS);
+ KNOWNSTYPE (386_IOPERM);
#undef KNOWNSTYPE
default:
diff --git a/libelf/ChangeLog b/libelf/ChangeLog
index 18c34fcc..e8069db7 100644
--- a/libelf/ChangeLog
+++ b/libelf/ChangeLog
@@ -1,3 +1,11 @@
+2008-11-26 Roland McGrath <roland@redhat.com>
+
+ * elf.h: Update from glibc.
+
+2008-10-06 Roland McGrath <roland@redhat.com>
+
+ * elf_getarhdr.c (elf_getarhdr): Return NULL when passed NULL.
+
2008-08-27 Roland McGrath <roland@redhat.com>
* elf_begin.c (get_shnum): Avoid misaligned reads for matching endian.
diff --git a/libelf/elf.h b/libelf/elf.h
index a4134462..b4d34754 100644
--- a/libelf/elf.h
+++ b/libelf/elf.h
@@ -608,7 +608,9 @@ typedef struct
#define NT_PRXFPREG 0x46e62b7f /* Contains copy of user_fxsr_struct */
#define NT_PPC_VMX 0x100 /* PowerPC Altivec/VMX registers */
#define NT_PPC_SPE 0x101 /* PowerPC SPE/EVR registers */
+#define NT_PPC_VSX 0x102 /* PowerPC VSX registers */
#define NT_386_TLS 0x200 /* i386 TLS slots (struct user_desc) */
+#define NT_386_IOPERM 0x201 /* x86 io permission bitmap (1=deny) */
/* Legal values for the note segment descriptor types for object files. */
@@ -1397,6 +1399,7 @@ typedef struct
#define STO_MIPS_INTERNAL 0x1
#define STO_MIPS_HIDDEN 0x2
#define STO_MIPS_PROTECTED 0x3
+#define STO_MIPS_PLT 0x8
#define STO_MIPS_SC_ALIGN_UNUSED 0xff
/* MIPS specific values for `st_info'. */
@@ -1543,8 +1546,10 @@ typedef struct
#define R_MIPS_TLS_TPREL_HI16 49 /* TP-relative offset, high 16 bits */
#define R_MIPS_TLS_TPREL_LO16 50 /* TP-relative offset, low 16 bits */
#define R_MIPS_GLOB_DAT 51
+#define R_MIPS_COPY 126
+#define R_MIPS_JUMP_SLOT 127
/* Keep this the last entry. */
-#define R_MIPS_NUM 52
+#define R_MIPS_NUM 128
/* Legal values for p_type field of Elf32_Phdr. */
@@ -1610,7 +1615,13 @@ typedef struct
#define DT_MIPS_COMPACT_SIZE 0x7000002f /* (O32)Size of compact rel section. */
#define DT_MIPS_GP_VALUE 0x70000030 /* GP value for aux GOTs. */
#define DT_MIPS_AUX_DYNAMIC 0x70000031 /* Address of aux .dynamic. */
-#define DT_MIPS_NUM 0x32
+/* The address of .got.plt in an executable using the new non-PIC ABI. */
+#define DT_MIPS_PLTGOT 0x70000032
+/* The base of the PLT in an executable using the new non-PIC ABI if that
+ PLT is writable. For a non-writable PLT, this is omitted or has a zero
+ value. */
+#define DT_MIPS_RWPLT 0x70000034
+#define DT_MIPS_NUM 0x35
/* Legal values for DT_MIPS_FLAGS Elf32_Dyn entry. */
diff --git a/libelf/elf_getarhdr.c b/libelf/elf_getarhdr.c
index deeb56db..875b2a10 100644
--- a/libelf/elf_getarhdr.c
+++ b/libelf/elf_getarhdr.c
@@ -1,5 +1,5 @@
/* Read header of next archive member.
- Copyright (C) 1998, 1999, 2000, 2002 Red Hat, Inc.
+ Copyright (C) 1998, 1999, 2000, 2002, 2008 Red Hat, Inc.
This file is part of Red Hat elfutils.
Written by Ulrich Drepper <drepper@redhat.com>, 1998.
@@ -63,6 +63,9 @@ Elf_Arhdr *
elf_getarhdr (elf)
Elf *elf;
{
+ if (elf == NULL)
+ return NULL;
+
Elf *parent = elf->parent;
/* Calling this function is not ok for any file type but archives. */
@@ -78,7 +81,6 @@ elf_getarhdr (elf)
/* Something went wrong. Maybe there is no member left. */
return NULL;
-
/* We can be sure the parent is an archive. */
assert (parent->kind == ELF_K_AR);
diff --git a/src/ChangeLog b/src/ChangeLog
index 4ef23a22..fb17835f 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,8 @@
+2008-12-02 Roland McGrath <roland@redhat.com>
+
+ * readelf.c (count_dwflmod, process_file): Don't presume encoding of
+ nonzero OFFSET argument to dwfl_getmodules.
+
2008-08-07 Roland McGrath <roland@redhat.com>
* addr2line.c (main): Pass string to handle_address.
diff --git a/src/readelf.c b/src/readelf.c
index 7b599ec8..2797a849 100644
--- a/src/readelf.c
+++ b/src/readelf.c
@@ -459,8 +459,10 @@ count_dwflmod (Dwfl_Module *dwflmod __attribute__ ((unused)),
Dwarf_Addr base __attribute__ ((unused)),
void *arg)
{
- *(bool *) arg = false;
- return DWARF_CB_ABORT;
+ if (*(bool *) arg)
+ return DWARF_CB_ABORT;
+ *(bool *) arg = true;
+ return DWARF_CB_OK;
}
struct process_dwflmod_args
@@ -548,8 +550,11 @@ process_file (int fd, const char *fname, bool only_one)
dwfl_report_end (dwfl, NULL, NULL);
if (only_one)
- /* Clear ONLY_ONE if we have multiple modules, from an archive. */
- dwfl_getmodules (dwfl, &count_dwflmod, &only_one, 1);
+ {
+ /* Clear ONLY_ONE if we have multiple modules, from an archive. */
+ bool seen = false;
+ only_one = dwfl_getmodules (dwfl, &count_dwflmod, &seen, 0) == 0;
+ }
/* Process the one or more modules gleaned from this file. */
struct process_dwflmod_args a = { .fd = fd, .only_one = only_one };
diff --git a/tests/ChangeLog b/tests/ChangeLog
index 15e38181..b1471c1b 100644
--- a/tests/ChangeLog
+++ b/tests/ChangeLog
@@ -1,3 +1,15 @@
+2008-11-26 Roland McGrath <roland@redhat.com>
+
+ * dwfl-bug-getmodules.c: New file.
+ * Makefile.am (noinst_PROGRAMS): Add it.
+ (dwfl_bug_getmodules_LDADD): New variable.
+
+2008-09-10 Roland McGrath <roland@redhat.com>
+
+ * test-subr.sh (LC_ALL): Export it set to "C".
+ * run-dwfl-addr-sect.sh: Don't do it here.
+ * run-strings-test.sh: Likewise.
+
2008-08-21 Denys Vlasenko <dvlasenk@redhat.com>
* run-addrname-test.sh: Add a new case.
diff --git a/tests/Makefile.am b/tests/Makefile.am
index f57e4328..b533521c 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -59,7 +59,8 @@ 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 early-offscn
+ dwfl-addr-sect dwfl-bug-report early-offscn \
+ dwfl-bug-getmodules
# get-ciefde
asm_TESTS = asm-tst1 asm-tst2 asm-tst3 asm-tst4 asm-tst5 \
asm-tst6 asm-tst7 asm-tst8 asm-tst9
@@ -229,6 +230,7 @@ dwfl_bug_addr_overflow_LDADD = $(libdw) $(libebl) $(libelf) $(libmudflap) -ldl
arls_LDADD = $(libelf) $(libmudflap)
dwfl_bug_fd_leak_LDADD = $(libdw) $(libebl) $(libelf) $(libmudflap) -ldl
dwfl_bug_report_LDADD = $(libdw) $(libebl) $(libelf) $(libmudflap) -ldl
+dwfl_bug_getmodules_LDADD = $(libdw) $(libebl) $(libelf) $(libmudflap) -ldl
dwfl_addr_sect_LDADD = $(libdw) $(libebl) $(libelf) $(libmudflap) -ldl
sha1_tst_LDADD = $(libeu) $(libmudflap)
diff --git a/tests/dwfl-bug-getmodules.c b/tests/dwfl-bug-getmodules.c
new file mode 100644
index 00000000..f7042c02
--- /dev/null
+++ b/tests/dwfl-bug-getmodules.c
@@ -0,0 +1,74 @@
+/* Test program for dwfl_getmodules bug.
+ 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>. */
+
+#include <config.h>
+#include ELFUTILS_HEADER(dwfl)
+
+#include <error.h>
+
+static const Dwfl_Callbacks callbacks =
+ {
+ .find_elf = dwfl_linux_proc_find_elf,
+ .find_debuginfo = dwfl_standard_find_debuginfo,
+ };
+
+static int
+iterate (Dwfl_Module *mod __attribute__ ((unused)),
+ void **userdata __attribute__ ((unused)),
+ const char *name __attribute__ ((unused)),
+ Dwarf_Addr base, void *arg)
+{
+ if (base != 0x2000)
+ return DWARF_CB_OK;
+
+ if (dwfl_addrmodule (arg, 0x2100) == NULL)
+ error (1, 0, "dwfl_addrmodule: %s", dwfl_errmsg (-1));
+
+ return DWARF_CB_ABORT;
+}
+
+int
+main (void)
+{
+ Dwfl *dwfl = dwfl_begin (&callbacks);
+
+ dwfl_report_module (dwfl, "m1", 0, 0x1000);
+ dwfl_report_module (dwfl, "m2", 0x2000, 0x3000);
+ dwfl_report_module (dwfl, "m3", 0x4000, 0x5000);
+
+ dwfl_report_end (dwfl, NULL, NULL);
+
+ ptrdiff_t offset = dwfl_getmodules (dwfl, &iterate, dwfl, 0);
+ if (offset <= 0)
+ error (1, 0, "dwfl_getmodules: %s", dwfl_errmsg (-1));
+
+ offset = dwfl_getmodules (dwfl, &iterate, NULL, offset);
+ if (offset != 0)
+ error (1, 0, "dwfl_getmodules (%d): %s", (int) offset, dwfl_errmsg (-1));
+
+ dwfl_end (dwfl);
+
+ return 0;
+}
diff --git a/tests/run-dwfl-addr-sect.sh b/tests/run-dwfl-addr-sect.sh
index 69280f58..98666f37 100755
--- a/tests/run-dwfl-addr-sect.sh
+++ b/tests/run-dwfl-addr-sect.sh
@@ -1,5 +1,5 @@
#! /bin/sh
-# Copyright (C) 2007 Red Hat, Inc.
+# Copyright (C) 2007, 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
@@ -27,7 +27,6 @@
testfiles testfile43
-export LC_ALL=C
testrun_compare ./dwfl-addr-sect -e testfile43 0x64 0x8 0x98 <<\EOF
address 0x64 => module "" section 4 + 0
address 0x8 => module "" section 1 + 0x8
diff --git a/tests/run-strings-test.sh b/tests/run-strings-test.sh
index cfd9d236..a5dac634 100755
--- a/tests/run-strings-test.sh
+++ b/tests/run-strings-test.sh
@@ -1,5 +1,5 @@
#! /bin/sh
-# Copyright (C) 2005, 2006 Red Hat, Inc.
+# Copyright (C) 2005, 2006, 2008 Red Hat, Inc.
# This file is part of Red Hat elfutils.
# Written by Ulrich Drepper <drepper@redhat.com>, 2005.
#
@@ -29,9 +29,6 @@
files="testfile `seq 2 9 | while read n; do echo testfile$n; done`"
testfiles $files
-LC_ALL=C
-export LC_ALL
-
testrun_compare ../src/strings -tx -f $files <<\EOF
testfile: f4 /lib/ld-linux.so.2
testfile: 1c9 __gmon_start__
diff --git a/tests/test-subr.sh b/tests/test-subr.sh
index 7fda05a0..cb34b93b 100644
--- a/tests/test-subr.sh
+++ b/tests/test-subr.sh
@@ -1,5 +1,5 @@
#! /bin/sh
-# Copyright (C) 2005, 2007 Red Hat, Inc.
+# Copyright (C) 2005, 2007, 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
@@ -30,6 +30,9 @@
set -e
+#LC_ALL=C
+#export LC_ALL
+
remove_files=
trap 'rm -f $remove_files' 0