summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--dwflpp.cxx2
-rw-r--r--dwflpp.h7
-rw-r--r--tapsets.cxx6
3 files changed, 11 insertions, 4 deletions
diff --git a/dwflpp.cxx b/dwflpp.cxx
index 61627e16..5991d1a1 100644
--- a/dwflpp.cxx
+++ b/dwflpp.cxx
@@ -2316,7 +2316,7 @@ dwflpp::get_blacklist_section(Dwarf_Addr addr)
{
Elf_Scn* scn = 0;
size_t shstrndx;
- dwfl_assert ("getshstrndx", elf_getshstrndx (elf, &shstrndx));
+ dwfl_assert ("getshdrstrndx", elf_getshdrstrndx (elf, &shstrndx));
while ((scn = elf_nextscn (elf, scn)) != NULL)
{
GElf_Shdr shdr_mem;
diff --git a/dwflpp.h b/dwflpp.h
index 9cd2cb59..7260c417 100644
--- a/dwflpp.h
+++ b/dwflpp.h
@@ -25,6 +25,13 @@
extern "C" {
#include <elfutils/libdwfl.h>
+#ifdef HAVE_ELFUTILS_VERSION_H
+ #include <elfutils/version.h>
+ #if !_ELFUTILS_PREREQ(0,142)
+ // Always use newer name, old name is deprecated in 0.142.
+ #define elf_getshdrstrndx elf_getshstrndx
+ #endif
+#endif
#include <regex.h>
}
diff --git a/tapsets.cxx b/tapsets.cxx
index 7aee6930..6be7de11 100644
--- a/tapsets.cxx
+++ b/tapsets.cxx
@@ -699,7 +699,7 @@ dwarf_builder::probe_table::probe_table(string& mark_name, systemtap_session & s
elf = dwfl_module_getelf (dw->module, &bias);
Elf_Scn *probe_scn = NULL;
- dwfl_assert ("getshstrndx", elf_getshstrndx (elf, &shstrndx));
+ dwfl_assert ("getshdrstrndx", elf_getshdrstrndx (elf, &shstrndx));
have_probes = false;
@@ -723,7 +723,7 @@ dwarf_builder::probe_table::probe_table(string& mark_name, systemtap_session & s
elf = dwarf_getelf (dwfl_module_getdwarf (dw->module, &bias));
if (! elf)
return;
- dwfl_assert ("getshstrndx", elf_getshstrndx (elf, &shstrndx));
+ dwfl_assert ("getshdrstrndx", elf_getshdrstrndx (elf, &shstrndx));
probe_scn = NULL;
while ((probe_scn = elf_nextscn (elf, probe_scn)))
{
@@ -3702,7 +3702,7 @@ symbol_table::prepare_section_rejection(Dwfl_Module *mod)
if (!elf)
return;
- if (elf_getshstrndx(elf, &shstrndx) != 0)
+ if (elf_getshdrstrndx (elf, &shstrndx) != 0)
return;
while ((scn = elf_nextscn(elf, scn)) != NULL)
{