+2020-05-08 Mark Wielaard <mark@klomp.org>
+
+ * libdw_visit_scopes.c (walk_children): Don't recurse into imported
+ DW_TAG_compile_units.
+
2020-05-08 Mark Wielaard <mark@klomp.org>
* dwarf_decl_file.c (dwarf_decl_file): Use attr CU instead of DIE
Dwarf_Attribute *attr = INTUSE(dwarf_attr) (&state->child.die,
DW_AT_import,
&attr_mem);
+ /* Some gcc -flto versions imported other top-level compile units,
+ skip those. */
if (INTUSE(dwarf_formref_die) (attr, &state->child.die) != NULL
- && INTUSE(dwarf_child) (&state->child.die, &state->child.die) == 0)
+ && INTUSE(dwarf_tag) (&state->child.die) != DW_TAG_compile_unit
+ && (INTUSE(dwarf_child) (&state->child.die, &state->child.die)
+ == 0))
{
/* Checks the given DIE hasn't been imported yet
to prevent cycles. */
+2020-05-05 Mark Wielaard <mark@klomp.org>
+
+ * testfile-lto-gcc8.bz2: New test file.
+ * testfile-lto-gcc9.bz2: Likewise.
+ * Makefile.am (EXTRA_DIST): Add testfile-lto-gcc8.bz2 and
+ testfile-lto-gcc9.bz2.
+ * run-allfcts.sh: Add testfile-lto-gcc9 and testfile-lto-gcc8
+ tests.
+
2020-05-05 Mark Wielaard <mark@klomp.org>
* testfile-lto-gcc10.bz2: New test file.
testfile13.bz2 run-strip-test3.sh run-allfcts.sh \
testfile_class_func.bz2 testfile_nested_funcs.bz2 \
testfile-lto-gcc10.bz2 \
+ testfile-lto-gcc9.bz2 testfile-lto-gcc8.bz2 \
run-line2addr.sh run-elflint-test.sh testfile14.bz2 \
run-strip-test4.sh run-strip-test5.sh run-strip-test6.sh \
run-strip-test7.sh run-strip-test8.sh run-strip-groups.sh \
/home/mark/src/tests/testfile-lto-main.c:6:main
EOF
+# Using gcc (GCC) 8.3.1 20190311 (Red Hat 8.3.1-3)
+# gcc -g -O2 -flto -c testfile-lto-func.c
+# gcc -g -O2 -flto -c testfile-lto-main.c
+# gcc -g -O2 -flto -o testfile-lto-gcc8 testfile-lto-func.o testfile-lto-main.o
+
+testfiles testfile-lto-gcc8
+
+testrun_compare ${abs_builddir}/allfcts testfile-lto-gcc8 <<\EOF
+/home/mark/src/tests/testfile-lto-func.c:4:foo
+/home/mark/src/tests/testfile-lto-main.c:6:main
+/home/mark/src/tests/testfile-lto-main.c:6:main
+/home/mark/src/tests/testfile-lto-func.c:4:foo
+EOF
+
+# gcc (GCC) 9.1.1 20190605 (Red Hat 9.1.1-2)
+# gcc -g -O2 -flto -c testfile-lto-func.c
+# gcc -g -O2 -flto -c testfile-lto-main.c
+# gcc -g -O2 -flto -o testfile-lto-gcc9 testfile-lto-func.o testfile-lto-main.o
+
+testfiles testfile-lto-gcc9
+
+testrun_compare ${abs_builddir}/allfcts testfile-lto-gcc9 <<\EOF
+/home/mark/src/tests/testfile-lto-main.c:6:main
+/home/mark/src/tests/testfile-lto-func.c:4:foo
+/home/mark/src/tests/testfile-lto-main.c:6:main
+EOF
+
exit 0