summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Wielaard <mjw@redhat.com>2012-08-24 13:54:52 +0200
committerMark Wielaard <mjw@redhat.com>2012-08-24 15:33:55 +0200
commitf5519fc244d95dc04b3e3de88644d149a36a76b6 (patch)
tree249598c2b1c7361b2f4403b376f54e490f73ba17
parent27751ed257ad74d1c2360c7cb8d1e0f965682773 (diff)
downloadelfutils-f5519fc244d95dc04b3e3de88644d149a36a76b6.tar.gz
Don't include dwz support by default.
By default the dwz multi file support is not included. This means any DW_FORM_GNU_ref_alt or DW_FORM_GNU_strp_alt encountered in libdw will just produce an error message. A new configure option --enable-dwz is needed to include it for those we wish to test it. The dwz test is also disabled by default. Signed-off-by: Mark Wielaard <mjw@redhat.com>
-rw-r--r--ChangeLog4
-rw-r--r--NEWS4
-rw-r--r--configure.ac8
-rw-r--r--libdw/ChangeLog7
-rw-r--r--libdw/dwarf_begin_elf.c5
-rw-r--r--libdw/libdwP.h3
-rw-r--r--tests/ChangeLog5
-rw-r--r--tests/Makefile.am6
8 files changed, 38 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 5842492b..89fea8ff 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2012-08-24 Mark Wielaard <mjw@redhat.com>
+
+ * configure.ac: Add --enable-dwz check, defaults to no.
+
2012-07-24 Mark Wielaard <mjw@redhat.com>
* TODO: Add note on shdrs after elf_cntl (ELF_C_FDREAD).
diff --git a/NEWS b/NEWS
index 610253d6..c92f55c5 100644
--- a/NEWS
+++ b/NEWS
@@ -9,7 +9,9 @@ libdw: dwarf.h corrected the DW_LANG_ObjC constant name (was DW_LANG_Objc).
Any existing sources using the old name will have to be updated.
Add DW_MACRO_GNU .debug_macro type encodings constants, DW_ATE_UTF
and DW_OP_GNU_parameter_ref to dwarf.h.
- Support for DWZ multifile forms DW_FORM_GNU_ref_alt/strp_alt.
+ Experimental support for DWZ multifile forms DW_FORM_GNU_ref_alt
+ and DW_FORM_GNU_strp_alt. Disabled by default. Use configure
+ --enable-dwz to test it.
readelf: Add .debug_macro parsing support.
Add .gdb_index version 7 parsing support.
diff --git a/configure.ac b/configure.ac
index 79324897..dbd3efc0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -67,6 +67,14 @@ AS_IF([test "$use_locks" = yes], [AC_DEFINE(USE_LOCKS)])
AH_TEMPLATE([USE_LOCKS], [Defined if libraries should be thread-safe.])
+AC_ARG_ENABLE([dwz],
+AS_HELP_STRING([--enable-dwz], [enable experimental GNU ref_alt FORM, dwz multi file support in libdw]),
+enable_dwz=$enableval, enable_dwz=no)
+AM_CONDITIONAL(ENABLE_DWZ, test "$enable_dwz" = yes)
+AS_IF([test "$enable_dwz" = yes], [AC_DEFINE(ENABLE_DWZ)])
+
+AH_TEMPLATE([ENABLE_DWZ], [Defined if libdw should support GNU ref_alt FORM, dwz multi files.])
+
AC_PROG_CC
AC_PROG_RANLIB
AC_PROG_YACC
diff --git a/libdw/ChangeLog b/libdw/ChangeLog
index 89009f04..416a16f1 100644
--- a/libdw/ChangeLog
+++ b/libdw/ChangeLog
@@ -1,3 +1,10 @@
+2012-08-24 Mark Wielaard <mjw@redhat.com>
+
+ * dwarf_begin_elf.c (check_section): Only probe for dwz multi files
+ when ENABLE_DWZ is defined.
+ * libdwP.h (__check_build_id): Only declare when ENABLE_DWZ is
+ defined.
+
2012-08-16 Mark Wielaard <mjw@redhat.com>
* Makefile.am (EXTRA_DIST): Add known-dwarf.h.
diff --git a/libdw/dwarf_begin_elf.c b/libdw/dwarf_begin_elf.c
index fd957701..a9c826ce 100644
--- a/libdw/dwarf_begin_elf.c
+++ b/libdw/dwarf_begin_elf.c
@@ -71,6 +71,7 @@ static const char dwarf_scnnames[IDX_last][17] =
};
#define ndwarf_scnnames (sizeof (dwarf_scnnames) / sizeof (dwarf_scnnames[0]))
+#ifdef ENABLE_DWZ
internal_function int
__check_build_id (Dwarf *dw, const uint8_t *build_id, const size_t id_len)
{
@@ -175,6 +176,7 @@ open_debugaltlink (Dwarf *result, const char *alt_name,
result->alt_dwarf = NULL;
return result;
}
+#endif /* ENABLE_DWZ */
static Dwarf *
check_section (Dwarf *result, GElf_Ehdr *ehdr, Elf_Scn *scn, bool inscngrp)
@@ -219,6 +221,7 @@ check_section (Dwarf *result, GElf_Ehdr *ehdr, Elf_Scn *scn, bool inscngrp)
return NULL;
}
+#ifdef ENABLE_DWZ
/* For dwz multifile support, ignore if it looks wrong. */
if (strcmp (scnname, ".gnu_debugaltlink") == 0)
{
@@ -232,7 +235,7 @@ check_section (Dwarf *result, GElf_Ehdr *ehdr, Elf_Scn *scn, bool inscngrp)
return open_debugaltlink (result, alt_name, build_id + 1, id_len);
}
}
-
+#endif /* ENABLE_DWZ */
/* Recognize the various sections. Most names start with .debug_. */
size_t cnt;
diff --git a/libdw/libdwP.h b/libdw/libdwP.h
index da82e5d2..76bddffa 100644
--- a/libdw/libdwP.h
+++ b/libdw/libdwP.h
@@ -624,12 +624,13 @@ unsigned char * __libdw_formptr (Dwarf_Attribute *attr, int sec_index,
Dwarf_Off *offsetp)
internal_function;
+#ifdef ENABLE_DWZ
/* Checks that the build_id of the underlying Elf matches the expected.
Returns zero on match, -1 on error or no build_id found or 1 when
build_id doesn't match. */
int __check_build_id (Dwarf *dw, const uint8_t *build_id, const size_t id_len)
internal_function;
-
+#endif /* ENABLE_DWZ */
/* Aliases to avoid PLTs. */
diff --git a/tests/ChangeLog b/tests/ChangeLog
index f0c83e64..825b98a5 100644
--- a/tests/ChangeLog
+++ b/tests/ChangeLog
@@ -1,3 +1,8 @@
+2012-08-24 Mark Wielaard <mjw@redhat.com>
+
+ * Makefile.am (TESTS): Only add run-readelf-dwz-multi.sh if
+ ENABLE_DWZ.
+
2012-08-16 Mark Wielaard <mjw@redhat.com>
* allregs.c (dwarf_encoding_string): Rewritten using known-dwarf
diff --git a/tests/Makefile.am b/tests/Makefile.am
index df66db6e..724d8662 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -73,7 +73,7 @@ TESTS = run-arextract.sh run-arsymtest.sh newfile test-nlist \
run-nm-self.sh run-readelf-self.sh \
run-readelf-test1.sh run-readelf-test2.sh run-readelf-test3.sh \
run-readelf-test4.sh run-readelf-twofiles.sh \
- run-readelf-macro.sh run-readelf-dwz-multi.sh \
+ run-readelf-macro.sh \
run-native-test.sh run-bug1-test.sh \
dwfl-bug-addr-overflow run-addrname-test.sh \
dwfl-bug-fd-leak dwfl-bug-report \
@@ -96,6 +96,10 @@ check_PROGRAMS += $(asm_TESTS)
TESTS += $(asm_TESTS)
endif
+if ENABLE_DWZ
+TESTS += run-readelf-dwz-multi.sh
+endif
+
EXTRA_DIST = run-arextract.sh run-arsymtest.sh \
run-show-die-info.sh run-get-files.sh run-get-lines.sh \