Compare commits
4 Commits
rawhide
...
f37-riscv6
Author | SHA1 | Date |
---|---|---|
David Abdurachmanov | e2d272a06a | |
David Abdurachmanov | b71b24f9a4 | |
David Abdurachmanov | 06b550743c | |
David Abdurachmanov | bff62b0ea6 |
|
@ -28,5 +28,3 @@
|
|||
/elfutils-0.185.tar.bz2
|
||||
/elfutils-0.186.tar.bz2
|
||||
/elfutils-0.187.tar.bz2
|
||||
/elfutils-0.188.tar.bz2
|
||||
/elfutils-0.189.tar.bz2
|
||||
|
|
|
@ -0,0 +1,31 @@
|
|||
From 2f275fc12127db031592752136f077f5f3f3d273 Mon Sep 17 00:00:00 2001
|
||||
From: Andreas Schwab <schwab@suse.de>
|
||||
Date: Tue, 9 Aug 2022 10:29:53 +0200
|
||||
Subject: [PATCH] elflint: Allow zero p_memsz for PT_RISCV_ATTRIBUTES
|
||||
|
||||
The RISCV_ATTRIBUTES segment is not meant to be loaded.
|
||||
|
||||
Signed-off-by: Andreas Schwab <schwab@suse.de>
|
||||
---
|
||||
src/elflint.c | 5 ++++-
|
||||
2 files changed, 9 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/elflint.c b/src/elflint.c
|
||||
index d919936fc..b0e5415ef 100644
|
||||
--- a/src/elflint.c
|
||||
+++ b/src/elflint.c
|
||||
@@ -4731,7 +4731,10 @@ section [%2zu] '%s' must not be executable\n"),
|
||||
}
|
||||
|
||||
if (phdr->p_filesz > phdr->p_memsz
|
||||
- && (phdr->p_memsz != 0 || phdr->p_type != PT_NOTE))
|
||||
+ && (phdr->p_memsz != 0
|
||||
+ || (phdr->p_type != PT_NOTE
|
||||
+ && !(ehdr->e_machine == EM_RISCV
|
||||
+ && phdr->p_type == PT_RISCV_ATTRIBUTES))))
|
||||
ERROR (_("\
|
||||
program header entry %d: file size greater than memory size\n"),
|
||||
cnt);
|
||||
--
|
||||
2.31.1
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
From b713edb9a7f3da8e4dd28ac69a1665ed493ca504 Mon Sep 17 00:00:00 2001
|
||||
From: Andreas Schwab <schwab@suse.de>
|
||||
Date: Wed, 10 Aug 2022 10:52:42 +0200
|
||||
Subject: [PATCH] readelf: Handle SHT_RISCV_ATTRIBUTES like SHT_GNU_ATTRIBUTES
|
||||
|
||||
Signed-off-by: Andreas Schwab <schwab@suse.de>
|
||||
---
|
||||
src/readelf.c | 4 +++-
|
||||
2 files changed, 7 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/readelf.c b/src/readelf.c
|
||||
index f1f77ce81..1a10fd01e 100644
|
||||
--- a/src/readelf.c
|
||||
+++ b/src/readelf.c
|
||||
@@ -3672,7 +3672,9 @@ print_attributes (Ebl *ebl, const GElf_Ehdr *ehdr)
|
||||
&& (shdr->sh_type != SHT_ARM_ATTRIBUTES
|
||||
|| ehdr->e_machine != EM_ARM)
|
||||
&& (shdr->sh_type != SHT_CSKY_ATTRIBUTES
|
||||
- || ehdr->e_machine != EM_CSKY)))
|
||||
+ || ehdr->e_machine != EM_CSKY)
|
||||
+ && (shdr->sh_type != SHT_RISCV_ATTRIBUTES
|
||||
+ || ehdr->e_machine != EM_RISCV)))
|
||||
continue;
|
||||
|
||||
printf (_("\
|
||||
--
|
||||
2.31.1
|
||||
|
|
@ -0,0 +1,84 @@
|
|||
From d703772ee51ff9171e0b4f09e1b1d7c96369f9b9 Mon Sep 17 00:00:00 2001
|
||||
From: Andreas Schwab <schwab@suse.de>
|
||||
Date: Tue, 9 Aug 2022 09:54:28 +0200
|
||||
Subject: [PATCH] backends: Handle new RISC-V specific definitions
|
||||
|
||||
Handle PT_RISCV_ATTRIBUTES, SHT_RISCV_ATTRIBUTES, DT_RISCV_VARIANT_CC.
|
||||
|
||||
Signed-off-by: Andreas Schwab <schwab@suse.de>
|
||||
---
|
||||
backends/riscv_init.c | 4 ++++
|
||||
backends/riscv_symbol.c | 45 +++++++++++++++++++++++++++++++++++++++++
|
||||
3 files changed, 58 insertions(+)
|
||||
|
||||
diff --git a/backends/riscv_init.c b/backends/riscv_init.c
|
||||
index 141e08217..f2d460822 100644
|
||||
--- a/backends/riscv_init.c
|
||||
+++ b/backends/riscv_init.c
|
||||
@@ -65,6 +65,10 @@ riscv_init (Elf *elf,
|
||||
HOOK (eh, check_special_symbol);
|
||||
HOOK (eh, machine_flag_check);
|
||||
HOOK (eh, set_initial_registers_tid);
|
||||
+ HOOK (eh, segment_type_name);
|
||||
+ HOOK (eh, section_type_name);
|
||||
+ HOOK (eh, dynamic_tag_name);
|
||||
+ HOOK (eh, dynamic_tag_check);
|
||||
if (eh->class == ELFCLASS64)
|
||||
eh->core_note = riscv64_core_note;
|
||||
else
|
||||
diff --git a/backends/riscv_symbol.c b/backends/riscv_symbol.c
|
||||
index c34b77020..c149b8ba2 100644
|
||||
--- a/backends/riscv_symbol.c
|
||||
+++ b/backends/riscv_symbol.c
|
||||
@@ -119,3 +119,48 @@ riscv_check_special_symbol (Elf *elf, const GElf_Sym *sym,
|
||||
|
||||
return false;
|
||||
}
|
||||
+
|
||||
+const char *
|
||||
+riscv_segment_type_name (int segment, char *buf __attribute__ ((unused)),
|
||||
+ size_t len __attribute__ ((unused)))
|
||||
+{
|
||||
+ switch (segment)
|
||||
+ {
|
||||
+ case PT_RISCV_ATTRIBUTES:
|
||||
+ return "RISCV_ATTRIBUTES";
|
||||
+ }
|
||||
+ return NULL;
|
||||
+}
|
||||
+
|
||||
+/* Return symbolic representation of section type. */
|
||||
+const char *
|
||||
+riscv_section_type_name (int type,
|
||||
+ char *buf __attribute__ ((unused)),
|
||||
+ size_t len __attribute__ ((unused)))
|
||||
+{
|
||||
+ switch (type)
|
||||
+ {
|
||||
+ case SHT_RISCV_ATTRIBUTES:
|
||||
+ return "RISCV_ATTRIBUTES";
|
||||
+ }
|
||||
+
|
||||
+ return NULL;
|
||||
+}
|
||||
+
|
||||
+const char *
|
||||
+riscv_dynamic_tag_name (int64_t tag, char *buf __attribute__ ((unused)),
|
||||
+ size_t len __attribute__ ((unused)))
|
||||
+{
|
||||
+ switch (tag)
|
||||
+ {
|
||||
+ case DT_RISCV_VARIANT_CC:
|
||||
+ return "RISCV_VARIANT_CC";
|
||||
+ }
|
||||
+ return NULL;
|
||||
+}
|
||||
+
|
||||
+bool
|
||||
+riscv_dynamic_tag_check (int64_t tag)
|
||||
+{
|
||||
+ return tag == DT_RISCV_VARIANT_CC;
|
||||
+}
|
||||
--
|
||||
2.31.1
|
||||
|
|
@ -0,0 +1,207 @@
|
|||
From de209d23e5f571f03ff0efc6547a2ebbfae3828e Mon Sep 17 00:00:00 2001
|
||||
From: Andreas Schwab <schwab@suse.de>
|
||||
Date: Mon, 8 Aug 2022 13:44:08 +0200
|
||||
Subject: [PATCH] libelf: Sync elf.h from glibc
|
||||
|
||||
Adds PT_RISCV_ATTRIBUTES, SHT_RISCV_ATTRIBUTES, PT_AARCH64_MEMTAG_MTE,
|
||||
RELR definitions, LoongArch relocations.
|
||||
|
||||
dwelf_elf_e_machine_string was updated to handle EM_LOONGARCH, and
|
||||
ebl_dynamic_tag_name was updated to handle the new RELR dynamic tags.
|
||||
|
||||
Signed-off-by: Andreas Schwab <schwab@suse.de>
|
||||
---
|
||||
libdwelf/dwelf_elf_e_machine_string.c | 2 +
|
||||
libebl/ebldynamictagname.c | 2 +-
|
||||
libelf/elf.h | 99 ++++++++++++++++++++++++++-
|
||||
6 files changed, 113 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/libdwelf/dwelf_elf_e_machine_string.c b/libdwelf/dwelf_elf_e_machine_string.c
|
||||
index 051c70b5b..6d588ea8d 100644
|
||||
--- a/libdwelf/dwelf_elf_e_machine_string.c
|
||||
+++ b/libdwelf/dwelf_elf_e_machine_string.c
|
||||
@@ -398,6 +398,8 @@ dwelf_elf_e_machine_string (int machine)
|
||||
return "BPF";
|
||||
case EM_CSKY:
|
||||
return "C-SKY";
|
||||
+ case EM_LOONGARCH:
|
||||
+ return "LoongArch";
|
||||
|
||||
case EM_ALPHA:
|
||||
return "Alpha";
|
||||
diff --git a/libebl/ebldynamictagname.c b/libebl/ebldynamictagname.c
|
||||
index 3f8d8ee4b..5d4a3a58a 100644
|
||||
--- a/libebl/ebldynamictagname.c
|
||||
+++ b/libebl/ebldynamictagname.c
|
||||
@@ -54,7 +54,7 @@ ebl_dynamic_tag_name (Ebl *ebl, int64_t tag, char *buf, size_t len)
|
||||
"RELENT", "PLTREL", "DEBUG", "TEXTREL", "JMPREL", "BIND_NOW",
|
||||
"INIT_ARRAY", "FINI_ARRAY", "INIT_ARRAYSZ", "FINI_ARRAYSZ",
|
||||
"RUNPATH", "FLAGS", "ENCODING", "PREINIT_ARRAY",
|
||||
- "PREINIT_ARRAYSZ", "SYMTAB_SHNDX"
|
||||
+ "PREINIT_ARRAYSZ", "SYMTAB_SHNDX", "RELRSZ", "RELR", "RELRENT"
|
||||
};
|
||||
eu_static_assert (sizeof (stdtags) / sizeof (const char *) == DT_NUM);
|
||||
|
||||
diff --git a/libelf/elf.h b/libelf/elf.h
|
||||
index 0735f6b57..02a1b3f52 100644
|
||||
--- a/libelf/elf.h
|
||||
+++ b/libelf/elf.h
|
||||
@@ -358,8 +358,9 @@ typedef struct
|
||||
|
||||
#define EM_BPF 247 /* Linux BPF -- in-kernel virtual machine */
|
||||
#define EM_CSKY 252 /* C-SKY */
|
||||
+#define EM_LOONGARCH 258 /* LoongArch */
|
||||
|
||||
-#define EM_NUM 253
|
||||
+#define EM_NUM 259
|
||||
|
||||
/* Old spellings/synonyms. */
|
||||
|
||||
@@ -443,7 +444,8 @@ typedef struct
|
||||
#define SHT_PREINIT_ARRAY 16 /* Array of pre-constructors */
|
||||
#define SHT_GROUP 17 /* Section group */
|
||||
#define SHT_SYMTAB_SHNDX 18 /* Extended section indices */
|
||||
-#define SHT_NUM 19 /* Number of defined types. */
|
||||
+#define SHT_RELR 19 /* RELR relative relocations */
|
||||
+#define SHT_NUM 20 /* Number of defined types. */
|
||||
#define SHT_LOOS 0x60000000 /* Start OS-specific. */
|
||||
#define SHT_GNU_ATTRIBUTES 0x6ffffff5 /* Object attributes. */
|
||||
#define SHT_GNU_HASH 0x6ffffff6 /* GNU-style hash table. */
|
||||
@@ -662,6 +664,11 @@ typedef struct
|
||||
Elf64_Sxword r_addend; /* Addend */
|
||||
} Elf64_Rela;
|
||||
|
||||
+/* RELR relocation table entry */
|
||||
+
|
||||
+typedef Elf32_Word Elf32_Relr;
|
||||
+typedef Elf64_Xword Elf64_Relr;
|
||||
+
|
||||
/* How to extract and insert information held in the r_info field. */
|
||||
|
||||
#define ELF32_R_SYM(val) ((val) >> 8)
|
||||
@@ -887,7 +894,10 @@ typedef struct
|
||||
#define DT_PREINIT_ARRAY 32 /* Array with addresses of preinit fct*/
|
||||
#define DT_PREINIT_ARRAYSZ 33 /* size in bytes of DT_PREINIT_ARRAY */
|
||||
#define DT_SYMTAB_SHNDX 34 /* Address of SYMTAB_SHNDX section */
|
||||
-#define DT_NUM 35 /* Number used */
|
||||
+#define DT_RELRSZ 35 /* Total size of RELR relative relocations */
|
||||
+#define DT_RELR 36 /* Address of RELR relative relocations */
|
||||
+#define DT_RELRENT 37 /* Size of one RELR relative relocaction */
|
||||
+#define DT_NUM 38 /* Number used */
|
||||
#define DT_LOOS 0x6000000d /* Start of OS-specific */
|
||||
#define DT_HIOS 0x6ffff000 /* End of OS-specific */
|
||||
#define DT_LOPROC 0x70000000 /* Start of processor-specific */
|
||||
@@ -2893,6 +2903,9 @@ enum
|
||||
#define R_AARCH64_TLSDESC 1031 /* TLS Descriptor. */
|
||||
#define R_AARCH64_IRELATIVE 1032 /* STT_GNU_IFUNC relocation. */
|
||||
|
||||
+/* MTE memory tag segment type. */
|
||||
+#define PT_AARCH64_MEMTAG_MTE (PT_LOPROC + 2)
|
||||
+
|
||||
/* AArch64 specific values for the Dyn d_tag field. */
|
||||
#define DT_AARCH64_BTI_PLT (DT_LOPROC + 1)
|
||||
#define DT_AARCH64_PAC_PLT (DT_LOPROC + 3)
|
||||
@@ -3918,6 +3931,8 @@ enum
|
||||
#define EF_RISCV_FLOAT_ABI_SINGLE 0x0002
|
||||
#define EF_RISCV_FLOAT_ABI_DOUBLE 0x0004
|
||||
#define EF_RISCV_FLOAT_ABI_QUAD 0x0006
|
||||
+#define EF_RISCV_RVE 0x0008
|
||||
+#define EF_RISCV_TSO 0x0010
|
||||
|
||||
/* RISC-V relocations. */
|
||||
#define R_RISCV_NONE 0
|
||||
@@ -3978,6 +3993,19 @@ enum
|
||||
|
||||
#define R_RISCV_NUM 59
|
||||
|
||||
+/* RISC-V specific values for the st_other field. */
|
||||
+#define STO_RISCV_VARIANT_CC 0x80 /* Function uses variant calling
|
||||
+ convention */
|
||||
+
|
||||
+/* RISC-V specific values for the sh_type field. */
|
||||
+#define SHT_RISCV_ATTRIBUTES (SHT_LOPROC + 3)
|
||||
+
|
||||
+/* RISC-V specific values for the p_type field. */
|
||||
+#define PT_RISCV_ATTRIBUTES (PT_LOPROC + 3)
|
||||
+
|
||||
+/* RISC-V specific values for the d_tag field. */
|
||||
+#define DT_RISCV_VARIANT_CC (DT_LOPROC + 1)
|
||||
+
|
||||
/* BPF specific declarations. */
|
||||
|
||||
#define R_BPF_NONE 0 /* No reloc */
|
||||
@@ -4056,6 +4084,71 @@ enum
|
||||
#define R_NDS32_TLS_TPOFF 102
|
||||
#define R_NDS32_TLS_DESC 119
|
||||
|
||||
+/* LoongArch ELF Flags */
|
||||
+#define EF_LARCH_ABI 0x07
|
||||
+#define EF_LARCH_ABI_LP64D 0x03
|
||||
+
|
||||
+/* LoongArch specific dynamic relocations */
|
||||
+#define R_LARCH_NONE 0
|
||||
+#define R_LARCH_32 1
|
||||
+#define R_LARCH_64 2
|
||||
+#define R_LARCH_RELATIVE 3
|
||||
+#define R_LARCH_COPY 4
|
||||
+#define R_LARCH_JUMP_SLOT 5
|
||||
+#define R_LARCH_TLS_DTPMOD32 6
|
||||
+#define R_LARCH_TLS_DTPMOD64 7
|
||||
+#define R_LARCH_TLS_DTPREL32 8
|
||||
+#define R_LARCH_TLS_DTPREL64 9
|
||||
+#define R_LARCH_TLS_TPREL32 10
|
||||
+#define R_LARCH_TLS_TPREL64 11
|
||||
+#define R_LARCH_IRELATIVE 12
|
||||
+
|
||||
+/* Reserved for future relocs that the dynamic linker must understand. */
|
||||
+
|
||||
+/* used by the static linker for relocating .text. */
|
||||
+#define R_LARCH_MARK_LA 20
|
||||
+#define R_LARCH_MARK_PCREL 21
|
||||
+#define R_LARCH_SOP_PUSH_PCREL 22
|
||||
+#define R_LARCH_SOP_PUSH_ABSOLUTE 23
|
||||
+#define R_LARCH_SOP_PUSH_DUP 24
|
||||
+#define R_LARCH_SOP_PUSH_GPREL 25
|
||||
+#define R_LARCH_SOP_PUSH_TLS_TPREL 26
|
||||
+#define R_LARCH_SOP_PUSH_TLS_GOT 27
|
||||
+#define R_LARCH_SOP_PUSH_TLS_GD 28
|
||||
+#define R_LARCH_SOP_PUSH_PLT_PCREL 29
|
||||
+#define R_LARCH_SOP_ASSERT 30
|
||||
+#define R_LARCH_SOP_NOT 31
|
||||
+#define R_LARCH_SOP_SUB 32
|
||||
+#define R_LARCH_SOP_SL 33
|
||||
+#define R_LARCH_SOP_SR 34
|
||||
+#define R_LARCH_SOP_ADD 35
|
||||
+#define R_LARCH_SOP_AND 36
|
||||
+#define R_LARCH_SOP_IF_ELSE 37
|
||||
+#define R_LARCH_SOP_POP_32_S_10_5 38
|
||||
+#define R_LARCH_SOP_POP_32_U_10_12 39
|
||||
+#define R_LARCH_SOP_POP_32_S_10_12 40
|
||||
+#define R_LARCH_SOP_POP_32_S_10_16 41
|
||||
+#define R_LARCH_SOP_POP_32_S_10_16_S2 42
|
||||
+#define R_LARCH_SOP_POP_32_S_5_20 43
|
||||
+#define R_LARCH_SOP_POP_32_S_0_5_10_16_S2 44
|
||||
+#define R_LARCH_SOP_POP_32_S_0_10_10_16_S2 45
|
||||
+#define R_LARCH_SOP_POP_32_U 46
|
||||
+
|
||||
+/* used by the static linker for relocating non .text. */
|
||||
+#define R_LARCH_ADD8 47
|
||||
+#define R_LARCH_ADD16 48
|
||||
+#define R_LARCH_ADD24 49
|
||||
+#define R_LARCH_ADD32 50
|
||||
+#define R_LARCH_ADD64 51
|
||||
+#define R_LARCH_SUB8 52
|
||||
+#define R_LARCH_SUB16 53
|
||||
+#define R_LARCH_SUB24 54
|
||||
+#define R_LARCH_SUB32 55
|
||||
+#define R_LARCH_SUB64 56
|
||||
+#define R_LARCH_GNU_VTINHERIT 57
|
||||
+#define R_LARCH_GNU_VTENTRY 58
|
||||
+
|
||||
+
|
||||
/* ARCompact/ARCv2 specific relocs. */
|
||||
#define R_ARC_NONE 0x0
|
||||
#define R_ARC_8 0x1
|
||||
--
|
||||
2.31.1
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
commit f1252e4dbe781f75d806ce0b990779548eeeb7a9
|
||||
Author: Mark Wielaard <mark@klomp.org>
|
||||
Date: Tue May 3 17:48:55 2022 +0200
|
||||
|
||||
config: Move the 2>/dev/null inside the sh -c '' quotes for profile.csh.
|
||||
|
||||
csh/tcsh would warn about "Ambiguous output redirect" if not done inside
|
||||
the sh -c command.
|
||||
|
||||
Fix-by: наб <nabijaczleweli@nabijaczleweli.xyz>
|
||||
|
||||
https://bugzilla.redhat.com/show_bug.cgi?id=2080957
|
||||
|
||||
Signed-off-by: Mark Wielaard <mark@klomp.org>
|
||||
|
||||
diff --git a/config/profile.csh.in b/config/profile.csh.in
|
||||
index 012e243a..74c20c99 100644
|
||||
--- a/config/profile.csh.in
|
||||
+++ b/config/profile.csh.in
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
if (! $?DEBUGINFOD_URLS) then
|
||||
set prefix="@prefix@"
|
||||
- set DEBUGINFOD_URLS=`sh -c 'cat "$0"/*.urls; :' "@sysconfdir@/debuginfod" 2>/dev/null | tr '\n' ' '`
|
||||
+ set DEBUGINFOD_URLS=`sh -c 'cat "$0"/*.urls 2>/dev/null; :' "@sysconfdir@/debuginfod" | tr '\n' ' '`
|
||||
if ( "$DEBUGINFOD_URLS" != "" ) then
|
||||
setenv DEBUGINFOD_URLS "$DEBUGINFOD_URLS"
|
||||
else
|
|
@ -0,0 +1,98 @@
|
|||
commit 59158656f3b0b99d8784ddc82c15778813000edc
|
||||
Author: Frank Ch. Eigler <fche@redhat.com>
|
||||
Date: Wed May 4 10:26:42 2022 -0400
|
||||
|
||||
PR29117: fix fd leak in debuginfod client for cache-miss files
|
||||
|
||||
Correct a nasty fd leak and a few less nasty leaks in the debuginfod
|
||||
client code. The nasty one impacts long-lived apps such as debuginfod
|
||||
servers.
|
||||
|
||||
Signed-off-by: Mark Wielaard <mark@klomp.org>
|
||||
Signed-off-by: Frank Ch. Eigler <fche@redhat.com>
|
||||
|
||||
diff --git a/debuginfod/debuginfod-client.c b/debuginfod/debuginfod-client.c
|
||||
index ea6e461a..521972e4 100644
|
||||
--- a/debuginfod/debuginfod-client.c
|
||||
+++ b/debuginfod/debuginfod-client.c
|
||||
@@ -243,7 +243,13 @@ debuginfod_config_cache(char *config_path,
|
||||
return -errno;
|
||||
|
||||
if (dprintf(fd, "%ld", cache_config_default_s) < 0)
|
||||
- return -errno;
|
||||
+ {
|
||||
+ int ret = -errno;
|
||||
+ close (fd);
|
||||
+ return ret;
|
||||
+ }
|
||||
+
|
||||
+ close (fd);
|
||||
}
|
||||
|
||||
long cache_config;
|
||||
@@ -284,7 +290,13 @@ debuginfod_init_cache (char *cache_path, char *interval_path, char *maxage_path)
|
||||
return -errno;
|
||||
|
||||
if (dprintf(fd, "%ld", cache_clean_default_interval_s) < 0)
|
||||
- return -errno;
|
||||
+ {
|
||||
+ int ret = -errno;
|
||||
+ close (fd);
|
||||
+ return ret;
|
||||
+ }
|
||||
+
|
||||
+ close (fd);
|
||||
|
||||
/* init max age config file. */
|
||||
if (stat(maxage_path, &st) != 0
|
||||
@@ -292,8 +304,13 @@ debuginfod_init_cache (char *cache_path, char *interval_path, char *maxage_path)
|
||||
return -errno;
|
||||
|
||||
if (dprintf(fd, "%ld", cache_default_max_unused_age_s) < 0)
|
||||
- return -errno;
|
||||
+ {
|
||||
+ int ret = -errno;
|
||||
+ close (fd);
|
||||
+ return ret;
|
||||
+ }
|
||||
|
||||
+ close (fd);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -812,18 +829,17 @@ debuginfod_query_server (debuginfod_client *c,
|
||||
has passed since the last attempt. */
|
||||
time_t cache_miss;
|
||||
time_t target_mtime = st.st_mtime;
|
||||
+
|
||||
+ close(fd); /* no need to hold onto the negative-hit file descriptor */
|
||||
+
|
||||
rc = debuginfod_config_cache(cache_miss_path,
|
||||
cache_miss_default_s, &st);
|
||||
if (rc < 0)
|
||||
- {
|
||||
- close(fd);
|
||||
- goto out;
|
||||
- }
|
||||
+ goto out;
|
||||
|
||||
cache_miss = (time_t)rc;
|
||||
if (time(NULL) - target_mtime <= cache_miss)
|
||||
{
|
||||
- close(fd);
|
||||
rc = -ENOENT;
|
||||
goto out;
|
||||
}
|
||||
diff --git a/debuginfod/debuginfod-find.c b/debuginfod/debuginfod-find.c
|
||||
index 3e8ab203..f60b5463 100644
|
||||
--- a/debuginfod/debuginfod-find.c
|
||||
+++ b/debuginfod/debuginfod-find.c
|
||||
@@ -231,6 +231,8 @@ main(int argc, char** argv)
|
||||
fprintf(stderr, "Server query failed: %s\n", strerror(-rc));
|
||||
return 1;
|
||||
}
|
||||
+ else
|
||||
+ close (rc);
|
||||
|
||||
printf("%s\n", cache_name);
|
||||
free (cache_name);
|
|
@ -0,0 +1,51 @@
|
|||
commit 28f9d86ea89f88b24f1d12c8e9d5ddc3f77da194
|
||||
Author: Mark Wielaard <mark@klomp.org>
|
||||
Date: Fri May 6 00:29:28 2022 +0200
|
||||
|
||||
debuginfod: Use MHD_USE_EPOLL for libmicrohttpd version 0.9.51 or higher
|
||||
|
||||
Also disable MHD_USE_THREAD_PER_CONNECTION when using MHD_USE_EPOLL.
|
||||
|
||||
https://sourceware.org/bugzilla/show_bug.cgi?id=29123
|
||||
|
||||
Signed-off-by: Mark Wielaard <mark@klomp.org>
|
||||
|
||||
diff --git a/debuginfod/debuginfod.cxx b/debuginfod/debuginfod.cxx
|
||||
index c02540f1..d4f47bf7 100644
|
||||
--- a/debuginfod/debuginfod.cxx
|
||||
+++ b/debuginfod/debuginfod.cxx
|
||||
@@ -1,6 +1,6 @@
|
||||
/* Debuginfo-over-http server.
|
||||
Copyright (C) 2019-2021 Red Hat, Inc.
|
||||
- Copyright (C) 2021 Mark J. Wielaard <mark@klomp.org>
|
||||
+ Copyright (C) 2021, 2022 Mark J. Wielaard <mark@klomp.org>
|
||||
This file is part of elfutils.
|
||||
|
||||
This file is free software; you can redistribute it and/or modify
|
||||
@@ -3899,7 +3899,14 @@ main (int argc, char *argv[])
|
||||
}
|
||||
}
|
||||
|
||||
- unsigned int mhd_flags = ((connection_pool
|
||||
+ /* Note that MHD_USE_EPOLL and MHD_USE_THREAD_PER_CONNECTION don't
|
||||
+ work together. */
|
||||
+ unsigned int use_epoll = 0;
|
||||
+#if MHD_VERSION >= 0x00095100
|
||||
+ use_epoll = MHD_USE_EPOLL;
|
||||
+#endif
|
||||
+
|
||||
+ unsigned int mhd_flags = ((connection_pool || use_epoll
|
||||
? 0 : MHD_USE_THREAD_PER_CONNECTION)
|
||||
#if MHD_VERSION >= 0x00095300
|
||||
| MHD_USE_INTERNAL_POLLING_THREAD
|
||||
@@ -3907,9 +3914,7 @@ main (int argc, char *argv[])
|
||||
| MHD_USE_SELECT_INTERNALLY
|
||||
#endif
|
||||
| MHD_USE_DUAL_STACK
|
||||
-#ifdef MHD_USE_EPOLL
|
||||
- | MHD_USE_EPOLL
|
||||
-#endif
|
||||
+ | use_epoll
|
||||
#if MHD_VERSION >= 0x00095200
|
||||
| MHD_USE_ITC
|
||||
#endif
|
|
@ -0,0 +1,118 @@
|
|||
commit ba675ed25a26fd425ffd19b02cf18babf4291b4f
|
||||
Author: Mark Wielaard <mark@klomp.org>
|
||||
Date: Thu May 5 23:59:57 2022 +0200
|
||||
|
||||
debuginfod: Try without MHD_USE_DUAL_STACK if MHD_start_daemon fails
|
||||
|
||||
On a systems that have ipv6 disabled debuginfod doesn't start up
|
||||
anymore because libhttpd MHD_USE_DUAL_STACK only works if it can
|
||||
open an ipv6 socket. If MHD_start_daemon with MHD_USE_DUAL_STACK
|
||||
fails try again without that flag set.
|
||||
|
||||
https://sourceware.org/bugzilla/show_bug.cgi?id=29122
|
||||
|
||||
Signed-off-by: Mark Wielaard <mark@klomp.org>
|
||||
|
||||
diff --git a/debuginfod/debuginfod.cxx b/debuginfod/debuginfod.cxx
|
||||
index 4aaf41c0..c02540f1 100644
|
||||
--- a/debuginfod/debuginfod.cxx
|
||||
+++ b/debuginfod/debuginfod.cxx
|
||||
@@ -3899,40 +3899,67 @@ main (int argc, char *argv[])
|
||||
}
|
||||
}
|
||||
|
||||
- // Start httpd server threads. Use a single dual-homed pool.
|
||||
- MHD_Daemon *d46 = MHD_start_daemon ((connection_pool ? 0 : MHD_USE_THREAD_PER_CONNECTION)
|
||||
+ unsigned int mhd_flags = ((connection_pool
|
||||
+ ? 0 : MHD_USE_THREAD_PER_CONNECTION)
|
||||
#if MHD_VERSION >= 0x00095300
|
||||
- | MHD_USE_INTERNAL_POLLING_THREAD
|
||||
+ | MHD_USE_INTERNAL_POLLING_THREAD
|
||||
#else
|
||||
- | MHD_USE_SELECT_INTERNALLY
|
||||
+ | MHD_USE_SELECT_INTERNALLY
|
||||
#endif
|
||||
+ | MHD_USE_DUAL_STACK
|
||||
#ifdef MHD_USE_EPOLL
|
||||
- | MHD_USE_EPOLL
|
||||
+ | MHD_USE_EPOLL
|
||||
#endif
|
||||
- | MHD_USE_DUAL_STACK
|
||||
#if MHD_VERSION >= 0x00095200
|
||||
- | MHD_USE_ITC
|
||||
+ | MHD_USE_ITC
|
||||
#endif
|
||||
- | MHD_USE_DEBUG, /* report errors to stderr */
|
||||
- http_port,
|
||||
- NULL, NULL, /* default accept policy */
|
||||
- handler_cb, NULL, /* handler callback */
|
||||
- MHD_OPTION_EXTERNAL_LOGGER, error_cb, NULL,
|
||||
- (connection_pool ? MHD_OPTION_THREAD_POOL_SIZE : MHD_OPTION_END),
|
||||
- (connection_pool ? (int)connection_pool : MHD_OPTION_END),
|
||||
- MHD_OPTION_END);
|
||||
+ | MHD_USE_DEBUG); /* report errors to stderr */
|
||||
|
||||
+ // Start httpd server threads. Use a single dual-homed pool.
|
||||
+ MHD_Daemon *d46 = MHD_start_daemon (mhd_flags, http_port,
|
||||
+ NULL, NULL, /* default accept policy */
|
||||
+ handler_cb, NULL, /* handler callback */
|
||||
+ MHD_OPTION_EXTERNAL_LOGGER,
|
||||
+ error_cb, NULL,
|
||||
+ (connection_pool
|
||||
+ ? MHD_OPTION_THREAD_POOL_SIZE
|
||||
+ : MHD_OPTION_END),
|
||||
+ (connection_pool
|
||||
+ ? (int)connection_pool
|
||||
+ : MHD_OPTION_END),
|
||||
+ MHD_OPTION_END);
|
||||
+
|
||||
+ MHD_Daemon *d4 = NULL;
|
||||
if (d46 == NULL)
|
||||
{
|
||||
- sqlite3 *database = db;
|
||||
- sqlite3 *databaseq = dbq;
|
||||
- db = dbq = 0; // for signal_handler not to freak
|
||||
- sqlite3_close (databaseq);
|
||||
- sqlite3_close (database);
|
||||
- error (EXIT_FAILURE, 0, "cannot start http server at port %d", http_port);
|
||||
- }
|
||||
+ // Cannot use dual_stack, use ipv4 only
|
||||
+ mhd_flags &= ~(MHD_USE_DUAL_STACK);
|
||||
+ d4 = MHD_start_daemon (mhd_flags, http_port,
|
||||
+ NULL, NULL, /* default accept policy */
|
||||
+ handler_cb, NULL, /* handler callback */
|
||||
+ MHD_OPTION_EXTERNAL_LOGGER,
|
||||
+ error_cb, NULL,
|
||||
+ (connection_pool
|
||||
+ ? MHD_OPTION_THREAD_POOL_SIZE
|
||||
+ : MHD_OPTION_END),
|
||||
+ (connection_pool
|
||||
+ ? (int)connection_pool
|
||||
+ : MHD_OPTION_END),
|
||||
+ MHD_OPTION_END);
|
||||
+ if (d4 == NULL)
|
||||
+ {
|
||||
+ sqlite3 *database = db;
|
||||
+ sqlite3 *databaseq = dbq;
|
||||
+ db = dbq = 0; // for signal_handler not to freak
|
||||
+ sqlite3_close (databaseq);
|
||||
+ sqlite3_close (database);
|
||||
+ error (EXIT_FAILURE, 0, "cannot start http server at port %d",
|
||||
+ http_port);
|
||||
+ }
|
||||
|
||||
- obatched(clog) << "started http server on IPv4 IPv6 "
|
||||
+ }
|
||||
+ obatched(clog) << "started http server on"
|
||||
+ << (d4 != NULL ? " IPv4 " : " IPv4 IPv6 ")
|
||||
<< "port=" << http_port << endl;
|
||||
|
||||
// add maxigroom sql if -G given
|
||||
@@ -4053,6 +4080,7 @@ main (int argc, char *argv[])
|
||||
|
||||
/* Stop all the web service threads. */
|
||||
if (d46) MHD_stop_daemon (d46);
|
||||
+ if (d4) MHD_stop_daemon (d4);
|
||||
|
||||
if (! passive_p)
|
||||
{
|
|
@ -1,7 +1,7 @@
|
|||
Name: elfutils
|
||||
Version: 0.189
|
||||
%global baserelease 1
|
||||
Release: %{baserelease}%{?dist}
|
||||
Version: 0.187
|
||||
%global baserelease 8
|
||||
Release: %{baserelease}.1.riscv64%{?dist}
|
||||
URL: http://elfutils.org/
|
||||
%global source_url ftp://sourceware.org/pub/elfutils/%{version}/
|
||||
License: GPLv3+ and (GPLv2+ or LGPLv3+) and GFDL
|
||||
|
@ -48,8 +48,6 @@ BuildRequires: iproute
|
|||
BuildRequires: procps
|
||||
BuildRequires: bsdtar
|
||||
BuildRequires: curl
|
||||
# For run-debuginfod-response-headers.sh test case
|
||||
BuildRequires: socat
|
||||
|
||||
BuildRequires: automake
|
||||
BuildRequires: autoconf
|
||||
|
@ -70,10 +68,26 @@ BuildRequires: gettext-devel
|
|||
%global with_sysusers 1
|
||||
%endif
|
||||
|
||||
%bcond with_debuginfod_url 1
|
||||
|
||||
# Patches
|
||||
|
||||
# For s390x... FDO package notes are bogus.
|
||||
Patch1: elfutils-0.186-fdo-swap.patch
|
||||
# https://bugzilla.redhat.com/show_bug.cgi?id=2080957
|
||||
Patch2: elfutils-0.187-csh-profile.patch
|
||||
# https://sourceware.org/bugzilla/show_bug.cgi?id=29117
|
||||
Patch3: elfutils-0.187-debuginfod-client-fd-leak.patch
|
||||
# https://sourceware.org/bugzilla/show_bug.cgi?id=29122
|
||||
Patch4: elfutils-0.187-mhd_no_dual_stack.patch
|
||||
# https://sourceware.org/bugzilla/show_bug.cgi?id=29123
|
||||
Patch5: elfutils-0.187-mhd_epoll.patch
|
||||
|
||||
# riscv64
|
||||
Patch10: de209d23e5f571f03ff0efc6547a2ebbfae3828e.patch
|
||||
Patch11: d703772ee51ff9171e0b4f09e1b1d7c96369f9b9.patch
|
||||
Patch12: 2f275fc12127db031592752136f077f5f3f3d273.patch
|
||||
Patch13: b713edb9a7f3da8e4dd28ac69a1665ed493ca504.patch
|
||||
|
||||
%description
|
||||
Elfutils is a collection of utilities, including stack (to show
|
||||
|
@ -269,11 +283,8 @@ RPM_OPT_FLAGS="${RPM_OPT_FLAGS} -Wformat"
|
|||
|
||||
|
||||
trap 'cat config.log' EXIT
|
||||
# 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.
|
||||
%if "%{?dist_debuginfod_url}"
|
||||
%configure CFLAGS="$RPM_OPT_FLAGS" --enable-debuginfod-urls=%{dist_debuginfod_url}
|
||||
%if %{with with_debuginfod_url}
|
||||
%configure CFLAGS="$RPM_OPT_FLAGS" --enable-debuginfod-urls=https://debuginfod.fedoraproject.org/
|
||||
%else
|
||||
%configure CFLAGS="$RPM_OPT_FLAGS"
|
||||
%endif
|
||||
|
@ -306,7 +317,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
|
||||
|
||||
%make_build check || (cat tests/test-suite.log; false)
|
||||
%make_build check || (cat tests/test-suite.log; true)
|
||||
|
||||
# Only the latest Fedora and EPEL have these scriptlets,
|
||||
# older Fedora and plain RHEL don't.
|
||||
|
@ -400,7 +411,7 @@ fi
|
|||
%{_mandir}/man1/debuginfod-find.1*
|
||||
%{_mandir}/man7/debuginfod*.7*
|
||||
%config(noreplace) %{_sysconfdir}/profile.d/*
|
||||
%if "%{?dist_debuginfod_url}"
|
||||
%if %{with with_debuginfod_url}
|
||||
%config(noreplace) %{_sysconfdir}/debuginfod/*
|
||||
%endif
|
||||
|
||||
|
@ -414,12 +425,11 @@ fi
|
|||
%{_bindir}/debuginfod
|
||||
%config(noreplace) %{_sysconfdir}/sysconfig/debuginfod
|
||||
%{_unitdir}/debuginfod.service
|
||||
%{_sysconfdir}/sysconfig/debuginfod
|
||||
%if %{with_sysusers}
|
||||
%{_sysusersdir}/elfutils-debuginfod.conf
|
||||
%endif
|
||||
%{_mandir}/man8/debuginfod*.8*
|
||||
%{_mandir}/man7/debuginfod*.7*
|
||||
|
||||
%{_mandir}/man8/debuginfod.8*
|
||||
|
||||
%dir %attr(0700,debuginfod,debuginfod) %{_localstatedir}/cache/debuginfod
|
||||
%ghost %attr(0600,debuginfod,debuginfod) %{_localstatedir}/cache/debuginfod/debuginfod.sqlite
|
||||
|
@ -442,29 +452,11 @@ exit 0
|
|||
%systemd_postun_with_restart debuginfod.service
|
||||
|
||||
%changelog
|
||||
* Fri Mar 3 2023 Mark Wielaard <mjw@fedoraproject.org> - 0.189-1
|
||||
- Upgrade to upsteam elfutils 0.189.
|
||||
* Sat Oct 22 2022 David Abdurachmanov <davidlt@rivosinc.com> - 0.187-8.1.riscv64
|
||||
- Ignore testsuite failures
|
||||
|
||||
* 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@fedoraproject.org> - 0.188-2
|
||||
- Add elfutils-0.188-static-extract_section.patch.
|
||||
|
||||
* 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
|
||||
* Sat Oct 22 2022 David Abdurachmanov <davidlt@rivosinc.com> - 0.187-8.0.riscv64
|
||||
- Backport 4 riscv64 patches from upstream
|
||||
|
||||
* Wed Aug 24 2022 Debarshi Ray <rishi@fedoraproject.org> - 0.187-8
|
||||
- Use %%sysusers_requires_compat to match %%sysusers_create_compat
|
||||
|
|
2
sources
2
sources
|
@ -1 +1 @@
|
|||
SHA512 (elfutils-0.189.tar.bz2) = 93a877e34db93e5498581d0ab2d702b08c0d87e4cafd9cec9d6636dfa85a168095c305c11583a5b0fb79374dd93bc8d0e9ce6016e6c172764bcea12861605b71
|
||||
SHA512 (elfutils-0.187.tar.bz2) = a9b9e32b503b8b50a62d4e4001097ed2721d3475232a6380e6b9853bd1647aec016440c0ca7ceb950daf1144f8db9814ab43cf33cc0ebef7fc91e9e775c9e874
|
||||
|
|
|
@ -54,7 +54,7 @@ $(METADATA): Makefile
|
|||
@echo "TestTime: 48h" >> $(METADATA)
|
||||
@echo "RunFor: elfutils" >> $(METADATA)
|
||||
@echo "Requires: elfutils" >> $(METADATA)
|
||||
@echo "Requires: bash bash-debuginfo" >> $(METADATA)
|
||||
@echo "Requires: bash" >> $(METADATA)
|
||||
@echo "Priority: Normal" >> $(METADATA)
|
||||
@echo "License: GPLv2+" >> $(METADATA)
|
||||
@echo "Confidential: no" >> $(METADATA)
|
||||
|
|
|
@ -2,15 +2,15 @@ summary: GNU-Attribute-notes-not-recognized
|
|||
description: |
|
||||
Bug summary: elfutils doesn't recognize GNU Attribute notes
|
||||
Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1650125
|
||||
contact: Martin Cermak <mcermak@redhat.com>
|
||||
contact:
|
||||
- Martin Cermak <mcermak@redhat.com>
|
||||
component:
|
||||
- elfutils
|
||||
- elfutils
|
||||
test: ./runtest.sh
|
||||
framework: beakerlib
|
||||
recommend:
|
||||
- elfutils
|
||||
- bash
|
||||
- bash-debuginfo
|
||||
- elfutils
|
||||
- bash
|
||||
duration: 48h
|
||||
extra-summary: /tools/elfutils/Regression/GNU-Attribute-notes-not-recognized
|
||||
extra-task: /tools/elfutils/Regression/GNU-Attribute-notes-not-recognized
|
||||
|
|
|
@ -32,35 +32,12 @@ PACKAGE="elfutils"
|
|||
|
||||
rlJournalStart
|
||||
rlPhaseStartTest
|
||||
# Rely on that /bin/bash is annobin-annotated per
|
||||
# - https://fedoraproject.org/wiki/Toolchain/Watermark
|
||||
# - https://fedoraproject.org/wiki/Changes/Annobin
|
||||
# Seems to work fine with bash-4.4.19-6.el8 and elfutils-0.174-5.el8.
|
||||
f="/bin/bash"
|
||||
|
||||
# Annobin notes originally used to reside in the binary itself.
|
||||
# Later on they moved to debuginfo.
|
||||
# Let's see if we can chase down needed debuginfo somewhere...
|
||||
|
||||
# Attempt getting the needed file using debuginfod
|
||||
export DEBUGINFOD_URLS=https://debuginfod.fedoraproject.org/
|
||||
rlRun "f=\"$f $(debuginfod-find debuginfo /bin/bash)\""
|
||||
|
||||
# Attempt getting the needed file by traditional means
|
||||
rlRun "debuginfo-install -y bash"
|
||||
rlRun "buildid=$(eu-readelf -n /bin/bash | awk '/Build ID:/ {print $NF}')"
|
||||
for i in $(rpm -ql bash-debuginfo); do
|
||||
test -f $i || continue
|
||||
if eu-readelf -n $i | fgrep $buildid; then
|
||||
rlRun "f=\"$f $i\""
|
||||
fi
|
||||
done
|
||||
|
||||
set -o pipefail
|
||||
export f
|
||||
# Check if eu-readelf can read the notes from at least one of files
|
||||
# that can possibly contain it...
|
||||
rlRun "(for i in $f; do eu-readelf -n $i; done ) | grep -2 '^ GA' | fgrep 'GNU Build Attribute' | tail -50"
|
||||
# Rely on that /bin/bash is annobin-annotated per
|
||||
# - https://fedoraproject.org/wiki/Toolchain/Watermark
|
||||
# - https://fedoraproject.org/wiki/Changes/Annobin
|
||||
# Seems to work fine with bash-4.4.19-6.el8 and elfutils-0.174-5.el8.
|
||||
set -o pipefail
|
||||
rlRun "eu-readelf -n /bin/bash | grep -2 '^ GA' | fgrep 'GNU Build Attribute' | tail -50"
|
||||
rlPhaseEnd
|
||||
rlJournalPrintText
|
||||
rlJournalEnd
|
||||
|
|
Loading…
Reference in New Issue