Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion recipes/libs/elfutils.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
inherit: [autotools]
inherit: [autotools, patch]

metaEnvironment:
PKG_VERSION: "0.194"
Expand All @@ -16,6 +16,10 @@ checkoutSCM:
digestSHA256: 09e2ff033d39baa8b388a2d7fbc5390bfde99ae3b7c67c7daaf7433fbcf0f01e
stripComponents: 1

checkoutDeterministic: True
checkoutScript: |
patchApplySeries $<@elfutils/*.patch@>

buildTools: [m4]
buildScript: |
mkdir -p all
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
From 1bee26c4d7d787eebbebca2a2ad3c5f3d06528a5 Mon Sep 17 00:00:00 2001
From: Aaron Merey <amerey@redhat.com>
Date: Mon, 27 Oct 2025 21:49:31 -0400
Subject: [PATCH] link_map.c: Declare name_no_sysroot only if openat2
RESOLVE_IN_ROOT is supported

Rename variable n to name_no_sysroot. Declare name_no_sysroot only if
openat2 RESOLVE_IN_ROOT is supported to avoid an unused variable warning.

https://sourceware.org/bugzilla/show_bug.cgi?id=33581

Signed-off-by: Aaron Merey <amerey@redhat.com>
---
libdwfl/link_map.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/libdwfl/link_map.c b/libdwfl/link_map.c
index 013a415d..5f934131 100644
--- a/libdwfl/link_map.c
+++ b/libdwfl/link_map.c
@@ -431,12 +431,14 @@ report_r_debug (uint_fast8_t elfclass, uint_fast8_t elfdata,

if (sysroot && !name_in_sysroot)
{
- const char *n = NULL;
-
if (asprintf (&sysroot_name, "%s%s", sysroot, name) < 0)
return release_buffer (&memory_closure, &buffer, &buffer_available, -1);

- n = name;
+#ifdef HAVE_OPENAT2_RESOLVE_IN_ROOT
+ /* The original name does not contain the sysroot as a prefix.
+ Save this for use with openat2. */
+ const char *name_no_sysroot = name;
+#endif
name = sysroot_name;

#ifdef HAVE_OPENAT2_RESOLVE_IN_ROOT
@@ -451,7 +453,8 @@ report_r_debug (uint_fast8_t elfclass, uint_fast8_t elfdata,
if (sysrootfd < 0)
return -1;

- fd = syscall (SYS_openat2, sysrootfd, n, &how, sizeof(how));
+ fd = syscall (SYS_openat2, sysrootfd, name_no_sysroot,
+ &how, sizeof(how));
err = fd < 0 ? -errno : 0;

close (sysrootfd);
--
2.43.7

Loading