0.181-1 - Upgrade to upstream 0.181

This commit is contained in:
Mark Wielaard 2020-09-08 15:12:34 +02:00
parent 98c6807f3d
commit 3c07e25076
5 changed files with 18 additions and 142 deletions

1
.gitignore vendored
View File

@ -21,3 +21,4 @@
/elfutils-0.178.tar.bz2 /elfutils-0.178.tar.bz2
/elfutils-0.179.tar.bz2 /elfutils-0.179.tar.bz2
/elfutils-0.180.tar.bz2 /elfutils-0.180.tar.bz2
/elfutils-0.181.tar.bz2

View File

@ -1,67 +0,0 @@
commit acb453851c9e6c46531b70fda7396885c0e7e1db
Author: Frank Ch. Eigler <fche@redhat.com>
Date: Thu Jul 2 14:52:48 2020 +0000
PR26195: adapt debuginfod to API change in libmicrohttpd-0.9.71
To make our code build with -Werror as well as against older libmicrohttpd,
we must conditionalize the data type (int vs. enum) returned by callbacks
and some mhd functions.
Signed-off-by: Frank Ch. Eigler <fche@redhat.com>
diff --git a/debuginfod/debuginfod.cxx b/debuginfod/debuginfod.cxx
index 76f1fa52..56210302 100644
--- a/debuginfod/debuginfod.cxx
+++ b/debuginfod/debuginfod.cxx
@@ -92,6 +92,14 @@ using namespace std;
#include <libdwelf.h>
#include <microhttpd.h>
+
+#if MHD_VERSION >= 0x00097002
+// libmicrohttpd 0.9.71 broke API
+#define MHD_RESULT enum MHD_Result
+#else
+#define MHD_RESULT int
+#endif
+
#include <curl/curl.h>
#include <archive.h>
#include <archive_entry.h>
@@ -519,12 +527,12 @@ struct reportable_exception
void report(ostream& o) const; // defined under obatched() class below
- int mhd_send_response(MHD_Connection* c) const {
+ MHD_RESULT mhd_send_response(MHD_Connection* c) const {
MHD_Response* r = MHD_create_response_from_buffer (message.size(),
(void*) message.c_str(),
MHD_RESPMEM_MUST_COPY);
MHD_add_response_header (r, "Content-Type", "text/plain");
- int rc = MHD_queue_response (c, code, r);
+ MHD_RESULT rc = MHD_queue_response (c, code, r);
MHD_destroy_response (r);
return rc;
}
@@ -1723,7 +1731,7 @@ handle_metrics (off_t* size)
/* libmicrohttpd callback */
-static int
+static MHD_RESULT
handler_cb (void * /*cls*/,
struct MHD_Connection *connection,
const char *url,
@@ -1736,7 +1744,11 @@ handler_cb (void * /*cls*/,
struct MHD_Response *r = NULL;
string url_copy = url;
+#if MHD_VERSION >= 0x00097002
+ enum MHD_Result rc;
+#else
int rc = MHD_NO; // mhd
+#endif
int http_code = 500;
off_t http_size = -1;
struct timeval tv_start, tv_end;

View File

@ -1,68 +0,0 @@
commit 55c5c9a568ed707bcea1388bf3a525212d8cf4b8
Author: Mark Wielaard <mark@klomp.org>
Date: Wed Aug 19 23:41:24 2020 +0200
libelf: Fixup SHF_COMPRESSED sh_addralign in elf_update if necessary.
In elf_getdata.c we have the following to compensate for possibly
bad sh_addralign values of compressed sections:
/* Compressed data has a header, but then compressed data.
Make sure to set the alignment of the header explicitly,
don't trust the file alignment for the section, it is
often wrong. */
if ((flags & SHF_COMPRESSED) != 0)
{
entsize = 1;
align = __libelf_type_align (elf->class, ELF_T_CHDR);
}
Which makes sure the d_data alignment is correct for the Chdr struct
at the start of the compressed section.
But this means that if a user just reads such a compressed section
without changing it, and then tries to write it out again using
elf_update they get an error message about d_align and sh_addralign
being out of sync.
We already correct obviously incorrect sh_entsize fields.
Do the same for the sh_addralign field of a SHF_COMPRESSED section.
Signed-off-by: Mark Wielaard <mark@klomp.org>
diff --git a/libelf/ChangeLog b/libelf/ChangeLog
index 8f6d2d2d..77044c1c 100644
--- a/libelf/ChangeLog
+++ b/libelf/ChangeLog
@@ -1,3 +1,8 @@
+2020-08-19 Mark Wielaard <mark@klomp.org>
+
+ * elf32_updatenull.c (updatenull_wrlock): Fixup the sh_addralign
+ of an SHF_COMPRESSED section if necessary.
+
2020-06-04 Mark Wielaard <mark@klomp.org>
* elf.h: Update from glibc.
diff --git a/libelf/elf32_updatenull.c b/libelf/elf32_updatenull.c
index 5f3cdbf6..d0d4d1eb 100644
--- a/libelf/elf32_updatenull.c
+++ b/libelf/elf32_updatenull.c
@@ -267,6 +267,18 @@ __elfw2(LIBELFBITS,updatenull_wrlock) (Elf *elf, int *change_bop, size_t shnum)
update_if_changed (shdr->sh_entsize, sh_entsize,
scn->shdr_flags);
+ /* Likewise for the alignment of a compressed section.
+ For a SHF_COMPRESSED section set the correct
+ sh_addralign value, which must match the d_align of
+ the data (see __libelf_set_rawdata in elf_getdata.c). */
+ if ((shdr->sh_flags & SHF_COMPRESSED) != 0)
+ {
+ sh_align = __libelf_type_align (ELFW(ELFCLASS,LIBELFBITS),
+ ELF_T_CHDR);
+ update_if_changed (shdr->sh_addralign, sh_align,
+ scn->shdr_flags);
+ }
+
if (scn->data_read == 0
&& __libelf_set_rawdata_wrlock (scn) != 0)
/* Something went wrong. The error value is already set. */

View File

@ -1,6 +1,6 @@
Name: elfutils Name: elfutils
Version: 0.180 Version: 0.181
%global baserelease 7 %global baserelease 1
Release: %{baserelease}%{?dist} Release: %{baserelease}%{?dist}
URL: http://elfutils.org/ URL: http://elfutils.org/
%global source_url ftp://sourceware.org/pub/elfutils/%{version}/ %global source_url ftp://sourceware.org/pub/elfutils/%{version}/
@ -55,8 +55,6 @@ BuildRequires: curl
%endif %endif
# Patches # Patches
Patch1: elfutils-0.180-mhd-result.patch
Patch2: elfutils-0.180-shf-compressed.patch
%description %description
Elfutils is a collection of utilities, including stack (to show Elfutils is a collection of utilities, including stack (to show
@ -225,8 +223,6 @@ such servers to download those files on demand.
%setup -q %setup -q
# Apply patches # Apply patches
%patch1 -p1 -b .mhd_result
%patch2 -p1 -b .shf_compressed
# In case the above patches added any new test scripts, make sure they # In case the above patches added any new test scripts, make sure they
# are executable. # are executable.
@ -407,6 +403,20 @@ exit 0
%systemd_postun_with_restart debuginfod.service %systemd_postun_with_restart debuginfod.service
%changelog %changelog
* Tue Sep 8 2020 Mark Wielaard <mjw@fedoraproject.org> - 0.181-1
- Upgrade to upstream 0.181
- libelf: elf_update now compensates (fixes up) a bad sh_addralign
for SHF_COMPRESSED sections.
- libdebuginfod: configure now takes --enable-libdebuginfod=dummy or
--disable-libdebuginfod for bootstrapping.
DEBUGINFOD_URLS now accepts "scheme-free" urls
(guessing at what the user meant, either http:// or file://)
- readelf, elflint: Handle aarch64 bti, pac bits in dynamic table and
gnu property notes.
- libdw, readelf: Recognize DW_CFA_AARCH64_negate_ra_state. Allows
unwinding on arm64 for code that is compiled for PAC
(Pointer Authentication Code) as long as it isn't enabled.
* Tue Aug 25 2020 Mark Wielaard <mjw@fedoraproject.org> - 0.180-7 * Tue Aug 25 2020 Mark Wielaard <mjw@fedoraproject.org> - 0.180-7
- Add elfutils-0.180-shf-compressed.patch - Add elfutils-0.180-shf-compressed.patch

View File

@ -1 +1 @@
SHA512 (elfutils-0.180.tar.bz2) = 62e96035ccfe8928baca2285decbe8b8703a2daa956df81ece18fecf643272fb68955806b3e807a514141a7a9bf44520bf09461672aa580bd6807485fb604d25 SHA512 (elfutils-0.181.tar.bz2) = d565541d5817f409dc89ebb1ee593366f69c371a1531308eeb67ff934b14a0fab0c9009fd7c23240efbaa1b4e04edac5c425e47d80e3e66ba03dcaf000afea36