[Bug libdw/26177] eu-unstrip -n -k fails on kernels 4.14-4.19

mark at klomp dot org sourceware-bugzilla@sourceware.org
Sat Jun 27 23:07:48 GMT 2020


Mark Wielaard <mark at klomp dot org> changed:

           What    |Removed                     |Added
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2020-06-27
                 CC|                            |mark at klomp dot org
     Ever confirmed|0                           |1

--- Comment #1 from Mark Wielaard <mark at klomp dot org> ---
Thanks for the analysis. These __entry_SYSCALL_64_trampoline are really odd.
Your suggested fix works, but I would like to not depend on the specific symbol
name if at all possible.

Ad you say the problem is that they come after the last kernel address, but
before the module addresses. And they are smaller than the start address we

The following check that the address read is larger than the start address we
found seems to fix it for me. Does it work for you?

diff --git a/libdwfl/linux-kernel-modules.c b/libdwfl/linux-kernel-modules.c
index 84a05f28..5e6cf275 100644
--- a/libdwfl/linux-kernel-modules.c
+++ b/libdwfl/linux-kernel-modules.c
@@ -538,10 +538,14 @@ intuit_kernel_bounds (Dwarf_Addr *start, Dwarf_Addr *end,
Dwarf_Addr *notes)

   if (result == 0)
+      Dwarf_Addr addr;
       *end = *start;
-      while (read_address (&state, end))
-       if (*notes == 0 && !strcmp (state.p, "__start_notes\n"))
-         *notes = *end;
+      while (read_address (&state, &addr) && addr >= *start)
+       {
+         *end = addr;
+         if (*notes == 0 && !strcmp (state.p, "__start_notes\n"))
+           *notes = *end;
+       }

       Dwarf_Addr round_kernel = sysconf (_SC_PAGESIZE);
       *start &= -(Dwarf_Addr) round_kernel;

You are receiving this mail because:
You are on the CC list for the bug.

More information about the Elfutils-devel mailing list