[Bug,general/31439] error: undefined reference to '__dwarf_get_units_internal'

Message ID bug-31439-10460-pzwPqZi6sp@http.sourceware.org/bugzilla/
State Committed
Headers
Series [Bug,general/31439] error: undefined reference to '__dwarf_get_units_internal' |

Commit Message

dodji at seketeli dot org March 2, 2024, 2:09 p.m. UTC
  https://sourceware.org/bugzilla/show_bug.cgi?id=31439

Mark Wielaard <mark at klomp dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mark at klomp dot org

--- Comment #1 from Mark Wielaard <mark at klomp dot org> ---
I don't fully understand how you are building, and I cannot replicate, but it
seems something goes wrong with readelf.c using the libdwP.h "internals"
header. Does the following patch help?
  

Patch

diff --git a/libdw/libdwP.h b/libdw/libdwP.h
index 8b2f06fa5937..c1c84ed3567d 100644
--- a/libdw/libdwP.h
+++ b/libdw/libdwP.h
@@ -1153,8 +1153,7 @@  str_offsets_base_off (Dwarf *dbg, Dwarf_CU *cu)
   if (cu == NULL && dbg != NULL)
     {
       Dwarf_CU *first_cu;
-      if (INTUSE(dwarf_get_units) (dbg, NULL, &first_cu,
-                                  NULL, NULL, NULL, NULL) == 0)
+      if (dwarf_get_units (dbg, NULL, &first_cu, NULL, NULL, NULL, NULL) == 0)
        cu = first_cu;
     }