Compare commits

...

No commits in common. 'c9' and 'cs10' have entirely different histories.
c9 ... cs10

@ -1 +1 @@
a4b4a20bf3976e71c280b6dfb8443dbdcdd3f2f0 SOURCES/elfutils-0.189.tar.bz2
2dbae5652dcf5927213df0058969a62070dfa56e SOURCES/elfutils-0.192.tar.bz2

2
.gitignore vendored

@ -1 +1 @@
SOURCES/elfutils-0.189.tar.bz2
SOURCES/elfutils-0.192.tar.bz2

@ -0,0 +1,35 @@
diff --git a/libelf/gelf_getnote.c b/libelf/gelf_getnote.c
index 0f7b9d68..6ef970c5 100644
--- a/libelf/gelf_getnote.c
+++ b/libelf/gelf_getnote.c
@@ -31,6 +31,7 @@
#endif
#include <assert.h>
+#include <byteswap.h>
#include <gelf.h>
#include <string.h>
@@ -73,6 +74,22 @@ gelf_getnote (Elf_Data *data, size_t offset, GElf_Nhdr *result,
offset = 0;
else
{
+ /* Workaround FDO package notes on big-endian systems,
+ getting namesz and descsz wrong. Detect it by getting
+ a bad namesz, descsz and byte swapped n_type for
+ NT_FDO_PACKAGING_METADATA. */
+ if (unlikely (n->n_type == bswap_32 (NT_FDO_PACKAGING_METADATA)
+ && n->n_namesz > data->d_size
+ && n->n_descsz > data->d_size))
+ {
+ /* n might not be writable, use result and redirect n. */
+ *result = *n;
+ result->n_type = bswap_32 (n->n_type);
+ result->n_namesz = bswap_32 (n->n_namesz);
+ result->n_descsz = bswap_32 (n->n_descsz);
+ n = result;
+ }
+
/* This is slightly tricky, offset is guaranteed to be 4
byte aligned, which is what we need for the name_offset.
And normally desc_offset is also 4 byte aligned, but not

@ -1,73 +0,0 @@
diff --git a/debuginfod/debuginfod-client.c b/debuginfod/debuginfod-client.c
index ef4d47e3..d92d8d62 100644
--- a/debuginfod/debuginfod-client.c
+++ b/debuginfod/debuginfod-client.c
@@ -248,7 +248,7 @@ debuginfod_write_callback (char *ptr, size_t size, size_t nmemb, void *data)
/* handle config file read and write */
static int
-debuginfod_config_cache(char *config_path,
+debuginfod_config_cache(debuginfod_client *c, char *config_path,
long cache_config_default_s,
struct stat *st)
{
@@ -277,17 +277,27 @@ debuginfod_config_cache(char *config_path,
}
long cache_config;
+ /* PR29696 - NB: When using fdopen, the file descriptor is NOT
+ dup'ed and will be closed when the stream is closed. Manually
+ closing fd after fclose is called will lead to a race condition
+ where, if reused, the file descriptor will compete for its
+ regular use before being incorrectly closed here. */
FILE *config_file = fdopen(fd, "r");
if (config_file)
{
if (fscanf(config_file, "%ld", &cache_config) != 1)
- cache_config = cache_config_default_s;
- fclose(config_file);
+ cache_config = cache_config_default_s;
+ if (0 != fclose (config_file) && c->verbose_fd >= 0)
+ dprintf (c->verbose_fd, "fclose failed with %s (err=%d)\n",
+ strerror (errno), errno);
}
else
- cache_config = cache_config_default_s;
-
- close (fd);
+ {
+ cache_config = cache_config_default_s;
+ if (0 != close (fd) && c->verbose_fd >= 0)
+ dprintf (c->verbose_fd, "close failed with %s (err=%d)\n",
+ strerror (errno), errno);
+ }
return cache_config;
}
@@ -303,7 +313,7 @@ debuginfod_clean_cache(debuginfod_client *c,
struct stat st;
/* Create new interval file. */
- rc = debuginfod_config_cache(interval_path,
+ rc = debuginfod_config_cache(c, interval_path,
cache_clean_default_interval_s, &st);
if (rc < 0)
return rc;
@@ -320,7 +330,7 @@ debuginfod_clean_cache(debuginfod_client *c,
utime (interval_path, NULL);
/* Read max unused age value from config file. */
- rc = debuginfod_config_cache(max_unused_path,
+ rc = debuginfod_config_cache(c, max_unused_path,
cache_default_max_unused_age_s, &st);
if (rc < 0)
return rc;
@@ -1110,7 +1135,7 @@ debuginfod_query_server (debuginfod_client *c,
close(fd); /* no need to hold onto the negative-hit file descriptor */
- rc = debuginfod_config_cache(cache_miss_path,
+ rc = debuginfod_config_cache(c, cache_miss_path,
cache_miss_default_s, &st);
if (rc < 0)
goto out;

@ -1,224 +0,0 @@
From 3aca5b5f1f1617db2220022d9061dcaf129e54c4 Mon Sep 17 00:00:00 2001
From: Mark Wielaard <mark@klomp.org>
Date: Wed, 21 Jun 2023 18:05:12 +0200
Subject: [PATCH] libelf: Replace list of elf_getdata_rawchunk results with a
tree
elf_getdata_rawchunks did a linear search to see if a chunk was
already fetched. Replace this list with a binary search tree to make
lookup faster when a lot of Elf_Data_Chunk were created.
* libelf/libelfP.h (Elf_Data_Chunk): Remove next field.
(struct Elf): Change the rawchunks type from Elf_Data_Chunk *
to void *.
* elf_getdata_rawchunk.c (chunk_compare): New static function.
(elf_getdata_rawchunk): Use tsearch instead of a manual linked
list.
* elf_end.c (free_chunk): New static function.
(elf_end): Call tdestroy instead of walking linked list.
Signed-off-by: Mark Wielaard <mark@klomp.org>
---
libelf/elf_end.c | 22 +++++++++-------
libelf/elf_getdata_rawchunk.c | 47 +++++++++++++++++++++++++----------
libelf/libelfP.h | 13 ++++------
3 files changed, 52 insertions(+), 30 deletions(-)
diff --git a/libelf/elf_end.c b/libelf/elf_end.c
index 5c451f36..3e5d4c86 100644
--- a/libelf/elf_end.c
+++ b/libelf/elf_end.c
@@ -1,5 +1,6 @@
/* Free resources associated with Elf descriptor.
Copyright (C) 1998,1999,2000,2001,2002,2004,2005,2007,2015,2016 Red Hat, Inc.
+ Copyright (C) 2023 Mark J. Wielaard <mark@klomp.org>
This file is part of elfutils.
Written by Ulrich Drepper <drepper@redhat.com>, 1998.
@@ -32,12 +33,22 @@
#endif
#include <assert.h>
+#include <search.h>
#include <stddef.h>
#include <stdlib.h>
#include "libelfP.h"
+static void
+free_chunk (void *n)
+{
+ Elf_Data_Chunk *rawchunk = (Elf_Data_Chunk *)n;
+ if (rawchunk->dummy_scn.flags & ELF_F_MALLOCED)
+ free (rawchunk->data.d.d_buf);
+ free (rawchunk);
+}
+
int
elf_end (Elf *elf)
{
@@ -112,20 +123,13 @@ elf_end (Elf *elf)
case ELF_K_ELF:
{
- Elf_Data_Chunk *rawchunks
+ void *rawchunks
= (elf->class == ELFCLASS32
|| (offsetof (struct Elf, state.elf32.rawchunks)
== offsetof (struct Elf, state.elf64.rawchunks))
? elf->state.elf32.rawchunks
: elf->state.elf64.rawchunks);
- while (rawchunks != NULL)
- {
- Elf_Data_Chunk *next = rawchunks->next;
- if (rawchunks->dummy_scn.flags & ELF_F_MALLOCED)
- free (rawchunks->data.d.d_buf);
- free (rawchunks);
- rawchunks = next;
- }
+ tdestroy (rawchunks, free_chunk);
Elf_ScnList *list = (elf->class == ELFCLASS32
|| (offsetof (struct Elf, state.elf32.scns)
diff --git a/libelf/elf_getdata_rawchunk.c b/libelf/elf_getdata_rawchunk.c
index 5a35ccdc..cfd40396 100644
--- a/libelf/elf_getdata_rawchunk.c
+++ b/libelf/elf_getdata_rawchunk.c
@@ -1,6 +1,6 @@
/* Return converted data from raw chunk of ELF file.
Copyright (C) 2007, 2014, 2015 Red Hat, Inc.
- Copyright (C) 2022 Mark J. Wielaard <mark@klomp.org>
+ Copyright (C) 2022, 2023 Mark J. Wielaard <mark@klomp.org>
This file is part of elfutils.
This file is free software; you can redistribute it and/or modify
@@ -33,12 +33,28 @@
#include <assert.h>
#include <errno.h>
+#include <search.h>
#include <stdlib.h>
#include <string.h>
#include "libelfP.h"
#include "common.h"
+static int
+chunk_compare (const void *a, const void *b)
+{
+ Elf_Data_Chunk *da = (Elf_Data_Chunk *)a;
+ Elf_Data_Chunk *db = (Elf_Data_Chunk *)b;
+
+ if (da->offset != db->offset)
+ return da->offset - db->offset;
+
+ if (da->data.d.d_size != db->data.d.d_size)
+ return da->data.d.d_size - db->data.d.d_size;
+
+ return da->data.d.d_type - db->data.d.d_type;
+}
+
Elf_Data *
elf_getdata_rawchunk (Elf *elf, int64_t offset, size_t size, Elf_Type type)
{
@@ -75,19 +91,25 @@ elf_getdata_rawchunk (Elf *elf, int64_t offset, size_t size, Elf_Type type)
rwlock_rdlock (elf->lock);
/* Maybe we already got this chunk? */
- Elf_Data_Chunk *rawchunks = elf->state.elf.rawchunks;
- while (rawchunks != NULL)
+ Elf_Data_Chunk key;
+ key.offset = offset;
+ key.data.d.d_size = size;
+ key.data.d.d_type = type;
+ Elf_Data_Chunk **found = tsearch (&key, &elf->state.elf.rawchunks,
+ &chunk_compare);
+ if (found == NULL)
+ goto nomem;
+
+ /* Existing entry. */
+ if (*found != &key && *found != NULL)
{
- if ((rawchunks->offset == offset || size == 0)
- && rawchunks->data.d.d_size == size
- && rawchunks->data.d.d_type == type)
- {
- result = &rawchunks->data.d;
- goto out;
- }
- rawchunks = rawchunks->next;
+ result = &(*found)->data.d;
+ goto out;
}
+ /* New entry. */
+ *found = NULL;
+
size_t align = __libelf_type_align (elf->class, type);
if (elf->map_address != NULL)
{
@@ -189,8 +211,7 @@ elf_getdata_rawchunk (Elf *elf, int64_t offset, size_t size, Elf_Type type)
rwlock_unlock (elf->lock);
rwlock_wrlock (elf->lock);
- chunk->next = elf->state.elf.rawchunks;
- elf->state.elf.rawchunks = chunk;
+ *found = chunk;
result = &chunk->data.d;
out:
diff --git a/libelf/libelfP.h b/libelf/libelfP.h
index 6624f38a..d3c241e5 100644
--- a/libelf/libelfP.h
+++ b/libelf/libelfP.h
@@ -1,5 +1,6 @@
/* Internal interfaces for libelf.
Copyright (C) 1998-2010, 2015, 2016 Red Hat, Inc.
+ Copyright (C) 2023 Mark J. Wielaard <mark@klomp.org>
This file is part of elfutils.
Contributed by Ulrich Drepper <drepper@redhat.com>, 1998.
@@ -262,11 +263,7 @@ typedef struct Elf_ScnList
typedef struct Elf_Data_Chunk
{
Elf_Data_Scn data;
- union
- {
- Elf_Scn dummy_scn;
- struct Elf_Data_Chunk *next;
- };
+ Elf_Scn dummy_scn;
int64_t offset; /* The original raw offset in the Elf image. */
} Elf_Data_Chunk;
@@ -324,7 +321,7 @@ struct Elf
Elf_ScnList *scns_last; /* Last element in the section list.
If NULL the data has not yet been
read from the file. */
- Elf_Data_Chunk *rawchunks; /* List of elf_getdata_rawchunk results. */
+ void *rawchunks; /* Tree of elf_getdata_rawchunk results. */
unsigned int scnincr; /* Number of sections allocate the last
time. */
int ehdr_flags; /* Flags (dirty) for ELF header. */
@@ -343,7 +340,7 @@ struct Elf
Elf_ScnList *scns_last; /* Last element in the section list.
If NULL the data has not yet been
read from the file. */
- Elf_Data_Chunk *rawchunks; /* List of elf_getdata_rawchunk results. */
+ void *rawchunks; /* Tree of elf_getdata_rawchunk results. */
unsigned int scnincr; /* Number of sections allocate the last
time. */
int ehdr_flags; /* Flags (dirty) for ELF header. */
@@ -368,7 +365,7 @@ struct Elf
Elf_ScnList *scns_last; /* Last element in the section list.
If NULL the data has not yet been
read from the file. */
- Elf_Data_Chunk *rawchunks; /* List of elf_getdata_rawchunk results. */
+ void *rawchunks; /* Tree of elf_getdata_rawchunk results. */
unsigned int scnincr; /* Number of sections allocate the last
time. */
int ehdr_flags; /* Flags (dirty) for ELF header. */
--
2.40.1

@ -1,95 +0,0 @@
From ef9164520c81ea61efe88777a8ad61bf17a54201 Mon Sep 17 00:00:00 2001
From: Mark Wielaard <mark@klomp.org>
Date: Sat, 22 Apr 2023 01:26:17 +0200
Subject: [PATCH] elfcompress: Don't compress if section already compressed
unless forced
Before commit a5b07cdf9 "support ZSTD compression algorithm"
elfcompress would not try to compress a section if it already
had the requested compression type (or was already uncompressed)
unless the --force flag was given. An else if construct was changed
to an if in the commit causing elfcompress to warn (in verbose mode)
but then still try to (re)compress the section.
Add an explicit check so if nothing needs (un)compressing, the file
isn't changed.
The diff looks large, but git diff -b -w is just:
+ if (force || type != schtype)
+ {
if (shdr->sh_type != SHT_NOBITS
&& (shdr->sh_flags & SHF_ALLOC) == 0)
{
@@ -554,6 +556,7 @@ process_file (const char *fname)
printf ("[%zd] %s ignoring %s section\n", ndx, sname,
(shdr->sh_type == SHT_NOBITS ? "no bits" : "allocated"));
}
+ }
Signed-off-by: Mark Wielaard <mark@klomp.org>
---
src/elfcompress.c | 43 +++++++++++++++++++++++--------------------
1 file changed, 23 insertions(+), 20 deletions(-)
diff --git a/src/elfcompress.c b/src/elfcompress.c
index 18ade66f..f771b92a 100644
--- a/src/elfcompress.c
+++ b/src/elfcompress.c
@@ -529,30 +529,33 @@ process_file (const char *fname)
}
}
- if (shdr->sh_type != SHT_NOBITS
- && (shdr->sh_flags & SHF_ALLOC) == 0)
+ if (force || type != schtype)
{
- set_section (sections, ndx);
- /* Check if we might want to change this section name. */
- if (! adjust_names
- && ((type != ZLIB_GNU
- && startswith (sname, ".zdebug"))
- || (type == ZLIB_GNU
- && startswith (sname, ".debug"))))
- adjust_names = true;
-
- /* We need a buffer this large if we change the names. */
- if (adjust_names)
+ if (shdr->sh_type != SHT_NOBITS
+ && (shdr->sh_flags & SHF_ALLOC) == 0)
{
- size_t slen = strlen (sname);
- if (slen > maxnamelen)
- maxnamelen = slen;
+ set_section (sections, ndx);
+ /* Check if we might want to change this section name. */
+ if (! adjust_names
+ && ((type != ZLIB_GNU
+ && startswith (sname, ".zdebug"))
+ || (type == ZLIB_GNU
+ && startswith (sname, ".debug"))))
+ adjust_names = true;
+
+ /* We need a buffer this large if we change the names. */
+ if (adjust_names)
+ {
+ size_t slen = strlen (sname);
+ if (slen > maxnamelen)
+ maxnamelen = slen;
+ }
}
+ else
+ if (verbose >= 0)
+ printf ("[%zd] %s ignoring %s section\n", ndx, sname,
+ (shdr->sh_type == SHT_NOBITS ? "no bits" : "allocated"));
}
- else
- if (verbose >= 0)
- printf ("[%zd] %s ignoring %s section\n", ndx, sname,
- (shdr->sh_type == SHT_NOBITS ? "no bits" : "allocated"));
}
if (shdr->sh_type == SHT_SYMTAB)
--
2.31.1

@ -0,0 +1,36 @@
From 0a65a54593ae489d40cb993caa74095d45bc47fd Mon Sep 17 00:00:00 2001
From: Mark Wielaard <mark@klomp.org>
Date: Tue, 22 Oct 2024 15:03:42 +0200
Subject: [PATCH] libelf: Add libeu objects to libelf.a static archive
libelf might use some symbols from libeu.a, specifically the eu-search
wrappers. But we don't ship libeu.a separately. So include the libeu
objects in the libelf.a archive to facilitate static linking.
* libelf/Makefile.am (libeu_objects): New variable.
(libelf_a_LIBADD): New, add libeu_objects.
https://sourceware.org/bugzilla/show_bug.cgi?id=32293
Signed-off-by: Mark Wielaard <mark@klomp.org>
---
libelf/Makefile.am | 3 +++
1 file changed, 3 insertions(+)
diff --git a/libelf/Makefile.am b/libelf/Makefile.am
index 3402863e..2d3dbdf2 100644
--- a/libelf/Makefile.am
+++ b/libelf/Makefile.am
@@ -122,6 +122,9 @@ libelf.so: $(srcdir)/libelf.map $(libelf_so_LIBS) $(libelf_so_DEPS)
@$(textrel_check)
$(AM_V_at)ln -fs $@ $@.$(VERSION)
+libeu_objects = $(shell $(AR) t ../lib/libeu.a)
+libelf_a_LIBADD = $(addprefix ../lib/,$(libeu_objects))
+
install: install-am libelf.so
$(mkinstalldirs) $(DESTDIR)$(libdir)
$(INSTALL_PROGRAM) libelf.so $(DESTDIR)$(libdir)/libelf-$(PACKAGE_VERSION).so
--
2.47.0

@ -0,0 +1,35 @@
commit 43829fb8780ecbe9d17aaed22d3dfcb806cb5f45
Author: Mark Wielaard <mark@klomp.org>
Date: Thu Oct 24 10:44:25 2024 +0200
stacktrace: Init elf_fd in sysprof_init_dwfl
When building with LTO gcc believes elf_fd can be used uninitialized:
In function sysprof_init_dwfl,
inlined from sysprof_unwind_cb at stacktrace.c:1235:16:
stacktrace.c:1087:7: error: elf_fd may be used uninitialized [-Werror=maybe-uninitialized]
1087 | close (elf_fd);
| ^
This code won't be reached because if find_procfile doesn't initialize
elf_fd, it will return an error. But help the compiler by initializing
elf_fd to -1.
* src/stacktrace.c (sysprof_init_dwfl): Init elf_fd to -1.
Signed-off-by: Mark Wielaard <mark@klomp.org>
diff --git a/src/stacktrace.c b/src/stacktrace.c
index 438cb1dd0d38..b912ca5de502 100644
--- a/src/stacktrace.c
+++ b/src/stacktrace.c
@@ -1033,7 +1033,7 @@ sysprof_init_dwfl (struct sysprof_unwind_info *sui,
}
Elf *elf = NULL;
- int elf_fd;
+ int elf_fd = -1;
err = find_procfile (dwfl, &pid, &elf, &elf_fd);
if (err < 0)
{

@ -1,10 +1,14 @@
# Rebuild --with static to enable static subpackages
# This is *not* supported by elfutils maintainers
%bcond_with static
Name: elfutils
Version: 0.189
%global baserelease 3
Version: 0.192
%global baserelease 4
Release: %{baserelease}%{?dist}
URL: http://elfutils.org/
%global source_url ftp://sourceware.org/pub/elfutils/%{version}/
License: GPLv3+ and (GPLv2+ or LGPLv3+) and GFDL
License: GPL-3.0-or-later AND (GPL-2.0-or-later OR LGPL-3.0-or-later) AND GFDL-1.3-no-invariants-or-later
Source: %{?source_url}%{name}-%{version}.tar.bz2
Source1: elfutils-debuginfod.sysusers
Summary: A collection of utilities and DSOs to handle ELF files and DWARF data
@ -12,14 +16,16 @@ Summary: A collection of utilities and DSOs to handle ELF files and DWARF data
# Needed for isa specific Provides and Requires.
%global depsuffix %{?_isa}%{!?_isa:-%{_arch}}
# eu-stacktrace currently only supports x86_64
%ifarch x86_64
%global enable_stacktrace 1
%else
%global enable_stacktrace 0
%endif
Requires: elfutils-libelf%{depsuffix} = %{version}-%{release}
Requires: elfutils-libs%{depsuffix} = %{version}-%{release}
%if 0%{?rhel} >= 8 || 0%{?fedora} >= 20
# see Supplements: instead
# Recommends: elfutils-debuginfod-client%%{depsuffix} = %%{version}-%%{release}
%else
Requires: elfutils-debuginfod-client%{depsuffix} = %{version}-%{release}
%endif
BuildRequires: gcc
# For libstdc++ demangle support
@ -40,6 +46,8 @@ BuildRequires: pkgconfig(libmicrohttpd) >= 0.9.33
BuildRequires: pkgconfig(libcurl) >= 7.29.0
BuildRequires: pkgconfig(sqlite3) >= 3.7.17
BuildRequires: pkgconfig(libarchive) >= 3.1.2
# For debugindod metadata query
BuildRequires: pkgconfig(json-c) >= 0.11
# For tests need to bunzip2 test files.
BuildRequires: bzip2
@ -52,6 +60,11 @@ BuildRequires: curl
# For run-debuginfod-response-headers.sh test case
BuildRequires: socat
# For eu-stacktrace
%if %{enable_stacktrace}
BuildRequires: sysprof-capture-devel
%endif
BuildRequires: automake
BuildRequires: autoconf
BuildRequires: gettext-devel
@ -73,12 +86,14 @@ BuildRequires: gettext-devel
# Patches
# elfcompress: Don't compress if section already compressed unless forced
Patch1: elfutils-0.189-elfcompress.patch
# libelf: Replace list of elf_getdata_rawchunk results with a tree
Patch2: elfutils-0.189-elf_getdata_rawchunk.patch
# PR29696: Removed secondary fd close in cache config causing race condition
Patch3: elfutils-0.189-debuginfod_config_cache-double-close.patch
# For s390x... FDO package notes are bogus.
Patch1: elfutils-0.186-fdo-swap.patch
# Include libeu.a objects in libelf.a for static linking.
Patch2: elfutils-0.192-libelf-static.patch
# Fix eu-stacktrace LTO build error.
Patch3: elfutils-0.192-stacktrace-lto.patch
%description
Elfutils is a collection of utilities, including stack (to show
@ -90,7 +105,7 @@ elfcompress (to compress or decompress ELF sections).
%package libs
Summary: Libraries to handle compiled objects
License: GPLv2+ or LGPLv3+
License: GPL-2.0-or-later OR LGPL-3.0-or-later
%if 0%{!?_isa:1}
Provides: elfutils-libs%{depsuffix} = %{version}-%{release}
%endif
@ -99,8 +114,7 @@ Requires: elfutils-libelf%{depsuffix} = %{version}-%{release}
Requires: default-yama-scope
%endif
%if 0%{?rhel} >= 8 || 0%{?fedora} >= 20
# see Supplements: instead
# Recommends: elfutils-debuginfod-client%%{depsuffix} = %%{version}-%%{release}
Recommends: elfutils-debuginfod-client%{depsuffix} = %{version}-%{release}
%else
Requires: elfutils-debuginfod-client%{depsuffix} = %{version}-%{release}
%endif
@ -114,13 +128,17 @@ libraries.
%package devel
Summary: Development libraries to handle compiled objects
License: GPLv2+ or LGPLv3+
License: GPL-2.0-or-later OR LGPL-3.0-or-later
%if 0%{!?_isa:1}
Provides: elfutils-devel%{depsuffix} = %{version}-%{release}
%endif
Requires: elfutils-libs%{depsuffix} = %{version}-%{release}
Requires: elfutils-libelf-devel%{depsuffix} = %{version}-%{release}
Obsoletes: elfutils-devel-static < 0.180-5
%if 0%{?rhel} >= 8 || 0%{?fedora} >= 20
Recommends: elfutils-debuginfod-client-devel%{depsuffix} = %{version}-%{release}
%else
Requires: elfutils-debuginfod-client-devel%{depsuffix} = %{version}-%{release}
%endif
%description devel
The elfutils-devel package contains the libraries to create
@ -128,9 +146,25 @@ applications for handling compiled objects. libdw provides access
to the DWARF debugging information. libasm provides a programmable
assembler interface.
%if %{with static}
%package devel-static
Summary: Static archives to handle compiled objects
License: GPL-2.0-or-later OR LGPL-3.0-or-later
%if 0%{!?_isa:1}
Provides: elfutils-devel-static%{depsuffix} = %{version}-%{release}
%endif
Requires: elfutils-devel%{depsuffix} = %{version}-%{release}
Requires: elfutils-libelf-devel-static%{depsuffix} = %{version}-%{release}
Requires: libzstd-static%{depsuffix}
%description devel-static
The elfutils-devel-static package contains the static archives
with the code to handle compiled objects.
%endif
%package libelf
Summary: Library to read and write ELF files
License: GPLv2+ or LGPLv3+
License: GPL-2.0-or-later OR LGPL-3.0-or-later
%if 0%{!?_isa:1}
Provides: elfutils-libelf%{depsuffix} = %{version}-%{release}
%endif
@ -144,13 +178,12 @@ elfutils package use it also to generate new ELF files.
%package libelf-devel
Summary: Development support for libelf
License: GPLv2+ or LGPLv3+
License: GPL-2.0-or-later OR LGPL-3.0-or-later
%if 0%{!?_isa:1}
Provides: elfutils-libelf-devel%{depsuffix} = %{version}-%{release}
%endif
Requires: elfutils-libelf%{depsuffix} = %{version}-%{release}
Obsoletes: libelf-devel <= 0.8.2-2
Obsoletes: elfutils-libelf-devel-static < 0.180-5
%description libelf-devel
The elfutils-libelf-devel package contains the libraries to create
@ -158,10 +191,24 @@ applications for handling compiled objects. libelf allows you to
access the internals of the ELF object file format, so you can see the
different sections of an ELF file.
%if %{with static}
%package libelf-devel-static
Summary: Static archive of libelf
License: GPL-2.0-or-later OR LGPL-3.0-or-later
%if 0%{!?_isa:1}
Provides: elfutils-libelf-devel-static%{depsuffix} = %{version}-%{release}
%endif
Requires: elfutils-libelf-devel%{depsuffix} = %{version}-%{release}
%description libelf-devel-static
The elfutils-libelf-static package contains the static archive
for libelf.
%endif
%if %{provide_yama_scope}
%package default-yama-scope
Summary: Default yama attach scope sysctl setting
License: GPLv2+ or LGPLv3+
License: GPL-2.0-or-later OR LGPL-3.0-or-later
Provides: default-yama-scope
BuildArch: noarch
# For the sysctl_apply macro we need systemd as build requires.
@ -195,24 +242,17 @@ profiling) of processes.
%package debuginfod-client
Summary: Library and command line client for build-id HTTP ELF/DWARF server
License: GPLv3+ and (GPLv2+ or LGPLv3+)
License: GPL-3.0-or-later AND (GPL-2.0-or-later OR LGPL-3.0-or-later)
%if 0%{!?_isa:1}
Provides: elfutils-debuginfod-client%{depsuffix} = %{version}-%{release}
%endif
# For debuginfod-find binary
Requires: elfutils-libs%{depsuffix} = %{version}-%{release}
Requires: elfutils-libelf%{depsuffix} = %{version}-%{release}
%if 0%{?rhel} >= 8 || 0%{?fedora} >= 20
# Instead of the weak forward dependency from -libs to -debuginfod-client,
# we'll add weak reverse dependencies from some of the many programs that
# indirectly load this. This lets the base @core compose omit this library.
Supplements: systemtap-client perf gdb binutils elfutils ltrace dyninst
Supplements: valgrind annocheck bpftrace dwarves libabigail
%endif
%package debuginfod-client-devel
Summary: Libraries and headers to build debuginfod client applications
License: GPLv2+ or LGPLv3+
License: GPL-2.0-or-later OR LGPL-3.0-or-later
%if 0%{!?_isa:1}
Provides: elfutils-debuginfod-client-devel%{depsuffix} = %{version}-%{release}
%endif
@ -220,7 +260,7 @@ Requires: elfutils-debuginfod-client%{depsuffix} = %{version}-%{release}
%package debuginfod
Summary: HTTP ELF/DWARF file server addressed by build-id
License: GPLv3+
License: GPL-3.0-or-later
Requires: elfutils-libs%{depsuffix} = %{version}-%{release}
Requires: elfutils-libelf%{depsuffix} = %{version}-%{release}
Requires: elfutils-debuginfod-client%{depsuffix} = %{version}-%{release}
@ -277,12 +317,17 @@ RPM_OPT_FLAGS="${RPM_OPT_FLAGS} -Wformat"
trap 'cat config.log' EXIT
%if 0%{?centos} >= 8
%configure CFLAGS="$RPM_OPT_FLAGS" --enable-debuginfod-urls=https://debuginfod.centos.org/
%else
%configure CFLAGS="$RPM_OPT_FLAGS"
# dist_debuginfod_url is defined in macros.dist. Fedora and CentOS have
# URLs pointing to their respective servers. RHEL and Amazon Linux do
# not configure a default server.
%configure CFLAGS="$RPM_OPT_FLAGS" \
%if "%{?dist_debuginfod_url}"
--enable-debuginfod-urls=%{dist_debuginfod_url} \
%endif
%if %{enable_stacktrace}
--enable-stacktrace \
%endif
--enable-debuginfod
trap '' EXIT
%make_build
@ -290,13 +335,10 @@ trap '' EXIT
%make_install
chmod +x ${RPM_BUILD_ROOT}%{_prefix}/%{_lib}/lib*.so*
%if %{without static}
# We don't want the static libraries
rm ${RPM_BUILD_ROOT}%{_prefix}/%{_lib}/lib{elf,dw,asm}.a
# We don't have standard DEBUGINFOD_URLS necessarily, but still ship
# the profile.d/debuginfod* files, in case of a site specific server.
# rm ${RPM_BUILD_ROOT}%{_sysconfdir}/profile.d/debuginfod.sh
# rm ${RPM_BUILD_ROOT}%{_sysconfdir}/profile.d/debuginfod.csh
%endif
%find_lang %{name}
@ -317,9 +359,7 @@ install -Dm0644 %{SOURCE1} %{buildroot}%{_sysusersdir}/elfutils-debuginfod.conf
# Record some build root versions in build.log
uname -r; rpm -q binutils gcc glibc || true
# See rhbz #2060731 and #2055510. The ; true really should be ; false
# but for some reason brew builds can cause test-suite failures.
%make_build check || (cat tests/test-suite.log; true)
%make_build check || (cat tests/test-suite.log; false)
# Only the latest Fedora and EPEL have these scriptlets,
# older Fedora and plain RHEL don't.
@ -361,7 +401,11 @@ fi
%{_bindir}/eu-ranlib
%{_bindir}/eu-readelf
%{_bindir}/eu-size
%{_bindir}/eu-srcfiles
%{_bindir}/eu-stack
%if %{enable_stacktrace}
%{_bindir}/eu-stacktrace
%endif
%{_bindir}/eu-strings
%{_bindir}/eu-strip
%{_bindir}/eu-unstrip
@ -388,6 +432,12 @@ fi
%{_libdir}/libdw.so
%{_libdir}/pkgconfig/libdw.pc
%if %{with static}
%files devel-static
%{_libdir}/libdw.a
%{_libdir}/libasm.a
%endif
%files -f %{name}.lang libelf
%license COPYING-GPLV2 COPYING-LGPLV3
%{_libdir}/libelf-%{version}.so
@ -400,6 +450,14 @@ fi
%{_libdir}/libelf.so
%{_libdir}/pkgconfig/libelf.pc
%{_mandir}/man3/elf_*.3*
%{_mandir}/man3/elf32_*.3*
%{_mandir}/man3/elf64_*.3*
%{_mandir}/man3/libelf.3*
%if %{with static}
%files libelf-devel-static
%{_libdir}/libelf.a
%endif
%if %{provide_yama_scope}
%files default-yama-scope
@ -412,9 +470,10 @@ fi
%{_bindir}/debuginfod-find
%{_mandir}/man1/debuginfod-find.1*
%{_mandir}/man7/debuginfod*.7*
%{_sysconfdir}/profile.d/debuginfod.*
%if 0%{?centos} >= 8
%{_sysconfdir}/debuginfod/*.urls
%config(noreplace) %{_sysconfdir}/profile.d/*
%config(noreplace) %{_datadir}/fish/vendor_conf.d/*
%if "%{?dist_debuginfod_url}"
%config(noreplace) %{_sysconfdir}/debuginfod/*
%endif
%files debuginfod-client-devel
@ -431,7 +490,6 @@ fi
%{_sysusersdir}/elfutils-debuginfod.conf
%endif
%{_mandir}/man8/debuginfod*.8*
%{_mandir}/man7/debuginfod*.7*
%dir %attr(0700,debuginfod,debuginfod) %{_localstatedir}/cache/debuginfod
@ -455,32 +513,139 @@ exit 0
%systemd_postun_with_restart debuginfod.service
%changelog
* Wed Jun 28 2023 Mark Wielaard <mjw@redhat.com> - 0.189-3
* Tue Oct 29 2024 Aaron Merey <amerey@redhat.com> - 0.192-4
- Install fish profile script unconditionally
* Tue Oct 29 2024 Troy Dawson <tdawson@redhat.com> - 0.192-3
- Bump release for October 2024 mass rebuild:
Resolves: RHEL-64018
* Thu Oct 24 2024 Aaron Merey <amerey@redhat.com> - 0.192-2
- Enable eu-stacktrace on x86_64
- Add elfutils-0.192-stacktrace-lto.patch
* Wed Oct 23 2024 Aaron Merey <amerey@redhat.com> - 0.192-1
- Upgrade to upstream elfutils 0.192
- Drop upstreamed patches
elfutils-0.190-riscv-flatten.patch
elfutils-0.191-riscv-flatten.patch
elfutils-0.191-profile-empty-urls.patch
- Add elfutils-0.192-libelf-static.patch
* Tue Jun 25 2024 Mark Wielaard <mjw@fedoraproject.org> - 0.191-5
- Add elfutils-0.190-riscv-flatten.patch
* Mon Jun 24 2024 Troy Dawson <tdawson@redhat.com> - 0.191-4
- Bump release for June 2024 mass rebuild
* Wed Apr 24 2024 Aaron Merey <amerey@redhat.com> - 0.191-3
- eu-srcfiles directly links to libdebuginfod.so so explicitly
Require elfutils-debuginfod-client not just Recommends
* Wed Apr 24 2024 Aaron Merey <amerey@redhat.com> - 0.191-2
- Update SPDX licenses
* Thu Apr 11 2024 Aaron Merey <amerey@redhat.com> - 0.191-1
- Upgrade to upstream elfutils 0.191
- Drop upstreamed patches
elfutils-0.190-fix-core-noncontig.patch
elfutils-0.190-gcc-14.patch
elfutils-0.190-remove-ET_REL-unstrip-test.patch
- Drop testcore-noncontig.bz2
- Add elfutils-0.191-profile-empty-urls.patch
- Add elfutils-0.191-riscv-flatten.patch
- Add feature flag for reenabling elfutils-libelf-devel-static and elfutils-devel-static
* Wed Jan 24 2024 Fedora Release Engineering <releng@fedoraproject.org> - 0.190-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Fri Jan 19 2024 Fedora Release Engineering <releng@fedoraproject.org> - 0.190-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Tue Nov 28 2023 Aaron Merey <amerey@fedoraproject.org> - 0.190-4
- Add elfutils-0.190-remove-ET_REL-unstrip-test.patch
* Fri Nov 24 2023 Aaron Merey <amerey@fedoraproject.org> - 0.190-3
- Add elfutils-0.190-fix-core-noncontig.patch
* Fri Nov 3 2023 Mark Wielaard <mjw@fedoraproject.org> - 0.190-2
- Update Fedora license tags to spdx license tags
* Fri Nov 3 2023 Mark Wielaard <mjw@fedoraproject.org> - 0.190-1
- Upgrade to upstream elfutils 0.190
- Add eu-srcfiles
- Drop upstreamed patches
elfutils-0.189-relr.patch
elfutils-0.189-debuginfod_config_cache-double-close.patch
elfutils-0.189-elf_getdata_rawchunk.patch
elfutils-0.189-elfcompress.patch
elfutils-0.189-c99-compat.patch
- Only package debuginfod-client-config.7 manpage for debuginfod-client
* Thu Aug 24 2023 Mark Wielaard <mjw@fedoraproject.org> - 0.189-6
- Update elfutils-0.189-relr.patch
* Wed Aug 23 2023 Mark Wielaard <mjw@fedoraproject.org> - 0.189-5
- Add elfutils-0.189-relr.patch
* Wed Jul 19 2023 Fedora Release Engineering <releng@fedoraproject.org> - 0.189-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
* Thu Jun 22 2023 Mark Wielaard <mjw@fedoraproject.org> - 0.189-3
- Add elfutils-0.189-elf_getdata_rawchunk.patch
- Add elfutils-0.189-debuginfod_config_cache-double-close.patch
* Mon Apr 24 2023 Mark Wielaard <mjw@redhat.com> - 0.189-2
* Sat Apr 22 2023 Mark Wielaard <mjw@fedoraproject.org> - 0.189-2
- Add elfutils-0.189-c99-compat.patch
- Add elfutils-0.189-elfcompress.patch
* Tue Apr 4 2023 Mark Wielaard <mjw@redhat.com> - 0.189-1
* Fri Mar 3 2023 Mark Wielaard <mjw@fedoraproject.org> - 0.189-1
- Upgrade to upsteam elfutils 0.189.
* Mon Nov 7 2022 Mark Wielaard <mjw@redhat.com> - 0.188-3
* Fri Jan 27 2023 Mark Wielaard <mjw@fedoraproject.org> - 0.188-5
- Add elfutils-0.188-deprecated-CURLINFO.patch,
elfutils-0.188-CURL_AT_LEAST_VERSION.patch and
elfutils-0.188-CURLOPT_PROTOCOLS_STR.patch
* Thu Jan 19 2023 Fedora Release Engineering <releng@fedoraproject.org> - 0.188-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
* Mon Nov 7 2022 Mark Wielaard <mjw@fedoraproject.org> - 0.188-3
- Add elfutils-0.188-compile-warnings.patch
- Add elfutils-0.188-debuginfod-client-lifetime.patch
* Wed Nov 2 2022 Mark Wielaard <mjw@redhat.com> - 0.188-1
- Upgrade to upsteam elfutils 0.188.
* Wed Nov 2 2022 Mark Wielaard <mjw@fedoraproject.org> - 0.188-2
- Add elfutils-0.188-static-extract_section.patch.
* Fri Sep 30 2022 Mark Wielaard <mjw@redhat.com> - 0.187-6
* Wed Nov 2 2022 Mark Wielaard <mjw@fedoraproject.org> - 0.188-1
- Upgrade to upsteam elfutils 0.188.
* Wed Oct 5 2022 Amit Shah <amitshah@fedoraproject.org> - 0.187-9
- Auto-configure debuginfod_url based on macros.dist
* Wed Aug 24 2022 Debarshi Ray <rishi@fedoraproject.org> - 0.187-8
- Use %%sysusers_requires_compat to match %%sysusers_create_compat
* Wed Jul 27 2022 Amit Shah <amitshah@fedoraproject.org> - 0.187-7
- Allow building without default debuginfod URL
* Thu Jul 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 0.187-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
* Tue Jun 14 2022 Mark Wielaard <mjw@fedoraproject.org> - 0.187-5
- Add sysuser support for creating the debuginfod user
* Thu Jun 16 2022 Frank Ch. Eigler <fche@redhat.com> - 0.187-5
- rhbz2088774: ship /etc/profile.d/debuginfod* files even without
default DEBUGINFOD_URLS.
* Fri May 6 2022 Mark Wielaard <mjw@fedoraproject.org> - 0.187-4
- Add elfutils-0.187-mhd_no_dual_stack.patch
- Add elfutils-0.187-mhd_epoll.patch
* Thu May 5 2022 Mark Wielaard <mjw@fedoraproject.org> - 0.187-3
- Add elfutils-0.187-debuginfod-client-fd-leak.patch
* Tue May 3 2022 Mark Wielaard <mjw@fedoraproject.org> - 0.187-2
- Add elfutils-0.187-csh-profile.patch
* Fri May 6 2022 Mark Wielaard <mjw@redhat.com> - 0.187-4
* Tue Apr 26 2022 Mark Wielaard <mjw@fedoraproject.org> - 0.187-1
- Upgrade to elfutils 0.187
- debuginfod: Support -C option for connection thread pooling.
- debuginfod-client: Negative cache file are now zero sized instead
@ -494,26 +659,26 @@ exit 0
DEBUGINFOD_URLS is unset. And whenDEBUGINFOD_URLS is set,
libcurl is only loaded when the debuginfod_begin function is
called.
- Add elfutils-0.187-csh-profile.patch
- Add elfutils-0.187-debuginfod-client-fd-leak.patch
- Add elfutils-0.187-mhd_no_dual_stack.patch
- Add elfutils-0.187-mhd_epoll.patch
* Tue Apr 12 2022 Mark Wielaard <mjw@redhat.com> - 0.186-5
* Tue Apr 12 2022 Mark Wielaard <mjw@fedoraproject.org> - 0.186-5
- Add an explicit versioned requires from elfutils-debuginfod-client
on elfutils-libelf.
* Fri Apr 8 2022 Mark Wielaard <mjw@redhat.com> - 0.186-4
* Thu Apr 7 2022 Mark Wielaard <mjw@fedoraproject.org> - 0.186-4
- Add an explicit versioned requires from elfutils-debuginfod-client
on elfutils-libs.
* Tue Mar 22 2022 Mark Wielaard <mjw@redhat.com> - 0.186-3
- Remove brew testsuite workarounds
* Fri Mar 25 2022 Mark Wielaard <mjw@fedoraproject.org> - 0.186-3
- Add elfutils-0.186-elf-glibc.patch
- Add elfutils-0.186-fdo-ebl.patch
- Add elfutils-0.186-fdo-efllint.patch
- Add elfutils-0.186-fdo-swap.patch
- Add elfutils-0.186-ppc64le-error-return-workaround.patch
* Thu Feb 10 2022 Frank Ch. Eigler <fche@redhat.com> - 0.186-2
- rhbz2053226: enable debuginfod.centos.org support by default
* Thu Jan 20 2022 Fedora Release Engineering <releng@fedoraproject.org> - 0.186-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
* Tue Nov 23 2021 Mark Wielaard <mjw@redhat.com> - 0.186-1
* Wed Nov 10 2021 Mark Wielaard <mjw@fedoraproject.org> - 0.186-1
- Upgrade to upstream 0.186
- debuginfod-client: Default $DEBUGINFOD_URLS is computed from
drop-in files /etc/debuginfod/*.urls rather than
@ -537,20 +702,19 @@ exit 0
dwarf_linefunctionname.
- translations: Update Japanese translation.
* Mon Aug 09 2021 Mohan Boddu <mboddu@redhat.com> - 0.185-5
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
Related: rhbz#1991688
* Wed Jun 16 2021 Frank Ch. Eigler <fche@redhat.com> - 0.185-4
- RHBZ1947876 - redux.
* Thu Aug 5 2021 Mark Wielaard <mjw@fedoraproject.org> - 0.185-5
- Use autosetup
- Add elfutils-0.185-raise-pthread_kill-backtrace.patch
* Wed Jun 09 2021 Frank Ch. Eigler <fche@redhat.com> - 0.185-3
- RHBZ1947876 - turn -debuginfod-client into a weak reverse dependency.
* Wed Jul 21 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.185-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
* Mon May 31 2021 Mark Wielaard <mjw@redhat.com> - 0.185-2
- Allow failing make check
* Thu Jul 15 2021 Mark Wielaard <mjw@fedoraproject.org> - 0.185-3
- Update version to 0.185-3 for rawhide/f35 upgrade from f34
This build enables debuginfod client by default
- Workaround bad test in make check
* Mon May 31 2021 Mark Wielaard <mjw@redhat.com> - 0.185-1
* Wed May 26 2021 Mark Wielaard <mjw@fedoraproject.org> - 0.185-1
- Upgrade to upstream 0.185
- debuginfod-client: Simplify curl handle reuse so downloads which
return an error are retried.
@ -558,8 +722,39 @@ exit 0
(even when nothing was done). On error the exit code
is now always 1.
* Thu Apr 15 2021 Mohan Boddu <mboddu@redhat.com> - 0.183-2
- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937
* Sun May 16 2021 Frank Ch. Eigler <fche@redhat.com> - 0.184-5
- Fix 404-latch problem on reused debuginfod_client. (PR27859)
* Wed May 12 2021 Frank Ch. Eigler <fche@redhat.com> - 0.184-4
- Ship new profile.d files. (1956952)
* Wed May 12 2021 Frank Ch. Eigler <fche@redhat.com> - 0.184-3
- Don't nuke the new profile.d files. (1956952)
* Tue May 11 2021 Frank Ch. Eigler <fche@redhat.com> - 0.184-2
- Activate debuginfod client by default (1956952) to the fedora server.
* Mon May 10 2021 Mark Wielaard <mjw@fedoraproject.org> - 0.184-1
- Upgrade to upstream 0.184
- debuginfod: Use libarchive's bsdtar as the .deb-family file unpacker.
- debuginfod-client: Client caches negative results. If a query for a
file failed with 404, an empty 000 permission
file is created in the cache. This will prevent
requesting the same file for the next 10 minutes.
Client objects now carry long-lived curl handles
for outgoing connections. This makes it more
efficient for multiple sequential queries, because
the TCP connections and/or TLS state info are kept
around awhile, avoiding O(100ms) setup latencies.
- libdw: handle DW_FORM_indirect when reading attributes
- translations: Update Polish translation.
* Mon Apr 19 2021 Mark Wielaard <mjw@fedoraproject.org> - 0.183-3
- Introduce CI gating setup
* Tue Mar 02 2021 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 0.183-2
- Rebuilt for updated systemd-rpm-macros
See https://pagure.io/fesco/issue/2583.
* Mon Feb 8 2021 Mark Wielaard <mjw@fedoraproject.org> - 0.183-1
- Upgrade to upstream 0.183

Loading…
Cancel
Save