From: Mark Wielaard <mark@klomp.org>
Date: Sat, 2 Mar 2024 23:45:34 +0000 (+0100)
Subject: libdw: Don't use INTUSE in libdwP.h str_offsets_base_off
X-Git-Url: https://sourceware.org/git/?p=elfutils.git;a=commitdiff_plain;h=7cf4586e5b429c0fa74d3ae73f49e6cda6660e93;hp=18a015c0b0787ba5acb39801ab7c17dac50f584d

libdw: Don't use INTUSE in libdwP.h str_offsets_base_off

readelf.c cheats and include libdwP.h, which is an internal only
header of libdw. It really shouldn't do that, but there are some
internals that readelf currently needs. The str_offsets_base_off
function used by readelf uses INTUSE when calling dwarf_get_units.
This is a micro optimization useful inside libdw so a public
function can be called directly, skipping a PLT call. This can
cause issues linking readelf since it might not be able to call
the internal function, since readelf.c isn't part of libdw itself.
Just drop the INTUSE.

	* libdw/libdwP.h (str_offsets_base_off): Don't use INTUSE
	when calling dwarf_get_units.

Signed-off-by: Mark Wielaard <mark@klomp.org>
---

diff --git a/libdw/libdwP.h b/libdw/libdwP.h
index 8b2f06fa5..c1c84ed35 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;
     }
 
