Compare commits
No commits in common. "rawhide" and "f28" have entirely different histories.
137 changed files with 1916 additions and 4780 deletions
|
|
@ -1 +0,0 @@
|
|||
1
|
||||
20
.gitignore
vendored
20
.gitignore
vendored
|
|
@ -15,23 +15,3 @@
|
|||
/elfutils-0.172.tar.bz2
|
||||
/elfutils-0.173.tar.bz2
|
||||
/elfutils-0.174.tar.bz2
|
||||
/elfutils-0.175.tar.bz2
|
||||
/elfutils-0.176.tar.bz2
|
||||
/elfutils-0.177.tar.bz2
|
||||
/elfutils-0.178.tar.bz2
|
||||
/elfutils-0.179.tar.bz2
|
||||
/elfutils-0.180.tar.bz2
|
||||
/elfutils-0.181.tar.bz2
|
||||
/elfutils-0.182.tar.bz2
|
||||
/elfutils-0.183.tar.bz2
|
||||
/elfutils-0.184.tar.bz2
|
||||
/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
|
||||
/elfutils-0.190.tar.bz2
|
||||
/elfutils-0.191.tar.bz2
|
||||
/elfutils-0.192.tar.bz2
|
||||
/elfutils-0.193.tar.bz2
|
||||
/elfutils-0.194.tar.bz2
|
||||
|
|
|
|||
17
elfutils-0.173-new-notes-hack.patch
Normal file
17
elfutils-0.173-new-notes-hack.patch
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
diff --git a/src/elflint.c b/src/elflint.c
|
||||
index eec799b2..31092f2e 100644
|
||||
--- a/src/elflint.c
|
||||
+++ b/src/elflint.c
|
||||
@@ -3905,10 +3905,11 @@ section [%2zu] '%s': size not multiple of entry size\n"),
|
||||
cnt, section_name (ebl, cnt),
|
||||
(int) shdr->sh_type);
|
||||
|
||||
+#define SHF_GNU_BUILD_NOTE (1 << 20)
|
||||
#define ALL_SH_FLAGS (SHF_WRITE | SHF_ALLOC | SHF_EXECINSTR | SHF_MERGE \
|
||||
| SHF_STRINGS | SHF_INFO_LINK | SHF_LINK_ORDER \
|
||||
| SHF_OS_NONCONFORMING | SHF_GROUP | SHF_TLS \
|
||||
- | SHF_COMPRESSED)
|
||||
+ | SHF_COMPRESSED | SHF_GNU_BUILD_NOTE)
|
||||
if (shdr->sh_flags & ~(GElf_Xword) ALL_SH_FLAGS)
|
||||
{
|
||||
GElf_Xword sh_flags = shdr->sh_flags & ~(GElf_Xword) ALL_SH_FLAGS;
|
||||
27
elfutils-0.174-ar-sh_entsize-zero.patch
Normal file
27
elfutils-0.174-ar-sh_entsize-zero.patch
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
commit 2b16a9be69939822dcafe075413468daac98b327
|
||||
Author: Mark Wielaard <mark@klomp.org>
|
||||
Date: Thu Oct 18 19:01:52 2018 +0200
|
||||
|
||||
arlib: Check that sh_entsize isn't zero.
|
||||
|
||||
A bogus ELF file could have sh_entsize as zero. Don't divide by zero,
|
||||
but just assume there are no symbols in the section.
|
||||
|
||||
https://sourceware.org/bugzilla/show_bug.cgi?id=23786
|
||||
|
||||
Signed-off-by: Mark Wielaard <mark@klomp.org>
|
||||
|
||||
diff --git a/src/arlib.c b/src/arlib.c
|
||||
index 778e087..a6521e3 100644
|
||||
--- a/src/arlib.c
|
||||
+++ b/src/arlib.c
|
||||
@@ -252,6 +252,9 @@ arlib_add_symbols (Elf *elf, const char *arfname, const char *membername,
|
||||
if (data == NULL)
|
||||
continue;
|
||||
|
||||
+ if (shdr->sh_entsize == 0)
|
||||
+ continue;
|
||||
+
|
||||
int nsyms = shdr->sh_size / shdr->sh_entsize;
|
||||
for (int ndx = shdr->sh_info; ndx < nsyms; ++ndx)
|
||||
{
|
||||
373
elfutils-0.174-gnu-attribute-note.patch
Normal file
373
elfutils-0.174-gnu-attribute-note.patch
Normal file
|
|
@ -0,0 +1,373 @@
|
|||
commit 72e30c2e0cb49a9a300667fdd5ff09082f717950
|
||||
Author: Mark Wielaard <mark@klomp.org>
|
||||
Date: Mon Nov 12 23:34:24 2018 +0100
|
||||
|
||||
Handle GNU Build Attribute ELF Notes.
|
||||
|
||||
GNU Build Attribute ELF Notes are generated by the GCC annobin plugin
|
||||
and described at https://fedoraproject.org/wiki/Toolchain/Watermark
|
||||
|
||||
Unfortunately the constants aren't yet described in the standard glibc
|
||||
elf.h so they have been added to the elfutils specific elf-knowledge.h.
|
||||
|
||||
The notes abuse the name owner field to encode some data not in the
|
||||
description. This makes it a bit hard to parse. We have to match the
|
||||
note owner name prefix (to "GA") to be sure the type is valid. We also
|
||||
cannot rely on the owner name being a valid C string since the attribute
|
||||
name and value can contain zero (terminators). So pass around namesz
|
||||
to the ebl note parsing functions.
|
||||
|
||||
eu-elflint will recognize and eu-readelf -n will now show the notes:
|
||||
|
||||
Note section [27] '.gnu.build.attributes' of 56080 bytes at offset 0x114564:
|
||||
Owner Data size Type
|
||||
GA 16 GNU Build Attribute OPEN
|
||||
Address Range: 0x2f30f - 0x2f30f
|
||||
VERSION: "3p8"
|
||||
GA 0 GNU Build Attribute OPEN
|
||||
TOOL: "gcc 8.2.1 20180801"
|
||||
GA 0 GNU Build Attribute OPEN
|
||||
"GOW": 45
|
||||
GA 0 GNU Build Attribute OPEN
|
||||
STACK_PROT: 0
|
||||
GA 0 GNU Build Attribute OPEN
|
||||
"stack_clash": TRUE
|
||||
GA 0 GNU Build Attribute OPEN
|
||||
"cf_protection": 0
|
||||
GA 0 GNU Build Attribute OPEN
|
||||
"GLIBCXX_ASSERTIONS": TRUE
|
||||
GA 0 GNU Build Attribute OPEN
|
||||
"FORTIFY": 0
|
||||
GA 0 GNU Build Attribute OPEN
|
||||
PIC: 3
|
||||
GA 0 GNU Build Attribute OPEN
|
||||
SHORT_ENUM: FALSE
|
||||
GA 0 GNU Build Attribute OPEN
|
||||
ABI: c001100000012
|
||||
GA 0 GNU Build Attribute OPEN
|
||||
"stack_realign": FALSE
|
||||
|
||||
A new test was added to run-readelf -n for the existing annobin file.
|
||||
|
||||
Signed-off-by: Mark Wielaard <mark@klomp.org>
|
||||
|
||||
diff --git a/libebl/eblobjnote.c b/libebl/eblobjnote.c
|
||||
index 8fda7d9..58ac86d 100644
|
||||
--- a/libebl/eblobjnote.c
|
||||
+++ b/libebl/eblobjnote.c
|
||||
@@ -37,11 +37,14 @@
|
||||
#include <string.h>
|
||||
#include <libeblP.h>
|
||||
|
||||
+#include "common.h"
|
||||
#include "libelfP.h"
|
||||
+#include "libdwP.h"
|
||||
+#include "memory-access.h"
|
||||
|
||||
|
||||
void
|
||||
-ebl_object_note (Ebl *ebl, const char *name, uint32_t type,
|
||||
+ebl_object_note (Ebl *ebl, uint32_t namesz, const char *name, uint32_t type,
|
||||
uint32_t descsz, const char *desc)
|
||||
{
|
||||
if (! ebl->object_note (name, type, descsz, desc))
|
||||
@@ -135,6 +138,152 @@ ebl_object_note (Ebl *ebl, const char *name, uint32_t type,
|
||||
return;
|
||||
}
|
||||
|
||||
+ if (strncmp (name, ELF_NOTE_GNU_BUILD_ATTRIBUTE_PREFIX,
|
||||
+ strlen (ELF_NOTE_GNU_BUILD_ATTRIBUTE_PREFIX)) == 0
|
||||
+ && (type == NT_GNU_BUILD_ATTRIBUTE_OPEN
|
||||
+ || type == NT_GNU_BUILD_ATTRIBUTE_FUNC))
|
||||
+ {
|
||||
+ /* There might or might not be a pair of addresses in the desc. */
|
||||
+ if (descsz > 0)
|
||||
+ {
|
||||
+ printf (" Address Range: ");
|
||||
+
|
||||
+ union
|
||||
+ {
|
||||
+ Elf64_Addr a64[2];
|
||||
+ Elf32_Addr a32[2];
|
||||
+ } addrs;
|
||||
+
|
||||
+ size_t addr_size = gelf_fsize (ebl->elf, ELF_T_ADDR,
|
||||
+ 2, EV_CURRENT);
|
||||
+ if (descsz != addr_size)
|
||||
+ printf ("<unknown data>\n");
|
||||
+ else
|
||||
+ {
|
||||
+ Elf_Data src =
|
||||
+ {
|
||||
+ .d_type = ELF_T_ADDR, .d_version = EV_CURRENT,
|
||||
+ .d_buf = (void *) desc, .d_size = descsz
|
||||
+ };
|
||||
+
|
||||
+ Elf_Data dst =
|
||||
+ {
|
||||
+ .d_type = ELF_T_ADDR, .d_version = EV_CURRENT,
|
||||
+ .d_buf = &addrs, .d_size = descsz
|
||||
+ };
|
||||
+
|
||||
+ if (gelf_xlatetom (ebl->elf, &dst, &src,
|
||||
+ elf_getident (ebl->elf,
|
||||
+ NULL)[EI_DATA]) == NULL)
|
||||
+ printf ("%s\n", elf_errmsg (-1));
|
||||
+ else
|
||||
+ {
|
||||
+ if (addr_size == 4)
|
||||
+ printf ("%#" PRIx32 " - %#" PRIx32 "\n",
|
||||
+ addrs.a32[0], addrs.a32[1]);
|
||||
+ else
|
||||
+ printf ("%#" PRIx64 " - %#" PRIx64 "\n",
|
||||
+ addrs.a64[0], addrs.a64[1]);
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ /* Most data actually is inside the name.
|
||||
+ https://fedoraproject.org/wiki/Toolchain/Watermark */
|
||||
+
|
||||
+ /* We need at least 2 chars of data to describe the
|
||||
+ attribute and value encodings. */
|
||||
+ const char *data = (name
|
||||
+ + strlen (ELF_NOTE_GNU_BUILD_ATTRIBUTE_PREFIX));
|
||||
+ if (namesz < 2)
|
||||
+ {
|
||||
+ printf ("<insufficient data>\n");
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ printf (" ");
|
||||
+
|
||||
+ /* In most cases the value comes right after the encoding bytes. */
|
||||
+ const char *value = &data[2];
|
||||
+ switch (data[1])
|
||||
+ {
|
||||
+ case GNU_BUILD_ATTRIBUTE_VERSION:
|
||||
+ printf ("VERSION: ");
|
||||
+ break;
|
||||
+ case GNU_BUILD_ATTRIBUTE_STACK_PROT:
|
||||
+ printf ("STACK_PROT: ");
|
||||
+ break;
|
||||
+ case GNU_BUILD_ATTRIBUTE_RELRO:
|
||||
+ printf ("RELRO: ");
|
||||
+ break;
|
||||
+ case GNU_BUILD_ATTRIBUTE_STACK_SIZE:
|
||||
+ printf ("STACK_SIZE: ");
|
||||
+ break;
|
||||
+ case GNU_BUILD_ATTRIBUTE_TOOL:
|
||||
+ printf ("TOOL: ");
|
||||
+ break;
|
||||
+ case GNU_BUILD_ATTRIBUTE_ABI:
|
||||
+ printf ("ABI: ");
|
||||
+ break;
|
||||
+ case GNU_BUILD_ATTRIBUTE_PIC:
|
||||
+ printf ("PIC: ");
|
||||
+ break;
|
||||
+ case GNU_BUILD_ATTRIBUTE_SHORT_ENUM:
|
||||
+ printf ("SHORT_ENUM: ");
|
||||
+ break;
|
||||
+ case 32 ... 126:
|
||||
+ printf ("\"%s\": ", &data[1]);
|
||||
+ value += strlen (&data[1]) + 1;
|
||||
+ break;
|
||||
+ default:
|
||||
+ printf ("<unknown>: ");
|
||||
+ break;
|
||||
+ }
|
||||
+
|
||||
+ switch (data[0])
|
||||
+ {
|
||||
+ case GNU_BUILD_ATTRIBUTE_TYPE_NUMERIC:
|
||||
+ {
|
||||
+ /* Any numbers are always in (unsigned) little endian. */
|
||||
+ static const Dwarf dbg
|
||||
+ = { .other_byte_order = MY_ELFDATA != ELFDATA2LSB };
|
||||
+ size_t bytes = namesz - (value - name);
|
||||
+ uint64_t val;
|
||||
+ if (bytes == 1)
|
||||
+ val = *(unsigned char *) value;
|
||||
+ else if (bytes == 2)
|
||||
+ val = read_2ubyte_unaligned (&dbg, value);
|
||||
+ else if (bytes == 4)
|
||||
+ val = read_4ubyte_unaligned (&dbg, value);
|
||||
+ else if (bytes == 8)
|
||||
+ val = read_8ubyte_unaligned (&dbg, value);
|
||||
+ else
|
||||
+ goto unknown;
|
||||
+ printf ("%" PRIx64, val);
|
||||
+ }
|
||||
+ break;
|
||||
+ case GNU_BUILD_ATTRIBUTE_TYPE_STRING:
|
||||
+ printf ("\"%s\"", value);
|
||||
+ break;
|
||||
+ case GNU_BUILD_ATTRIBUTE_TYPE_BOOL_TRUE:
|
||||
+ printf ("TRUE");
|
||||
+ break;
|
||||
+ case GNU_BUILD_ATTRIBUTE_TYPE_BOOL_FALSE:
|
||||
+ printf ("FALSE");
|
||||
+ break;
|
||||
+ default:
|
||||
+ {
|
||||
+ unknown:
|
||||
+ printf ("<unknown>");
|
||||
+ }
|
||||
+ break;
|
||||
+ }
|
||||
+
|
||||
+ printf ("\n");
|
||||
+
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
/* NT_VERSION doesn't have any info. All data is in the name. */
|
||||
if (descsz == 0 && type == NT_VERSION)
|
||||
return;
|
||||
diff --git a/libebl/eblobjnotetypename.c b/libebl/eblobjnotetypename.c
|
||||
index 8cdd781..29a5391 100644
|
||||
--- a/libebl/eblobjnotetypename.c
|
||||
+++ b/libebl/eblobjnotetypename.c
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Return note type name.
|
||||
- Copyright (C) 2002, 2007, 2009, 2011, 2016 Red Hat, Inc.
|
||||
+ Copyright (C) 2002, 2007, 2009, 2011, 2016, 2018 Red Hat, Inc.
|
||||
This file is part of elfutils.
|
||||
Written by Ulrich Drepper <drepper@redhat.com>, 2002.
|
||||
|
||||
@@ -79,6 +79,29 @@ ebl_object_note_type_name (Ebl *ebl, const char *name, uint32_t type,
|
||||
}
|
||||
}
|
||||
|
||||
+ if (strncmp (name, ELF_NOTE_GNU_BUILD_ATTRIBUTE_PREFIX,
|
||||
+ strlen (ELF_NOTE_GNU_BUILD_ATTRIBUTE_PREFIX)) == 0)
|
||||
+ {
|
||||
+ /* GNU Build Attribute notes (ab)use the owner name to store
|
||||
+ most of their data. Don't decode everything here. Just
|
||||
+ the type.*/
|
||||
+ char *t = buf;
|
||||
+ const char *gba = "GNU Build Attribute";
|
||||
+ int w = snprintf (t, len, "%s ", gba);
|
||||
+ t += w;
|
||||
+ len -= w;
|
||||
+ if (type == NT_GNU_BUILD_ATTRIBUTE_OPEN)
|
||||
+ w = snprintf (t, len, "OPEN");
|
||||
+ else if (type == NT_GNU_BUILD_ATTRIBUTE_FUNC)
|
||||
+ w = snprintf (t, len, "FUNC");
|
||||
+ else
|
||||
+ w = snprintf (t, len, "%x", type);
|
||||
+ t += w;
|
||||
+ len -= w;
|
||||
+
|
||||
+ return buf;
|
||||
+ }
|
||||
+
|
||||
if (strcmp (name, "GNU") != 0)
|
||||
{
|
||||
/* NT_VERSION is special, all data is in the name. */
|
||||
diff --git a/libebl/libebl.h b/libebl/libebl.h
|
||||
index 5830654..ca9b9fe 100644
|
||||
--- a/libebl/libebl.h
|
||||
+++ b/libebl/libebl.h
|
||||
@@ -179,8 +179,8 @@ extern const char *ebl_object_note_type_name (Ebl *ebl, const char *name,
|
||||
char *buf, size_t len);
|
||||
|
||||
/* Print information about object note if available. */
|
||||
-extern void ebl_object_note (Ebl *ebl, const char *name, uint32_t type,
|
||||
- uint32_t descsz, const char *desc);
|
||||
+extern void ebl_object_note (Ebl *ebl, uint32_t namesz, const char *name,
|
||||
+ uint32_t type, uint32_t descsz, const char *desc);
|
||||
|
||||
/* Check whether an attribute in a .gnu_attributes section is recognized.
|
||||
Fills in *TAG_NAME with the name for this tag.
|
||||
diff --git a/libelf/elf-knowledge.h b/libelf/elf-knowledge.h
|
||||
index 64f5887..9d3be0f 100644
|
||||
--- a/libelf/elf-knowledge.h
|
||||
+++ b/libelf/elf-knowledge.h
|
||||
@@ -77,4 +77,25 @@
|
||||
|| ((Ehdr)->e_machine == EM_S390 \
|
||||
&& (Ehdr)->e_ident[EI_CLASS] == ELFCLASS64) ? 8 : 4)
|
||||
|
||||
+/* GNU Annobin notes are not fully standardized and abuses the owner name. */
|
||||
+
|
||||
+#define ELF_NOTE_GNU_BUILD_ATTRIBUTE_PREFIX "GA"
|
||||
+
|
||||
+#define NT_GNU_BUILD_ATTRIBUTE_OPEN 0x100
|
||||
+#define NT_GNU_BUILD_ATTRIBUTE_FUNC 0x101
|
||||
+
|
||||
+#define GNU_BUILD_ATTRIBUTE_TYPE_NUMERIC '*'
|
||||
+#define GNU_BUILD_ATTRIBUTE_TYPE_STRING '$'
|
||||
+#define GNU_BUILD_ATTRIBUTE_TYPE_BOOL_TRUE '+'
|
||||
+#define GNU_BUILD_ATTRIBUTE_TYPE_BOOL_FALSE '!'
|
||||
+
|
||||
+#define GNU_BUILD_ATTRIBUTE_VERSION 1
|
||||
+#define GNU_BUILD_ATTRIBUTE_STACK_PROT 2
|
||||
+#define GNU_BUILD_ATTRIBUTE_RELRO 3
|
||||
+#define GNU_BUILD_ATTRIBUTE_STACK_SIZE 4
|
||||
+#define GNU_BUILD_ATTRIBUTE_TOOL 5
|
||||
+#define GNU_BUILD_ATTRIBUTE_ABI 6
|
||||
+#define GNU_BUILD_ATTRIBUTE_PIC 7
|
||||
+#define GNU_BUILD_ATTRIBUTE_SHORT_ENUM 8
|
||||
+
|
||||
#endif /* elf-knowledge.h */
|
||||
diff --git a/src/elflint.c b/src/elflint.c
|
||||
index dff74ee..184ca12 100644
|
||||
--- a/src/elflint.c
|
||||
+++ b/src/elflint.c
|
||||
@@ -4344,6 +4344,19 @@ section [%2d] '%s': unknown core file note type %" PRIu32
|
||||
}
|
||||
goto unknown_note;
|
||||
|
||||
+ case NT_GNU_BUILD_ATTRIBUTE_OPEN:
|
||||
+ case NT_GNU_BUILD_ATTRIBUTE_FUNC:
|
||||
+ /* GNU Build Attributes store most data in the owner
|
||||
+ name, which must start with the
|
||||
+ ELF_NOTE_GNU_BUILD_ATTRIBUTE_PREFIX "GA". */
|
||||
+ if (nhdr.n_namesz >= sizeof ELF_NOTE_GNU_BUILD_ATTRIBUTE_PREFIX
|
||||
+ && strncmp (data->d_buf + name_offset,
|
||||
+ ELF_NOTE_GNU_BUILD_ATTRIBUTE_PREFIX,
|
||||
+ strlen (ELF_NOTE_GNU_BUILD_ATTRIBUTE_PREFIX)) == 0)
|
||||
+ break;
|
||||
+ else
|
||||
+ goto unknown_note;
|
||||
+
|
||||
case 0:
|
||||
/* Linux vDSOs use a type 0 note for the kernel version word. */
|
||||
if (nhdr.n_namesz == sizeof "Linux"
|
||||
diff --git a/src/readelf.c b/src/readelf.c
|
||||
index 659e34f..3a73710 100644
|
||||
--- a/src/readelf.c
|
||||
+++ b/src/readelf.c
|
||||
@@ -12193,10 +12193,21 @@ handle_notes_data (Ebl *ebl, const GElf_Ehdr *ehdr,
|
||||
const char *name = nhdr.n_namesz == 0 ? "" : data->d_buf + name_offset;
|
||||
const char *desc = data->d_buf + desc_offset;
|
||||
|
||||
+ /* GNU Build Attributes are weird, they store most of their data
|
||||
+ into the owner name field. Extract just the owner name
|
||||
+ prefix here, then use the rest later as data. */
|
||||
+ bool is_gnu_build_attr
|
||||
+ = strncmp (name, ELF_NOTE_GNU_BUILD_ATTRIBUTE_PREFIX,
|
||||
+ strlen (ELF_NOTE_GNU_BUILD_ATTRIBUTE_PREFIX)) == 0;
|
||||
+ const char *print_name = (is_gnu_build_attr
|
||||
+ ? ELF_NOTE_GNU_BUILD_ATTRIBUTE_PREFIX : name);
|
||||
+ size_t print_namesz = (is_gnu_build_attr
|
||||
+ ? strlen (print_name) : nhdr.n_namesz);
|
||||
+
|
||||
char buf[100];
|
||||
char buf2[100];
|
||||
printf (gettext (" %-13.*s %9" PRId32 " %s\n"),
|
||||
- (int) nhdr.n_namesz, name, nhdr.n_descsz,
|
||||
+ (int) print_namesz, print_name, nhdr.n_descsz,
|
||||
ehdr->e_type == ET_CORE
|
||||
? ebl_core_note_type_name (ebl, nhdr.n_type,
|
||||
buf, sizeof (buf))
|
||||
@@ -12237,7 +12248,8 @@ handle_notes_data (Ebl *ebl, const GElf_Ehdr *ehdr,
|
||||
handle_core_note (ebl, &nhdr, name, desc);
|
||||
}
|
||||
else
|
||||
- ebl_object_note (ebl, name, nhdr.n_type, nhdr.n_descsz, desc);
|
||||
+ ebl_object_note (ebl, nhdr.n_namesz, name, nhdr.n_type,
|
||||
+ nhdr.n_descsz, desc);
|
||||
}
|
||||
}
|
||||
|
||||
820
elfutils-0.174-gnu-property-note.patch
Normal file
820
elfutils-0.174-gnu-property-note.patch
Normal file
|
|
@ -0,0 +1,820 @@
|
|||
commit 5199e15870e05e5b0b9f98c20fc9b5427aa6dd6a
|
||||
Author: Mark Wielaard <mark@klomp.org>
|
||||
Date: Mon Oct 15 23:35:47 2018 +0200
|
||||
|
||||
Recognize and parse GNU Property notes.
|
||||
|
||||
GNU Property notes are different from normal notes because they use
|
||||
variable alignment/padding of their fields. They are 8 byte aligned,
|
||||
but use 4 byte fields. The name is aligned at 4 bytes and padded so
|
||||
that, the desc is aligned at 8 bytes. The whole note is padded to
|
||||
8 bytes again. For normal notes all fields are both 4 bytes wide and
|
||||
4 bytes aligned.
|
||||
|
||||
To recognize these new kind of ELF Notes a new Elf_Type is introduced,
|
||||
ELF_T_NHDR8. This type is used in the xlate functions to determine
|
||||
how to align and pad the various fields. Since the fields themselves
|
||||
can now have different alignments we will have to keep track of the
|
||||
current alignement and use either NOTE_ALIGN4 or NOTE_ALIGN8 to
|
||||
determine the padding.
|
||||
|
||||
To set the correct Elf_Type on the Elf_Data we use either the section
|
||||
sh_addralign or the segment p_align values. Assuming 8 means the
|
||||
section or segment contains the new style notes, otherwise normal
|
||||
notes.
|
||||
|
||||
When we cannot determine the "alignment" directly, like when parsing
|
||||
special kernel sys files, we check the name "GNU" and type
|
||||
"GNU_PROPERTY_TYPE_0" fields.
|
||||
|
||||
ebl_object_note now parses the new NT_GNU_PROPERTY_TYPE_0 and can
|
||||
extract the GNU_PROPERTY_STACK_SIZE, GNU_PROPERTY_NO_COPY_ON_PROTECTED
|
||||
and GNU_PROPERTY_X86_FEATURE_1_AND types GNU_PROPERTY_X86_FEATURE_1_IBT
|
||||
and GNU_PROPERTY_X86_FEATURE_1_SHSTK.
|
||||
|
||||
Tests are added for extracting the note from sections or segments
|
||||
as set by gcc -fcf-protection.
|
||||
|
||||
Signed-off-by: Mark Wielaard <mark@klomp.org>
|
||||
|
||||
diff --git a/libdwelf/dwelf_elf_gnu_build_id.c b/libdwelf/dwelf_elf_gnu_build_id.c
|
||||
index 8c78c70..dbcfc82 100644
|
||||
--- a/libdwelf/dwelf_elf_gnu_build_id.c
|
||||
+++ b/libdwelf/dwelf_elf_gnu_build_id.c
|
||||
@@ -88,7 +88,9 @@ find_elf_build_id (Dwfl_Module *mod, int e_type, Elf *elf,
|
||||
result = check_notes (elf_getdata_rawchunk (elf,
|
||||
phdr->p_offset,
|
||||
phdr->p_filesz,
|
||||
- ELF_T_NHDR),
|
||||
+ (phdr->p_align == 8
|
||||
+ ? ELF_T_NHDR8
|
||||
+ : ELF_T_NHDR)),
|
||||
phdr->p_vaddr,
|
||||
build_id_bits,
|
||||
build_id_elfaddr,
|
||||
diff --git a/libdwfl/core-file.c b/libdwfl/core-file.c
|
||||
index 84cb89a..01109f4 100644
|
||||
--- a/libdwfl/core-file.c
|
||||
+++ b/libdwfl/core-file.c
|
||||
@@ -496,7 +496,9 @@ dwfl_core_file_report (Dwfl *dwfl, Elf *elf, const char *executable)
|
||||
Elf_Data *notes = elf_getdata_rawchunk (elf,
|
||||
notes_phdr.p_offset,
|
||||
notes_phdr.p_filesz,
|
||||
- ELF_T_NHDR);
|
||||
+ (notes_phdr.p_align == 8
|
||||
+ ? ELF_T_NHDR8
|
||||
+ : ELF_T_NHDR));
|
||||
if (likely (notes != NULL))
|
||||
{
|
||||
size_t pos = 0;
|
||||
diff --git a/libdwfl/dwfl_segment_report_module.c b/libdwfl/dwfl_segment_report_module.c
|
||||
index 8749884..0d633ff 100644
|
||||
--- a/libdwfl/dwfl_segment_report_module.c
|
||||
+++ b/libdwfl/dwfl_segment_report_module.c
|
||||
@@ -27,7 +27,7 @@
|
||||
not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
#include <config.h>
|
||||
-#include "../libelf/libelfP.h" /* For NOTE_ALIGN. */
|
||||
+#include "../libelf/libelfP.h" /* For NOTE_ALIGN4 and NOTE_ALIGN8. */
|
||||
#undef _
|
||||
#include "libdwflP.h"
|
||||
#include "common.h"
|
||||
@@ -451,7 +451,8 @@ dwfl_segment_report_module (Dwfl *dwfl, int ndx, const char *name,
|
||||
GElf_Addr build_id_vaddr = 0;
|
||||
|
||||
/* Consider a PT_NOTE we've found in the image. */
|
||||
- inline void consider_notes (GElf_Addr vaddr, GElf_Xword filesz)
|
||||
+ inline void consider_notes (GElf_Addr vaddr, GElf_Xword filesz,
|
||||
+ GElf_Xword align)
|
||||
{
|
||||
/* If we have already seen a build ID, we don't care any more. */
|
||||
if (build_id != NULL || filesz == 0)
|
||||
@@ -478,7 +479,8 @@ dwfl_segment_report_module (Dwfl *dwfl, int ndx, const char *name,
|
||||
notes = malloc (filesz);
|
||||
if (unlikely (notes == NULL))
|
||||
return;
|
||||
- xlatefrom.d_type = xlateto.d_type = ELF_T_NHDR;
|
||||
+ xlatefrom.d_type = xlateto.d_type = (align == 8
|
||||
+ ? ELF_T_NHDR8 : ELF_T_NHDR);
|
||||
xlatefrom.d_buf = (void *) data;
|
||||
xlatefrom.d_size = filesz;
|
||||
xlateto.d_buf = notes;
|
||||
@@ -489,15 +491,23 @@ dwfl_segment_report_module (Dwfl *dwfl, int ndx, const char *name,
|
||||
}
|
||||
|
||||
const GElf_Nhdr *nh = notes;
|
||||
- while ((const void *) nh < (const void *) notes + filesz)
|
||||
- {
|
||||
- const void *note_name = nh + 1;
|
||||
- const void *note_desc = note_name + NOTE_ALIGN (nh->n_namesz);
|
||||
- if (unlikely ((size_t) ((const void *) notes + filesz
|
||||
- - note_desc) < nh->n_descsz))
|
||||
+ size_t len = 0;
|
||||
+ while (filesz > len + sizeof (*nh))
|
||||
+ {
|
||||
+ const void *note_name;
|
||||
+ const void *note_desc;
|
||||
+
|
||||
+ len += sizeof (*nh);
|
||||
+ note_name = notes + len;
|
||||
+
|
||||
+ len += nh->n_namesz;
|
||||
+ len = align == 8 ? NOTE_ALIGN8 (len) : NOTE_ALIGN4 (len);
|
||||
+ note_desc = notes + len;
|
||||
+
|
||||
+ if (unlikely (filesz < len + nh->n_descsz))
|
||||
break;
|
||||
|
||||
- if (nh->n_type == NT_GNU_BUILD_ID
|
||||
+ if (nh->n_type == NT_GNU_BUILD_ID
|
||||
&& nh->n_descsz > 0
|
||||
&& nh->n_namesz == sizeof "GNU"
|
||||
&& !memcmp (note_name, "GNU", sizeof "GNU"))
|
||||
@@ -510,7 +520,9 @@ dwfl_segment_report_module (Dwfl *dwfl, int ndx, const char *name,
|
||||
break;
|
||||
}
|
||||
|
||||
- nh = note_desc + NOTE_ALIGN (nh->n_descsz);
|
||||
+ len += nh->n_descsz;
|
||||
+ len = align == 8 ? NOTE_ALIGN8 (len) : NOTE_ALIGN4 (len);
|
||||
+ nh = (void *) notes + len;
|
||||
}
|
||||
|
||||
done:
|
||||
@@ -535,7 +547,7 @@ dwfl_segment_report_module (Dwfl *dwfl, int ndx, const char *name,
|
||||
case PT_NOTE:
|
||||
/* We calculate from the p_offset of the note segment,
|
||||
because we don't yet know the bias for its p_vaddr. */
|
||||
- consider_notes (start + offset, filesz);
|
||||
+ consider_notes (start + offset, filesz, align);
|
||||
break;
|
||||
|
||||
case PT_LOAD:
|
||||
diff --git a/libdwfl/linux-core-attach.c b/libdwfl/linux-core-attach.c
|
||||
index 9f05f72..6c99b9e 100644
|
||||
--- a/libdwfl/linux-core-attach.c
|
||||
+++ b/libdwfl/linux-core-attach.c
|
||||
@@ -355,7 +355,9 @@ dwfl_core_file_attach (Dwfl *dwfl, Elf *core)
|
||||
if (phdr != NULL && phdr->p_type == PT_NOTE)
|
||||
{
|
||||
note_data = elf_getdata_rawchunk (core, phdr->p_offset,
|
||||
- phdr->p_filesz, ELF_T_NHDR);
|
||||
+ phdr->p_filesz, (phdr->p_align == 8
|
||||
+ ? ELF_T_NHDR8
|
||||
+ : ELF_T_NHDR));
|
||||
break;
|
||||
}
|
||||
}
|
||||
diff --git a/libdwfl/linux-kernel-modules.c b/libdwfl/linux-kernel-modules.c
|
||||
index 9d0fef2..360e4ee 100644
|
||||
--- a/libdwfl/linux-kernel-modules.c
|
||||
+++ b/libdwfl/linux-kernel-modules.c
|
||||
@@ -39,6 +39,7 @@
|
||||
#include <config.h>
|
||||
#include <system.h>
|
||||
|
||||
+#include "libelfP.h"
|
||||
#include "libdwflP.h"
|
||||
#include <inttypes.h>
|
||||
#include <errno.h>
|
||||
@@ -554,15 +555,41 @@ check_notes (Dwfl_Module *mod, const char *notesfile,
|
||||
return 1;
|
||||
|
||||
unsigned char *p = buf.data;
|
||||
+ size_t len = 0;
|
||||
while (p < &buf.data[n])
|
||||
{
|
||||
/* No translation required since we are reading the native kernel. */
|
||||
GElf_Nhdr *nhdr = (void *) p;
|
||||
- p += sizeof *nhdr;
|
||||
+ len += sizeof *nhdr;
|
||||
+ p += len;
|
||||
unsigned char *name = p;
|
||||
- p += (nhdr->n_namesz + 3) & -4U;
|
||||
- unsigned char *bits = p;
|
||||
- p += (nhdr->n_descsz + 3) & -4U;
|
||||
+ unsigned char *bits;
|
||||
+ /* This is somewhat ugly, GNU Property notes use different padding,
|
||||
+ but all we have is the file content, so we have to actually check
|
||||
+ the name and type. */
|
||||
+ if (nhdr->n_type == NT_GNU_PROPERTY_TYPE_0
|
||||
+ && nhdr->n_namesz == sizeof "GNU"
|
||||
+ && name + nhdr->n_namesz < &buf.data[n]
|
||||
+ && !memcmp (name, "GNU", sizeof "GNU"))
|
||||
+ {
|
||||
+ len += nhdr->n_namesz;
|
||||
+ len = NOTE_ALIGN8 (len);
|
||||
+ p = buf.data + len;
|
||||
+ bits = p;
|
||||
+ len += nhdr->n_descsz;
|
||||
+ len = NOTE_ALIGN8 (len);
|
||||
+ p = buf.data + len;
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ len += nhdr->n_namesz;
|
||||
+ len = NOTE_ALIGN4 (len);
|
||||
+ p = buf.data + len;
|
||||
+ bits = p;
|
||||
+ len += nhdr->n_descsz;
|
||||
+ len = NOTE_ALIGN4 (len);
|
||||
+ p = buf.data + len;
|
||||
+ }
|
||||
|
||||
if (p <= &buf.data[n]
|
||||
&& nhdr->n_type == NT_GNU_BUILD_ID
|
||||
diff --git a/libebl/eblobjnote.c b/libebl/eblobjnote.c
|
||||
index ca4f155..57e9f52 100644
|
||||
--- a/libebl/eblobjnote.c
|
||||
+++ b/libebl/eblobjnote.c
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Print contents of object file note.
|
||||
- Copyright (C) 2002, 2007, 2009, 2011, 2015, 2016 Red Hat, Inc.
|
||||
+ Copyright (C) 2002, 2007, 2009, 2011, 2015, 2016, 2018 Red Hat, Inc.
|
||||
This file is part of elfutils.
|
||||
Written by Ulrich Drepper <drepper@redhat.com>, 2002.
|
||||
|
||||
@@ -37,6 +37,8 @@
|
||||
#include <string.h>
|
||||
#include <libeblP.h>
|
||||
|
||||
+#include "libelfP.h"
|
||||
+
|
||||
|
||||
void
|
||||
ebl_object_note (Ebl *ebl, const char *name, uint32_t type,
|
||||
@@ -153,6 +155,187 @@ ebl_object_note (Ebl *ebl, const char *name, uint32_t type,
|
||||
(int) descsz, desc);
|
||||
break;
|
||||
|
||||
+ case NT_GNU_PROPERTY_TYPE_0:
|
||||
+ if (strcmp (name, "GNU") == 0 && descsz > 0)
|
||||
+ {
|
||||
+ /* There are at least 2 words. type and datasz. */
|
||||
+ while (descsz >= 8)
|
||||
+ {
|
||||
+ struct pr_prop
|
||||
+ {
|
||||
+ GElf_Word pr_type;
|
||||
+ GElf_Word pr_datasz;
|
||||
+ } prop;
|
||||
+
|
||||
+ Elf_Data in =
|
||||
+ {
|
||||
+ .d_version = EV_CURRENT,
|
||||
+ .d_type = ELF_T_WORD,
|
||||
+ .d_size = 8,
|
||||
+ .d_buf = (void *) desc
|
||||
+ };
|
||||
+ Elf_Data out =
|
||||
+ {
|
||||
+ .d_version = EV_CURRENT,
|
||||
+ .d_type = ELF_T_WORD,
|
||||
+ .d_size = descsz,
|
||||
+ .d_buf = (void *) &prop
|
||||
+ };
|
||||
+
|
||||
+ if (gelf_xlatetom (ebl->elf, &out, &in,
|
||||
+ elf_getident (ebl->elf,
|
||||
+ NULL)[EI_DATA]) == NULL)
|
||||
+ {
|
||||
+ printf ("%s\n", elf_errmsg (-1));
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ desc += 8;
|
||||
+ descsz -= 8;
|
||||
+
|
||||
+ int elfclass = gelf_getclass (ebl->elf);
|
||||
+ char *elfident = elf_getident (ebl->elf, NULL);
|
||||
+ GElf_Ehdr ehdr;
|
||||
+ gelf_getehdr (ebl->elf, &ehdr);
|
||||
+
|
||||
+ /* Prefix. */
|
||||
+ printf (" ");
|
||||
+ if (prop.pr_type == GNU_PROPERTY_STACK_SIZE)
|
||||
+ {
|
||||
+ printf ("STACK_SIZE ");
|
||||
+ if (prop.pr_datasz == 4 || prop.pr_datasz == 8)
|
||||
+ {
|
||||
+ GElf_Addr addr;
|
||||
+ in.d_type = ELF_T_ADDR;
|
||||
+ out.d_type = ELF_T_ADDR;
|
||||
+ in.d_size = prop.pr_datasz;
|
||||
+ out.d_size = sizeof (addr);
|
||||
+ in.d_buf = (void *) desc;
|
||||
+ out.d_buf = (void *) &addr;
|
||||
+
|
||||
+ if (gelf_xlatetom (ebl->elf, &out, &in,
|
||||
+ elfident[EI_DATA]) == NULL)
|
||||
+ {
|
||||
+ printf ("%s\n", elf_errmsg (-1));
|
||||
+ return;
|
||||
+ }
|
||||
+ printf ("%#" PRIx64 "\n", addr);
|
||||
+ }
|
||||
+ else
|
||||
+ printf (" (garbage datasz: %" PRIx32 ")\n",
|
||||
+ prop.pr_datasz);
|
||||
+ }
|
||||
+ else if (prop.pr_type == GNU_PROPERTY_NO_COPY_ON_PROTECTED)
|
||||
+ {
|
||||
+ printf ("NO_COPY_ON_PROTECTION");
|
||||
+ if (prop.pr_datasz == 0)
|
||||
+ printf ("\n");
|
||||
+ else
|
||||
+ printf (" (garbage datasz: %" PRIx32 ")\n",
|
||||
+ prop.pr_datasz);
|
||||
+ }
|
||||
+ else if (prop.pr_type >= GNU_PROPERTY_LOPROC
|
||||
+ && prop.pr_type <= GNU_PROPERTY_HIPROC
|
||||
+ && (ehdr.e_machine == EM_386
|
||||
+ || ehdr.e_machine == EM_X86_64))
|
||||
+ {
|
||||
+ printf ("X86 ");
|
||||
+ if (prop.pr_type == GNU_PROPERTY_X86_FEATURE_1_AND)
|
||||
+ {
|
||||
+ printf ("FEATURE_1_AND: ");
|
||||
+
|
||||
+ if (prop.pr_datasz == 4)
|
||||
+ {
|
||||
+ GElf_Word data;
|
||||
+ in.d_type = ELF_T_WORD;
|
||||
+ out.d_type = ELF_T_WORD;
|
||||
+ in.d_size = 4;
|
||||
+ out.d_size = 4;
|
||||
+ in.d_buf = (void *) desc;
|
||||
+ out.d_buf = (void *) &data;
|
||||
+
|
||||
+ if (gelf_xlatetom (ebl->elf, &out, &in,
|
||||
+ elfident[EI_DATA]) == NULL)
|
||||
+ {
|
||||
+ printf ("%s\n", elf_errmsg (-1));
|
||||
+ return;
|
||||
+ }
|
||||
+ printf ("%08" PRIx32 " ", data);
|
||||
+
|
||||
+ if ((data & GNU_PROPERTY_X86_FEATURE_1_IBT)
|
||||
+ != 0)
|
||||
+ {
|
||||
+ printf ("IBT");
|
||||
+ data &= ~GNU_PROPERTY_X86_FEATURE_1_IBT;
|
||||
+ if (data != 0)
|
||||
+ printf (" ");
|
||||
+ }
|
||||
+
|
||||
+ if ((data & GNU_PROPERTY_X86_FEATURE_1_SHSTK)
|
||||
+ != 0)
|
||||
+ {
|
||||
+ printf ("SHSTK");
|
||||
+ data &= ~GNU_PROPERTY_X86_FEATURE_1_SHSTK;
|
||||
+ if (data != 0)
|
||||
+ printf (" ");
|
||||
+ }
|
||||
+
|
||||
+ if (data != 0)
|
||||
+ printf ("UNKNOWN");
|
||||
+ }
|
||||
+ else
|
||||
+ printf ("<bad datasz: %" PRId32 ">",
|
||||
+ prop.pr_datasz);
|
||||
+
|
||||
+ printf ("\n");
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ printf ("%#" PRIx32, prop.pr_type);
|
||||
+ if (prop.pr_datasz > 0)
|
||||
+ {
|
||||
+ printf (" data: ");
|
||||
+ size_t i;
|
||||
+ for (i = 0; i < prop.pr_datasz - 1; i++)
|
||||
+ printf ("%02" PRIx8 " ", (uint8_t) desc[i]);
|
||||
+ printf ("%02" PRIx8 "\n", (uint8_t) desc[i]);
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ if (prop.pr_type >= GNU_PROPERTY_LOPROC
|
||||
+ && prop.pr_type <= GNU_PROPERTY_HIPROC)
|
||||
+ printf ("proc_type %#" PRIx32, prop.pr_type);
|
||||
+ else if (prop.pr_type >= GNU_PROPERTY_LOUSER
|
||||
+ && prop.pr_type <= GNU_PROPERTY_HIUSER)
|
||||
+ printf ("app_type %#" PRIx32, prop.pr_type);
|
||||
+ else
|
||||
+ printf ("unknown_type %#" PRIx32, prop.pr_type);
|
||||
+
|
||||
+ if (prop.pr_datasz > 0)
|
||||
+ {
|
||||
+ printf (" data: ");
|
||||
+ size_t i;
|
||||
+ for (i = 0; i < prop.pr_datasz - 1; i++)
|
||||
+ printf ("%02" PRIx8 " ", (uint8_t) desc[i]);
|
||||
+ printf ("%02" PRIx8 "\n", (uint8_t) desc[i]);
|
||||
+ }
|
||||
+ }
|
||||
+ if (elfclass == ELFCLASS32)
|
||||
+ {
|
||||
+ desc += NOTE_ALIGN4 (prop.pr_datasz);
|
||||
+ descsz -= NOTE_ALIGN4 (prop.pr_datasz);
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ desc += NOTE_ALIGN8 (prop.pr_datasz);
|
||||
+ descsz -= NOTE_ALIGN8 (prop.pr_datasz);
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ break;
|
||||
+
|
||||
case NT_GNU_ABI_TAG:
|
||||
if (strcmp (name, "GNU") == 0 && descsz >= 8 && descsz % 4 == 0)
|
||||
{
|
||||
diff --git a/libebl/eblobjnotetypename.c b/libebl/eblobjnotetypename.c
|
||||
index db040d2..af23cae 100644
|
||||
--- a/libebl/eblobjnotetypename.c
|
||||
+++ b/libebl/eblobjnotetypename.c
|
||||
@@ -91,6 +91,7 @@ ebl_object_note_type_name (Ebl *ebl, const char *name, uint32_t type,
|
||||
KNOWNSTYPE (GNU_HWCAP),
|
||||
KNOWNSTYPE (GNU_BUILD_ID),
|
||||
KNOWNSTYPE (GNU_GOLD_VERSION),
|
||||
+ KNOWNSTYPE (GNU_PROPERTY_TYPE_0),
|
||||
};
|
||||
|
||||
/* Handle standard names. */
|
||||
diff --git a/libelf/elf32_xlatetom.c b/libelf/elf32_xlatetom.c
|
||||
index 13cd485..3b94cac 100644
|
||||
--- a/libelf/elf32_xlatetom.c
|
||||
+++ b/libelf/elf32_xlatetom.c
|
||||
@@ -60,7 +60,7 @@ elfw2(LIBELFBITS, xlatetom) (Elf_Data *dest, const Elf_Data *src,
|
||||
/* We shouldn't require integer number of records when processing
|
||||
notes. Payload bytes follow the header immediately, it's not an
|
||||
array of records as is the case otherwise. */
|
||||
- if (src->d_type != ELF_T_NHDR
|
||||
+ if (src->d_type != ELF_T_NHDR && src->d_type != ELF_T_NHDR8
|
||||
&& src->d_size % recsize != 0)
|
||||
{
|
||||
__libelf_seterrno (ELF_E_INVALID_DATA);
|
||||
diff --git a/libelf/elf_compress.c b/libelf/elf_compress.c
|
||||
index 711be59..fd412e8 100644
|
||||
--- a/libelf/elf_compress.c
|
||||
+++ b/libelf/elf_compress.c
|
||||
@@ -513,7 +513,8 @@ elf_compress (Elf_Scn *scn, int type, unsigned int flags)
|
||||
|
||||
__libelf_reset_rawdata (scn, scn->zdata_base,
|
||||
scn->zdata_size, scn->zdata_align,
|
||||
- __libelf_data_type (elf, sh_type));
|
||||
+ __libelf_data_type (elf, sh_type,
|
||||
+ scn->zdata_align));
|
||||
|
||||
return 1;
|
||||
}
|
||||
diff --git a/libelf/elf_compress_gnu.c b/libelf/elf_compress_gnu.c
|
||||
index dfa7c57..198dc7d 100644
|
||||
--- a/libelf/elf_compress_gnu.c
|
||||
+++ b/libelf/elf_compress_gnu.c
|
||||
@@ -196,7 +196,7 @@ elf_compress_gnu (Elf_Scn *scn, int inflate, unsigned int flags)
|
||||
}
|
||||
|
||||
__libelf_reset_rawdata (scn, buf_out, size, sh_addralign,
|
||||
- __libelf_data_type (elf, sh_type));
|
||||
+ __libelf_data_type (elf, sh_type, sh_addralign));
|
||||
|
||||
scn->zdata_base = buf_out;
|
||||
|
||||
diff --git a/libelf/elf_getdata.c b/libelf/elf_getdata.c
|
||||
index 278dfa8..4f80aaf 100644
|
||||
--- a/libelf/elf_getdata.c
|
||||
+++ b/libelf/elf_getdata.c
|
||||
@@ -65,7 +65,7 @@ static const Elf_Type shtype_map[EV_NUM - 1][TYPEIDX (SHT_HISUNW) + 1] =
|
||||
[SHT_PREINIT_ARRAY] = ELF_T_ADDR,
|
||||
[SHT_GROUP] = ELF_T_WORD,
|
||||
[SHT_SYMTAB_SHNDX] = ELF_T_WORD,
|
||||
- [SHT_NOTE] = ELF_T_NHDR,
|
||||
+ [SHT_NOTE] = ELF_T_NHDR, /* Need alignment to guess ELF_T_NHDR8. */
|
||||
[TYPEIDX (SHT_GNU_verdef)] = ELF_T_VDEF,
|
||||
[TYPEIDX (SHT_GNU_verneed)] = ELF_T_VNEED,
|
||||
[TYPEIDX (SHT_GNU_versym)] = ELF_T_HALF,
|
||||
@@ -106,6 +106,7 @@ const uint_fast8_t __libelf_type_aligns[EV_NUM - 1][ELFCLASSNUM - 1][ELF_T_NUM]
|
||||
[ELF_T_GNUHASH] = __alignof__ (Elf32_Word), \
|
||||
[ELF_T_AUXV] = __alignof__ (ElfW2(Bits,auxv_t)), \
|
||||
[ELF_T_CHDR] = __alignof__ (ElfW2(Bits,Chdr)), \
|
||||
+ [ELF_T_NHDR8] = 8 /* Special case for GNU Property note. */ \
|
||||
}
|
||||
[EV_CURRENT - 1] =
|
||||
{
|
||||
@@ -118,7 +119,7 @@ const uint_fast8_t __libelf_type_aligns[EV_NUM - 1][ELFCLASSNUM - 1][ELF_T_NUM]
|
||||
|
||||
Elf_Type
|
||||
internal_function
|
||||
-__libelf_data_type (Elf *elf, int sh_type)
|
||||
+__libelf_data_type (Elf *elf, int sh_type, GElf_Xword align)
|
||||
{
|
||||
/* Some broken ELF ABI for 64-bit machines use the wrong hash table
|
||||
entry size. See elf-knowledge.h for more information. */
|
||||
@@ -129,7 +130,13 @@ __libelf_data_type (Elf *elf, int sh_type)
|
||||
return (SH_ENTSIZE_HASH (ehdr) == 4 ? ELF_T_WORD : ELF_T_XWORD);
|
||||
}
|
||||
else
|
||||
- return shtype_map[LIBELF_EV_IDX][TYPEIDX (sh_type)];
|
||||
+ {
|
||||
+ Elf_Type t = shtype_map[LIBELF_EV_IDX][TYPEIDX (sh_type)];
|
||||
+ /* Special case for GNU Property notes. */
|
||||
+ if (t == ELF_T_NHDR && align == 8)
|
||||
+ t = ELF_T_NHDR8;
|
||||
+ return t;
|
||||
+ }
|
||||
}
|
||||
|
||||
/* Convert the data in the current section. */
|
||||
@@ -272,7 +279,9 @@ __libelf_set_rawdata_wrlock (Elf_Scn *scn)
|
||||
else
|
||||
{
|
||||
Elf_Type t = shtype_map[LIBELF_EV_IDX][TYPEIDX (type)];
|
||||
- if (t == ELF_T_VDEF || t == ELF_T_NHDR
|
||||
+ if (t == ELF_T_NHDR && align == 8)
|
||||
+ t = ELF_T_NHDR8;
|
||||
+ if (t == ELF_T_VDEF || t == ELF_T_NHDR || t == ELF_T_NHDR8
|
||||
|| (t == ELF_T_GNUHASH && elf->class == ELFCLASS64))
|
||||
entsize = 1;
|
||||
else
|
||||
@@ -357,7 +366,7 @@ __libelf_set_rawdata_wrlock (Elf_Scn *scn)
|
||||
if ((flags & SHF_COMPRESSED) != 0)
|
||||
scn->rawdata.d.d_type = ELF_T_CHDR;
|
||||
else
|
||||
- scn->rawdata.d.d_type = __libelf_data_type (elf, type);
|
||||
+ scn->rawdata.d.d_type = __libelf_data_type (elf, type, align);
|
||||
scn->rawdata.d.d_off = 0;
|
||||
|
||||
/* Make sure the alignment makes sense. d_align should be aligned both
|
||||
diff --git a/libelf/gelf_fsize.c b/libelf/gelf_fsize.c
|
||||
index 0c50926..d04ec5d 100644
|
||||
--- a/libelf/gelf_fsize.c
|
||||
+++ b/libelf/gelf_fsize.c
|
||||
@@ -64,6 +64,8 @@ const size_t __libelf_type_sizes[EV_NUM - 1][ELFCLASSNUM - 1][ELF_T_NUM] =
|
||||
[ELF_T_VNEED] = sizeof (ElfW2(LIBELFBITS, Ext_Verneed)), \
|
||||
[ELF_T_VNAUX] = sizeof (ElfW2(LIBELFBITS, Ext_Vernaux)), \
|
||||
[ELF_T_NHDR] = sizeof (ElfW2(LIBELFBITS, Ext_Nhdr)), \
|
||||
+ /* Note the header size is the same, but padding is different. */ \
|
||||
+ [ELF_T_NHDR8] = sizeof (ElfW2(LIBELFBITS, Ext_Nhdr)), \
|
||||
[ELF_T_SYMINFO] = sizeof (ElfW2(LIBELFBITS, Ext_Syminfo)), \
|
||||
[ELF_T_MOVE] = sizeof (ElfW2(LIBELFBITS, Ext_Move)), \
|
||||
[ELF_T_LIB] = sizeof (ElfW2(LIBELFBITS, Ext_Lib)), \
|
||||
diff --git a/libelf/gelf_getnote.c b/libelf/gelf_getnote.c
|
||||
index c75edda..6d33b35 100644
|
||||
--- a/libelf/gelf_getnote.c
|
||||
+++ b/libelf/gelf_getnote.c
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Get note information at the supplied offset.
|
||||
- Copyright (C) 2007, 2014, 2015 Red Hat, Inc.
|
||||
+ Copyright (C) 2007, 2014, 2015, 2018 Red Hat, Inc.
|
||||
This file is part of elfutils.
|
||||
|
||||
This file is free software; you can redistribute it and/or modify
|
||||
@@ -43,7 +43,7 @@ gelf_getnote (Elf_Data *data, size_t offset, GElf_Nhdr *result,
|
||||
if (data == NULL)
|
||||
return 0;
|
||||
|
||||
- if (unlikely (data->d_type != ELF_T_NHDR))
|
||||
+ if (unlikely (data->d_type != ELF_T_NHDR && data->d_type != ELF_T_NHDR8))
|
||||
{
|
||||
__libelf_seterrno (ELF_E_INVALID_HANDLE);
|
||||
return 0;
|
||||
@@ -69,27 +69,42 @@ gelf_getnote (Elf_Data *data, size_t offset, GElf_Nhdr *result,
|
||||
const GElf_Nhdr *n = data->d_buf + offset;
|
||||
offset += sizeof *n;
|
||||
|
||||
- /* Include padding. Check below for overflow. */
|
||||
- GElf_Word namesz = NOTE_ALIGN (n->n_namesz);
|
||||
- GElf_Word descsz = NOTE_ALIGN (n->n_descsz);
|
||||
-
|
||||
- if (unlikely (offset > data->d_size
|
||||
- || data->d_size - offset < namesz
|
||||
- || (namesz == 0 && n->n_namesz != 0)))
|
||||
+ if (offset > data->d_size)
|
||||
offset = 0;
|
||||
else
|
||||
{
|
||||
+ /* 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
|
||||
+ for GNU Property notes, then it should be 8. So align
|
||||
+ the offset, after adding the namesz, and include padding
|
||||
+ in descsz to get to the end. */
|
||||
*name_offset = offset;
|
||||
- offset += namesz;
|
||||
- if (unlikely (offset > data->d_size
|
||||
- || data->d_size - offset < descsz
|
||||
- || (descsz == 0 && n->n_descsz != 0)))
|
||||
+ offset += n->n_namesz;
|
||||
+ if (offset > data->d_size)
|
||||
offset = 0;
|
||||
else
|
||||
{
|
||||
- *desc_offset = offset;
|
||||
- offset += descsz;
|
||||
- *result = *n;
|
||||
+ /* Include padding. Check below for overflow. */
|
||||
+ GElf_Word descsz = (data->d_type == ELF_T_NHDR8
|
||||
+ ? NOTE_ALIGN8 (n->n_descsz)
|
||||
+ : NOTE_ALIGN4 (n->n_descsz));
|
||||
+
|
||||
+ if (data->d_type == ELF_T_NHDR8)
|
||||
+ offset = NOTE_ALIGN8 (offset);
|
||||
+ else
|
||||
+ offset = NOTE_ALIGN4 (offset);
|
||||
+
|
||||
+ if (unlikely (offset > data->d_size
|
||||
+ || data->d_size - offset < descsz
|
||||
+ || (descsz == 0 && n->n_descsz != 0)))
|
||||
+ offset = 0;
|
||||
+ else
|
||||
+ {
|
||||
+ *desc_offset = offset;
|
||||
+ offset += descsz;
|
||||
+ *result = *n;
|
||||
+ }
|
||||
}
|
||||
}
|
||||
}
|
||||
diff --git a/libelf/gelf_xlate.c b/libelf/gelf_xlate.c
|
||||
index 479f143..b5d6ef3 100644
|
||||
--- a/libelf/gelf_xlate.c
|
||||
+++ b/libelf/gelf_xlate.c
|
||||
@@ -195,7 +195,8 @@ const xfct_t __elf_xfctstom[EV_NUM - 1][EV_NUM - 1][ELFCLASSNUM - 1][ELF_T_NUM]
|
||||
[ELF_T_VDAUX] = elf_cvt_Verdef, \
|
||||
[ELF_T_VNEED] = elf_cvt_Verneed, \
|
||||
[ELF_T_VNAUX] = elf_cvt_Verneed, \
|
||||
- [ELF_T_NHDR] = elf_cvt_note, \
|
||||
+ [ELF_T_NHDR] = elf_cvt_note4, \
|
||||
+ [ELF_T_NHDR8] = elf_cvt_note8, \
|
||||
[ELF_T_SYMINFO] = ElfW2(Bits, cvt_Syminfo), \
|
||||
[ELF_T_MOVE] = ElfW2(Bits, cvt_Move), \
|
||||
[ELF_T_LIB] = ElfW2(Bits, cvt_Lib), \
|
||||
diff --git a/libelf/libelf.h b/libelf/libelf.h
|
||||
index d11358c..1ff11c9 100644
|
||||
--- a/libelf/libelf.h
|
||||
+++ b/libelf/libelf.h
|
||||
@@ -117,6 +117,8 @@ typedef enum
|
||||
ELF_T_GNUHASH, /* GNU-style hash section. */
|
||||
ELF_T_AUXV, /* Elf32_auxv_t, Elf64_auxv_t, ... */
|
||||
ELF_T_CHDR, /* Compressed, Elf32_Chdr, Elf64_Chdr, ... */
|
||||
+ ELF_T_NHDR8, /* Special GNU Properties note. Same as Nhdr,
|
||||
+ except padding. */
|
||||
/* Keep this the last entry. */
|
||||
ELF_T_NUM
|
||||
} Elf_Type;
|
||||
diff --git a/libelf/libelfP.h b/libelf/libelfP.h
|
||||
index ed216c8..fa6d55d 100644
|
||||
--- a/libelf/libelfP.h
|
||||
+++ b/libelf/libelfP.h
|
||||
@@ -452,7 +452,8 @@ extern const uint_fast8_t __libelf_type_aligns[EV_NUM - 1][ELFCLASSNUM - 1][ELF_
|
||||
/* Given an Elf handle and a section type returns the Elf_Data d_type.
|
||||
Should not be called when SHF_COMPRESSED is set, the d_type should
|
||||
be ELF_T_BYTE. */
|
||||
-extern Elf_Type __libelf_data_type (Elf *elf, int sh_type) internal_function;
|
||||
+extern Elf_Type __libelf_data_type (Elf *elf, int sh_type, GElf_Xword align)
|
||||
+ internal_function;
|
||||
|
||||
/* The libelf API does not have such a function but it is still useful.
|
||||
Get the memory size for the given type.
|
||||
@@ -624,8 +625,13 @@ extern void __libelf_reset_rawdata (Elf_Scn *scn, void *buf, size_t size,
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
-/* Align offset to 4 bytes as needed for note name and descriptor data. */
|
||||
-#define NOTE_ALIGN(n) (((n) + 3) & -4U)
|
||||
+/* Align offset to 4 bytes as needed for note name and descriptor data.
|
||||
+ This is almost always used, except for GNU Property notes, which use
|
||||
+ 8 byte padding... */
|
||||
+#define NOTE_ALIGN4(n) (((n) + 3) & -4U)
|
||||
+
|
||||
+/* Special note padding rule for GNU Property notes. */
|
||||
+#define NOTE_ALIGN8(n) (((n) + 7) & -8U)
|
||||
|
||||
/* Convenience macro. */
|
||||
#define INVALID_NDX(ndx, type, data) \
|
||||
diff --git a/libelf/note_xlate.h b/libelf/note_xlate.h
|
||||
index 62c6f63..9bdc3e2 100644
|
||||
--- a/libelf/note_xlate.h
|
||||
+++ b/libelf/note_xlate.h
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Conversion functions for notes.
|
||||
- Copyright (C) 2007, 2009, 2014 Red Hat, Inc.
|
||||
+ Copyright (C) 2007, 2009, 2014, 2018 Red Hat, Inc.
|
||||
This file is part of elfutils.
|
||||
|
||||
This file is free software; you can redistribute it and/or modify
|
||||
@@ -27,38 +27,60 @@
|
||||
not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
static void
|
||||
-elf_cvt_note (void *dest, const void *src, size_t len, int encode)
|
||||
+elf_cvt_note (void *dest, const void *src, size_t len, int encode,
|
||||
+ bool nhdr8)
|
||||
{
|
||||
+ /* Note that the header is always the same size, but the padding
|
||||
+ differs for GNU Property notes. */
|
||||
assert (sizeof (Elf32_Nhdr) == sizeof (Elf64_Nhdr));
|
||||
|
||||
while (len >= sizeof (Elf32_Nhdr))
|
||||
{
|
||||
+ /* Convert the header. */
|
||||
(1 ? Elf32_cvt_Nhdr : Elf64_cvt_Nhdr) (dest, src, sizeof (Elf32_Nhdr),
|
||||
encode);
|
||||
const Elf32_Nhdr *n = encode ? src : dest;
|
||||
- Elf32_Word namesz = NOTE_ALIGN (n->n_namesz);
|
||||
- Elf32_Word descsz = NOTE_ALIGN (n->n_descsz);
|
||||
|
||||
- len -= sizeof *n;
|
||||
- src += sizeof *n;
|
||||
- dest += sizeof *n;
|
||||
+ size_t note_len = sizeof *n;
|
||||
|
||||
- if (namesz > len)
|
||||
+ /* desc needs to be aligned. */
|
||||
+ note_len += n->n_namesz;
|
||||
+ note_len = nhdr8 ? NOTE_ALIGN8 (note_len) : NOTE_ALIGN4 (note_len);
|
||||
+ if (note_len > len || note_len < 8)
|
||||
break;
|
||||
- len -= namesz;
|
||||
- if (descsz > len)
|
||||
+
|
||||
+ /* data as a whole needs to be aligned. */
|
||||
+ note_len += n->n_descsz;
|
||||
+ note_len = nhdr8 ? NOTE_ALIGN8 (note_len) : NOTE_ALIGN4 (note_len);
|
||||
+ if (note_len > len || note_len < 8)
|
||||
break;
|
||||
- len -= descsz;
|
||||
|
||||
+ /* Copy or skip the note data. */
|
||||
+ size_t note_data_len = note_len - sizeof *n;
|
||||
+ src += sizeof *n;
|
||||
+ dest += sizeof *n;
|
||||
if (src != dest)
|
||||
- memcpy (dest, src, namesz + descsz);
|
||||
+ memcpy (dest, src, note_data_len);
|
||||
|
||||
- src += namesz + descsz;
|
||||
- dest += namesz + descsz;
|
||||
+ src += note_data_len;
|
||||
+ dest += note_data_len;
|
||||
+ len -= note_len;
|
||||
}
|
||||
|
||||
- /* Copy opver any leftover data unconcerted. Probably part of
|
||||
+ /* Copy over any leftover data unconverted. Probably part of
|
||||
truncated name/desc data. */
|
||||
if (unlikely (len > 0) && src != dest)
|
||||
memcpy (dest, src, len);
|
||||
}
|
||||
+
|
||||
+static void
|
||||
+elf_cvt_note4 (void *dest, const void *src, size_t len, int encode)
|
||||
+{
|
||||
+ elf_cvt_note (dest, src, len, encode, false);
|
||||
+}
|
||||
+
|
||||
+static void
|
||||
+elf_cvt_note8 (void *dest, const void *src, size_t len, int encode)
|
||||
+{
|
||||
+ elf_cvt_note (dest, src, len, encode, true);
|
||||
+}
|
||||
diff --git a/src/elflint.c b/src/elflint.c
|
||||
index 3d44595..fa3af4c 100644
|
||||
--- a/src/elflint.c
|
||||
+++ b/src/elflint.c
|
||||
@@ -4331,6 +4331,7 @@ section [%2d] '%s': unknown core file note type %" PRIu32
|
||||
case NT_GNU_HWCAP:
|
||||
case NT_GNU_BUILD_ID:
|
||||
case NT_GNU_GOLD_VERSION:
|
||||
+ case NT_GNU_PROPERTY_TYPE_0:
|
||||
break;
|
||||
|
||||
case 0:
|
||||
@@ -4376,7 +4377,8 @@ phdr[%d]: no note entries defined for the type of file\n"),
|
||||
GElf_Off notes_size = 0;
|
||||
Elf_Data *data = elf_getdata_rawchunk (ebl->elf,
|
||||
phdr->p_offset, phdr->p_filesz,
|
||||
- ELF_T_NHDR);
|
||||
+ (phdr->p_align == 8
|
||||
+ ? ELF_T_NHDR8 : ELF_T_NHDR));
|
||||
if (data != NULL && data->d_buf != NULL)
|
||||
notes_size = check_note_data (ebl, ehdr, data, 0, cnt, phdr->p_offset);
|
||||
|
||||
diff --git a/src/readelf.c b/src/readelf.c
|
||||
index 72ae04e..ccd07eb 100644
|
||||
--- a/src/readelf.c
|
||||
+++ b/src/readelf.c
|
||||
@@ -12300,7 +12300,8 @@ handle_notes (Ebl *ebl, GElf_Ehdr *ehdr)
|
||||
handle_notes_data (ebl, ehdr, phdr->p_offset,
|
||||
elf_getdata_rawchunk (ebl->elf,
|
||||
phdr->p_offset, phdr->p_filesz,
|
||||
- ELF_T_NHDR));
|
||||
+ (phdr->p_align == 8
|
||||
+ ? ELF_T_NHDR8 : ELF_T_NHDR)));
|
||||
}
|
||||
}
|
||||
|
||||
51
elfutils-0.174-libdwfl-sanity-check-core-reads.patch
Normal file
51
elfutils-0.174-libdwfl-sanity-check-core-reads.patch
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
commit 20f9de9b5f704cec55df92406a50bcbcfca96acd
|
||||
Author: Mark Wielaard <mark@klomp.org>
|
||||
Date: Sun Oct 14 16:45:48 2018 +0200
|
||||
|
||||
libdwfl: Sanity check partial core file data reads.
|
||||
|
||||
There were two issues when reading note data from a core file.
|
||||
We didn't check if the data we already had in a buffer was big
|
||||
enough. And if we did get the data, we should check if we got
|
||||
everything, or just a part of the data.
|
||||
|
||||
https://sourceware.org/bugzilla/show_bug.cgi?id=23752
|
||||
|
||||
Signed-off-by: Mark Wielaard <mark@klomp.org>
|
||||
|
||||
diff --git a/libdwfl/dwfl_segment_report_module.c b/libdwfl/dwfl_segment_report_module.c
|
||||
index 36e5c82..8749884 100644
|
||||
--- a/libdwfl/dwfl_segment_report_module.c
|
||||
+++ b/libdwfl/dwfl_segment_report_module.c
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Sniff out modules from ELF headers visible in memory segments.
|
||||
- Copyright (C) 2008-2012, 2014, 2015 Red Hat, Inc.
|
||||
+ Copyright (C) 2008-2012, 2014, 2015, 2018 Red Hat, Inc.
|
||||
This file is part of elfutils.
|
||||
|
||||
This file is free software; you can redistribute it and/or modify
|
||||
@@ -301,7 +301,10 @@ dwfl_segment_report_module (Dwfl *dwfl, int ndx, const char *name,
|
||||
inline bool read_portion (void **data, size_t *data_size,
|
||||
GElf_Addr vaddr, size_t filesz)
|
||||
{
|
||||
- if (vaddr - start + filesz > buffer_available
|
||||
+ /* Check whether we will have to read the segment data, or if it
|
||||
+ can be returned from the existing buffer. */
|
||||
+ if (filesz > buffer_available
|
||||
+ || vaddr - start > buffer_available - filesz
|
||||
/* If we're in string mode, then don't consider the buffer we have
|
||||
sufficient unless it contains the terminator of the string. */
|
||||
|| (filesz == 0 && memchr (vaddr - start + buffer, '\0',
|
||||
@@ -459,6 +462,12 @@ dwfl_segment_report_module (Dwfl *dwfl, int ndx, const char *name,
|
||||
if (read_portion (&data, &data_size, vaddr, filesz))
|
||||
return;
|
||||
|
||||
+ /* data_size will be zero if we got everything from the initial
|
||||
+ buffer, otherwise it will be the size of the new buffer that
|
||||
+ could be read. */
|
||||
+ if (data_size != 0)
|
||||
+ filesz = data_size;
|
||||
+
|
||||
assert (sizeof (Elf32_Nhdr) == sizeof (Elf64_Nhdr));
|
||||
|
||||
void *notes;
|
||||
31
elfutils-0.174-size-rec-ar.patch
Normal file
31
elfutils-0.174-size-rec-ar.patch
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
commit 22d2d082d57a7470fadc0eae67179553f4919209
|
||||
Author: Mark Wielaard <mark@klomp.org>
|
||||
Date: Thu Oct 18 23:15:48 2018 +0200
|
||||
|
||||
size: Handle recursive ELF ar files.
|
||||
|
||||
eu-size didn't handle an ELF ar file that contained an ar file itself
|
||||
correctly. handle_ar would recursively call itself but close the ELF
|
||||
file before returning. Only close the ELF file at the top-level.
|
||||
|
||||
https://sourceware.org/bugzilla/show_bug.cgi?id=23787
|
||||
|
||||
Signed-off-by: Mark Wielaard <mark@klomp.org>
|
||||
|
||||
diff --git a/src/size.c b/src/size.c
|
||||
index 5ff3f2a..f01fd88 100644
|
||||
--- a/src/size.c
|
||||
+++ b/src/size.c
|
||||
@@ -374,8 +374,10 @@ handle_ar (int fd, Elf *elf, const char *prefix, const char *fname)
|
||||
INTERNAL_ERROR (fname);
|
||||
}
|
||||
|
||||
- if (unlikely (elf_end (elf) != 0))
|
||||
- INTERNAL_ERROR (fname);
|
||||
+ /* Only close ELF handle if this was a "top level" ar file. */
|
||||
+ if (prefix == NULL)
|
||||
+ if (unlikely (elf_end (elf) != 0))
|
||||
+ INTERNAL_ERROR (fname);
|
||||
|
||||
return result;
|
||||
}
|
||||
226
elfutils-0.174-strip-unstrip-group.patch
Normal file
226
elfutils-0.174-strip-unstrip-group.patch
Normal file
|
|
@ -0,0 +1,226 @@
|
|||
commit c06ab0bbb4761a69d2f188675d21d1a9131e9ecb
|
||||
Author: Mark Wielaard <mark@klomp.org>
|
||||
Date: Sat Oct 13 10:27:47 2018 +0200
|
||||
|
||||
strip, unstrip: Handle SHT_GROUP correctly.
|
||||
|
||||
The usage of annobin in Fedora showed a couple of bugs when using
|
||||
eu-strip and eu-unstrip on ET_REL files that contain multiple group
|
||||
sections.
|
||||
|
||||
When stripping we should not remove the SHF_GROUP flag from sections
|
||||
even if the group section itself might be removed. Either the section
|
||||
itself gets removed, and so the flag doesn't matter. Or it gets moved
|
||||
together with the group section into the debug file, and then it still
|
||||
needs to have the flag set. Also we would "renumber" the section group
|
||||
flag field (which isn't a section index, and so shouldn't be changed).
|
||||
|
||||
Often the group sections have the exact same name (".group"), flags
|
||||
(none) and sometimes the same sizes. Which makes matching them hard.
|
||||
Extract the group signature and compare those when comparing two
|
||||
group sections.
|
||||
|
||||
Signed-off-by: Mark Wielaard <mark@klomp.org>
|
||||
|
||||
diff --git a/src/strip.c b/src/strip.c
|
||||
index 1f7b3ca..fdebc5e 100644
|
||||
--- a/src/strip.c
|
||||
+++ b/src/strip.c
|
||||
@@ -792,9 +792,13 @@ handle_elf (int fd, Elf *elf, const char *prefix, const char *fname,
|
||||
|
||||
if (shdr_info[shdr_info[cnt].group_idx].idx == 0)
|
||||
{
|
||||
- /* The section group section will be removed. */
|
||||
+ /* The section group section might be removed.
|
||||
+ Don't remove the SHF_GROUP flag. The section is
|
||||
+ either also removed, in which case the flag doesn't matter.
|
||||
+ Or it moves with the group into the debug file, then
|
||||
+ it will be reconnected with the new group and should
|
||||
+ still have the flag set. */
|
||||
shdr_info[cnt].group_idx = 0;
|
||||
- shdr_info[cnt].shdr.sh_flags &= ~SHF_GROUP;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1368,7 +1372,9 @@ handle_elf (int fd, Elf *elf, const char *prefix, const char *fname,
|
||||
&& shdr_info[cnt].data->d_buf != NULL);
|
||||
|
||||
Elf32_Word *grpref = (Elf32_Word *) shdr_info[cnt].data->d_buf;
|
||||
- for (size_t inner = 0;
|
||||
+ /* First word is the section group flag.
|
||||
+ Followed by section indexes, that need to be renumbered. */
|
||||
+ for (size_t inner = 1;
|
||||
inner < shdr_info[cnt].data->d_size / sizeof (Elf32_Word);
|
||||
++inner)
|
||||
if (grpref[inner] < shnum)
|
||||
diff --git a/src/unstrip.c b/src/unstrip.c
|
||||
index e6f0947..03a0346 100644
|
||||
--- a/src/unstrip.c
|
||||
+++ b/src/unstrip.c
|
||||
@@ -696,6 +696,7 @@ struct section
|
||||
{
|
||||
Elf_Scn *scn;
|
||||
const char *name;
|
||||
+ const char *sig;
|
||||
Elf_Scn *outscn;
|
||||
Dwelf_Strent *strent;
|
||||
GElf_Shdr shdr;
|
||||
@@ -720,7 +721,8 @@ compare_alloc_sections (const struct section *s1, const struct section *s2,
|
||||
|
||||
static int
|
||||
compare_unalloc_sections (const GElf_Shdr *shdr1, const GElf_Shdr *shdr2,
|
||||
- const char *name1, const char *name2)
|
||||
+ const char *name1, const char *name2,
|
||||
+ const char *sig1, const char *sig2)
|
||||
{
|
||||
/* Sort by sh_flags as an arbitrary ordering. */
|
||||
if (shdr1->sh_flags < shdr2->sh_flags)
|
||||
@@ -734,6 +736,10 @@ compare_unalloc_sections (const GElf_Shdr *shdr1, const GElf_Shdr *shdr2,
|
||||
if (shdr1->sh_size > shdr2->sh_size)
|
||||
return 1;
|
||||
|
||||
+ /* Are they both SHT_GROUP sections? Then compare signatures. */
|
||||
+ if (sig1 != NULL && sig2 != NULL)
|
||||
+ return strcmp (sig1, sig2);
|
||||
+
|
||||
/* Sort by name as last resort. */
|
||||
return strcmp (name1, name2);
|
||||
}
|
||||
@@ -751,7 +757,8 @@ compare_sections (const void *a, const void *b, bool rel)
|
||||
return ((s1->shdr.sh_flags & SHF_ALLOC)
|
||||
? compare_alloc_sections (s1, s2, rel)
|
||||
: compare_unalloc_sections (&s1->shdr, &s2->shdr,
|
||||
- s1->name, s2->name));
|
||||
+ s1->name, s2->name,
|
||||
+ s1->sig, s2->sig));
|
||||
}
|
||||
|
||||
static int
|
||||
@@ -986,6 +993,44 @@ get_section_name (size_t ndx, const GElf_Shdr *shdr, const Elf_Data *shstrtab)
|
||||
return shstrtab->d_buf + shdr->sh_name;
|
||||
}
|
||||
|
||||
+/* Returns the signature of a group section, or NULL if the given
|
||||
+ section isn't a group. */
|
||||
+static const char *
|
||||
+get_group_sig (Elf *elf, GElf_Shdr *shdr)
|
||||
+{
|
||||
+ if (shdr->sh_type != SHT_GROUP)
|
||||
+ return NULL;
|
||||
+
|
||||
+ Elf_Scn *symscn = elf_getscn (elf, shdr->sh_link);
|
||||
+ if (symscn == NULL)
|
||||
+ error (EXIT_FAILURE, 0, _("bad sh_link for group section: %s"),
|
||||
+ elf_errmsg (-1));
|
||||
+
|
||||
+ GElf_Shdr symshdr_mem;
|
||||
+ GElf_Shdr *symshdr = gelf_getshdr (symscn, &symshdr_mem);
|
||||
+ if (symshdr == NULL)
|
||||
+ error (EXIT_FAILURE, 0, _("couldn't get shdr for group section: %s"),
|
||||
+ elf_errmsg (-1));
|
||||
+
|
||||
+ Elf_Data *symdata = elf_getdata (symscn, NULL);
|
||||
+ if (symdata == NULL)
|
||||
+ error (EXIT_FAILURE, 0, _("bad data for group symbol section: %s"),
|
||||
+ elf_errmsg (-1));
|
||||
+
|
||||
+ GElf_Sym sym_mem;
|
||||
+ GElf_Sym *sym = gelf_getsym (symdata, shdr->sh_info, &sym_mem);
|
||||
+ if (sym == NULL)
|
||||
+ error (EXIT_FAILURE, 0, _("couldn't get symbol for group section: %s"),
|
||||
+ elf_errmsg (-1));
|
||||
+
|
||||
+ const char *sig = elf_strptr (elf, symshdr->sh_link, sym->st_name);
|
||||
+ if (sig == NULL)
|
||||
+ error (EXIT_FAILURE, 0, _("bad symbol name for group section: %s"),
|
||||
+ elf_errmsg (-1));
|
||||
+
|
||||
+ return sig;
|
||||
+}
|
||||
+
|
||||
/* Fix things up when prelink has moved some allocated sections around
|
||||
and the debuginfo file's section headers no longer match up.
|
||||
This fills in SECTIONS[0..NALLOC-1].outscn or exits.
|
||||
@@ -1111,6 +1156,7 @@ find_alloc_sections_prelink (Elf *debug, Elf_Data *debug_shstrtab,
|
||||
sec->scn = elf_getscn (main, i + 1); /* Really just for ndx. */
|
||||
sec->outscn = NULL;
|
||||
sec->strent = NULL;
|
||||
+ sec->sig = get_group_sig (main, &sec->shdr);
|
||||
++undo_nalloc;
|
||||
}
|
||||
}
|
||||
@@ -1336,6 +1382,7 @@ more sections in stripped file than debug file -- arguments reversed?"));
|
||||
sections[i].scn = scn;
|
||||
sections[i].outscn = NULL;
|
||||
sections[i].strent = NULL;
|
||||
+ sections[i].sig = get_group_sig (stripped, shdr);
|
||||
}
|
||||
|
||||
const struct section *stripped_symtab = NULL;
|
||||
@@ -1354,7 +1401,8 @@ more sections in stripped file than debug file -- arguments reversed?"));
|
||||
|
||||
/* Locate a matching unallocated section in SECTIONS. */
|
||||
inline struct section *find_unalloc_section (const GElf_Shdr *shdr,
|
||||
- const char *name)
|
||||
+ const char *name,
|
||||
+ const char *sig)
|
||||
{
|
||||
size_t l = nalloc, u = stripped_shnum - 1;
|
||||
while (l < u)
|
||||
@@ -1362,7 +1410,8 @@ more sections in stripped file than debug file -- arguments reversed?"));
|
||||
size_t i = (l + u) / 2;
|
||||
struct section *sec = §ions[i];
|
||||
int cmp = compare_unalloc_sections (shdr, &sec->shdr,
|
||||
- name, sec->name);
|
||||
+ name, sec->name,
|
||||
+ sig, sec->sig);
|
||||
if (cmp < 0)
|
||||
u = i;
|
||||
else if (cmp > 0)
|
||||
@@ -1435,7 +1484,8 @@ more sections in stripped file than debug file -- arguments reversed?"));
|
||||
else
|
||||
{
|
||||
/* Look for the section that matches. */
|
||||
- sec = find_unalloc_section (shdr, name);
|
||||
+ sec = find_unalloc_section (shdr, name,
|
||||
+ get_group_sig (unstripped, shdr));
|
||||
if (sec == NULL)
|
||||
{
|
||||
/* An additional unallocated section is fine if not SHT_NOBITS.
|
||||
|
||||
commit eee4269e53154daaf0251371aacd91ec5db3eb30
|
||||
Author: Mark Wielaard <mark@klomp.org>
|
||||
Date: Sat Oct 13 10:27:47 2018 +0200
|
||||
|
||||
unstrip: Renumber the group section indexes.
|
||||
|
||||
When unstripping we might need to renumber the group section indexes.
|
||||
Just like we do when stripping.
|
||||
|
||||
Signed-off-by: Mark Wielaard <mark@klomp.org>
|
||||
|
||||
diff --git a/src/unstrip.c b/src/unstrip.c
|
||||
index 03a0346..2cfd3b3 100644
|
||||
--- a/src/unstrip.c
|
||||
+++ b/src/unstrip.c
|
||||
@@ -1708,6 +1708,20 @@ more sections in stripped file than debug file -- arguments reversed?"));
|
||||
if (shdr_mem.sh_type == SHT_DYNSYM)
|
||||
stripped_dynsym = sec;
|
||||
}
|
||||
+
|
||||
+ if (shdr_mem.sh_type == SHT_GROUP)
|
||||
+ {
|
||||
+ /* We must adjust all the section indices in the group.
|
||||
+ Skip the first word, which is the section group flag.
|
||||
+ Everything else is a section index. */
|
||||
+ Elf32_Word *shndx = (Elf32_Word *) outdata->d_buf;
|
||||
+ for (size_t i = 1; i < shdr_mem.sh_size / sizeof (Elf32_Word); ++i)
|
||||
+ if (shndx[i] == SHN_UNDEF || shndx[i] >= stripped_shnum)
|
||||
+ error (EXIT_FAILURE, 0,
|
||||
+ _("group has invalid section index [%zd]"), i);
|
||||
+ else
|
||||
+ shndx[i] = ndx_section[shndx[i] - 1];
|
||||
+ }
|
||||
}
|
||||
|
||||
/* We may need to update the symbol table. */
|
||||
156
elfutils-0.174-version-note.patch
Normal file
156
elfutils-0.174-version-note.patch
Normal file
|
|
@ -0,0 +1,156 @@
|
|||
commit 7a3f6fe60b8519b5372f5a5521ccbac59411f33f
|
||||
Author: Mark Wielaard <mark@klomp.org>
|
||||
Date: Sun Nov 11 23:50:41 2018 +0100
|
||||
|
||||
Recognize NT_VERSION notes.
|
||||
|
||||
NT_VERSION notes are emitted by the gas .version directive.
|
||||
They have an empty description and (ab)use the owner name to store the
|
||||
version data string.
|
||||
|
||||
Signed-off-by: Mark Wielaard <mark@klomp.org>
|
||||
|
||||
diff --git a/libebl/eblobjnote.c b/libebl/eblobjnote.c
|
||||
index 57e9f52..8fda7d9 100644
|
||||
--- a/libebl/eblobjnote.c
|
||||
+++ b/libebl/eblobjnote.c
|
||||
@@ -135,6 +135,14 @@ ebl_object_note (Ebl *ebl, const char *name, uint32_t type,
|
||||
return;
|
||||
}
|
||||
|
||||
+ /* NT_VERSION doesn't have any info. All data is in the name. */
|
||||
+ if (descsz == 0 && type == NT_VERSION)
|
||||
+ return;
|
||||
+
|
||||
+ /* Everything else should have the "GNU" owner name. */
|
||||
+ if (strcmp ("GNU", name) != 0)
|
||||
+ return;
|
||||
+
|
||||
switch (type)
|
||||
{
|
||||
case NT_GNU_BUILD_ID:
|
||||
@@ -337,7 +345,7 @@ ebl_object_note (Ebl *ebl, const char *name, uint32_t type,
|
||||
break;
|
||||
|
||||
case NT_GNU_ABI_TAG:
|
||||
- if (strcmp (name, "GNU") == 0 && descsz >= 8 && descsz % 4 == 0)
|
||||
+ if (descsz >= 8 && descsz % 4 == 0)
|
||||
{
|
||||
Elf_Data in =
|
||||
{
|
||||
diff --git a/libebl/eblobjnotetypename.c b/libebl/eblobjnotetypename.c
|
||||
index af23cae..8cdd781 100644
|
||||
--- a/libebl/eblobjnotetypename.c
|
||||
+++ b/libebl/eblobjnotetypename.c
|
||||
@@ -39,6 +39,7 @@
|
||||
|
||||
const char *
|
||||
ebl_object_note_type_name (Ebl *ebl, const char *name, uint32_t type,
|
||||
+ GElf_Word descsz,
|
||||
char *buf, size_t len)
|
||||
{
|
||||
const char *res = ebl->object_note_type_name (name, type, buf, len);
|
||||
@@ -80,14 +81,19 @@ ebl_object_note_type_name (Ebl *ebl, const char *name, uint32_t type,
|
||||
|
||||
if (strcmp (name, "GNU") != 0)
|
||||
{
|
||||
+ /* NT_VERSION is special, all data is in the name. */
|
||||
+ if (descsz == 0 && type == NT_VERSION)
|
||||
+ return "VERSION";
|
||||
+
|
||||
snprintf (buf, len, "%s: %" PRIu32, gettext ("<unknown>"), type);
|
||||
return buf;
|
||||
}
|
||||
|
||||
+ /* And finally all the "GNU" note types. */
|
||||
static const char *knowntypes[] =
|
||||
{
|
||||
#define KNOWNSTYPE(name) [NT_##name] = #name
|
||||
- KNOWNSTYPE (VERSION),
|
||||
+ KNOWNSTYPE (GNU_ABI_TAG),
|
||||
KNOWNSTYPE (GNU_HWCAP),
|
||||
KNOWNSTYPE (GNU_BUILD_ID),
|
||||
KNOWNSTYPE (GNU_GOLD_VERSION),
|
||||
diff --git a/libebl/libebl.h b/libebl/libebl.h
|
||||
index a34fe48..5830654 100644
|
||||
--- a/libebl/libebl.h
|
||||
+++ b/libebl/libebl.h
|
||||
@@ -175,8 +175,8 @@ extern const char *ebl_core_note_type_name (Ebl *ebl, uint32_t type, char *buf,
|
||||
|
||||
/* Return name of the note section type for an object file. */
|
||||
extern const char *ebl_object_note_type_name (Ebl *ebl, const char *name,
|
||||
- uint32_t type, char *buf,
|
||||
- size_t len);
|
||||
+ uint32_t type, GElf_Word descsz,
|
||||
+ char *buf, size_t len);
|
||||
|
||||
/* Print information about object note if available. */
|
||||
extern void ebl_object_note (Ebl *ebl, const char *name, uint32_t type,
|
||||
diff --git a/src/elflint.c b/src/elflint.c
|
||||
index fa3af4c..dff74ee 100644
|
||||
--- a/src/elflint.c
|
||||
+++ b/src/elflint.c
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Pedantic checking of ELF files compliance with gABI/psABI spec.
|
||||
- Copyright (C) 2001-2015, 2017 Red Hat, Inc.
|
||||
+ Copyright (C) 2001-2015, 2017, 2018 Red Hat, Inc.
|
||||
This file is part of elfutils.
|
||||
Written by Ulrich Drepper <drepper@redhat.com>, 2001.
|
||||
|
||||
@@ -4332,7 +4332,17 @@ section [%2d] '%s': unknown core file note type %" PRIu32
|
||||
case NT_GNU_BUILD_ID:
|
||||
case NT_GNU_GOLD_VERSION:
|
||||
case NT_GNU_PROPERTY_TYPE_0:
|
||||
- break;
|
||||
+ if (nhdr.n_namesz == sizeof ELF_NOTE_GNU
|
||||
+ && strcmp (data->d_buf + name_offset, ELF_NOTE_GNU) == 0)
|
||||
+ break;
|
||||
+ else
|
||||
+ {
|
||||
+ /* NT_VERSION is 1, same as NT_GNU_ABI_TAG. It has no
|
||||
+ descriptor and (ab)uses the name as version string. */
|
||||
+ if (nhdr.n_descsz == 0 && nhdr.n_type == NT_VERSION)
|
||||
+ break;
|
||||
+ }
|
||||
+ goto unknown_note;
|
||||
|
||||
case 0:
|
||||
/* Linux vDSOs use a type 0 note for the kernel version word. */
|
||||
@@ -4341,16 +4351,21 @@ section [%2d] '%s': unknown core file note type %" PRIu32
|
||||
break;
|
||||
FALLTHROUGH;
|
||||
default:
|
||||
+ {
|
||||
+ unknown_note:
|
||||
if (shndx == 0)
|
||||
ERROR (gettext ("\
|
||||
-phdr[%d]: unknown object file note type %" PRIu32 " at offset %zu\n"),
|
||||
- phndx, (uint32_t) nhdr.n_type, offset);
|
||||
+phdr[%d]: unknown object file note type %" PRIu32 " with owner name '%s' at offset %zu\n"),
|
||||
+ phndx, (uint32_t) nhdr.n_type,
|
||||
+ (char *) data->d_buf + name_offset, offset);
|
||||
else
|
||||
ERROR (gettext ("\
|
||||
section [%2d] '%s': unknown object file note type %" PRIu32
|
||||
- " at offset %zu\n"),
|
||||
+ " with owner name '%s' at offset %zu\n"),
|
||||
shndx, section_name (ebl, shndx),
|
||||
- (uint32_t) nhdr.n_type, offset);
|
||||
+ (uint32_t) nhdr.n_type,
|
||||
+ (char *) data->d_buf + name_offset, offset);
|
||||
+ }
|
||||
}
|
||||
}
|
||||
|
||||
diff --git a/src/readelf.c b/src/readelf.c
|
||||
index c6c3fb3..659e34f 100644
|
||||
--- a/src/readelf.c
|
||||
+++ b/src/readelf.c
|
||||
@@ -12201,6 +12201,7 @@ handle_notes_data (Ebl *ebl, const GElf_Ehdr *ehdr,
|
||||
? ebl_core_note_type_name (ebl, nhdr.n_type,
|
||||
buf, sizeof (buf))
|
||||
: ebl_object_note_type_name (ebl, name, nhdr.n_type,
|
||||
+ nhdr.n_descsz,
|
||||
buf2, sizeof (buf2)));
|
||||
|
||||
/* Filter out invalid entries. */
|
||||
127
elfutils-0.174-x86_64_unwind.patch
Normal file
127
elfutils-0.174-x86_64_unwind.patch
Normal file
|
|
@ -0,0 +1,127 @@
|
|||
commit 825e48c4e942e3cbdab1b75c04b8c014867d66ab
|
||||
Author: Milian Wolff <milian.wolff@kdab.com>
|
||||
Date: Mon Oct 29 16:21:26 2018 +0100
|
||||
|
||||
Also find CFI in sections of type SHT_X86_64_UNWIND
|
||||
|
||||
On my system with g++ (GCC) 8.2.1 20180831 with GNU gold (GNU Binutils
|
||||
2.31.1) 1.16, the .eh_frame section does not have type PROGBITS
|
||||
but rather is using X86_64_UNWIND nowadays:
|
||||
|
||||
```
|
||||
$ echo "int main(){ return 0; }" > test.c
|
||||
$ gcc test.c
|
||||
$ readelf --sections a.out | grep .eh_frame
|
||||
[14] .eh_frame X86_64_UNWIND 0000000000000670 00000670
|
||||
[15] .eh_frame_hdr X86_64_UNWIND 0000000000000724 00000724
|
||||
```
|
||||
|
||||
Without this patch, libdw refuses to use the available unwind
|
||||
information, leading to broken backtraces while unwinding. With the
|
||||
patch applied, unwinding works once more in such situations.
|
||||
|
||||
Signed-off-by: Milian Wolff <milian.wolff@kdab.com>
|
||||
Signed-off-by: Mark Wielaard <mark@klomp.org>
|
||||
Tested-by: Milian Wolff <milian.wolff@kdab.com>
|
||||
|
||||
diff --git a/libdw/dwarf_getcfi_elf.c b/libdw/dwarf_getcfi_elf.c
|
||||
index 315cc02..adcaea0 100644
|
||||
--- a/libdw/dwarf_getcfi_elf.c
|
||||
+++ b/libdw/dwarf_getcfi_elf.c
|
||||
@@ -298,7 +298,7 @@ getcfi_shdr (Elf *elf, const GElf_Ehdr *ehdr)
|
||||
}
|
||||
else if (!strcmp (name, ".eh_frame"))
|
||||
{
|
||||
- if (shdr->sh_type == SHT_PROGBITS)
|
||||
+ if (shdr->sh_type != SHT_NOBITS)
|
||||
return getcfi_scn_eh_frame (elf, ehdr, scn, shdr,
|
||||
hdr_scn, hdr_vaddr);
|
||||
else
|
||||
|
||||
commit 4b0342b85b5b1a3d3636e06e3b5320954828dfb1
|
||||
Author: Mark Wielaard <mark@klomp.org>
|
||||
Date: Tue Nov 6 12:01:25 2018 +0100
|
||||
|
||||
backends: Add x86_64 section_type_name for SHT_X86_64_UNWIND.
|
||||
|
||||
Makes sure that eu-readelf and eu-elflint recognize and show the
|
||||
x86_64 specific section type correctly.
|
||||
|
||||
Signed-off-by: Mark Wielaard <mark@klomp.org>
|
||||
Tested-by: Milian Wolff <milian.wolff@kdab.com>
|
||||
|
||||
diff --git a/backends/x86_64_init.c b/backends/x86_64_init.c
|
||||
index adfa479..49f6c6c 100644
|
||||
--- a/backends/x86_64_init.c
|
||||
+++ b/backends/x86_64_init.c
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Initialization of x86-64 specific backend library.
|
||||
- Copyright (C) 2002-2009, 2013 Red Hat, Inc.
|
||||
+ Copyright (C) 2002-2009, 2013, 2018 Red Hat, Inc.
|
||||
Copyright (C) H.J. Lu <hjl.tools@gmail.com>, 2015.
|
||||
This file is part of elfutils.
|
||||
Written by Ulrich Drepper <drepper@redhat.com>, 2002.
|
||||
@@ -55,6 +55,7 @@ x86_64_init (Elf *elf __attribute__ ((unused)),
|
||||
eh->name = "AMD x86-64";
|
||||
x86_64_init_reloc (eh);
|
||||
HOOK (eh, reloc_simple_type);
|
||||
+ HOOK (eh, section_type_name);
|
||||
if (eh->class == ELFCLASS32)
|
||||
eh->core_note = x32_core_note;
|
||||
else
|
||||
diff --git a/backends/x86_64_symbol.c b/backends/x86_64_symbol.c
|
||||
index e07b180..98457bc 100644
|
||||
--- a/backends/x86_64_symbol.c
|
||||
+++ b/backends/x86_64_symbol.c
|
||||
@@ -1,5 +1,5 @@
|
||||
/* x86_64 specific symbolic name handling.
|
||||
- Copyright (C) 2002, 2005 Red Hat, Inc.
|
||||
+ Copyright (C) 2002, 2005, 2018 Red Hat, Inc.
|
||||
This file is part of elfutils.
|
||||
Written by Ulrich Drepper <drepper@redhat.com>, 2002.
|
||||
|
||||
@@ -59,3 +59,15 @@ x86_64_reloc_simple_type (Ebl *ebl __attribute__ ((unused)), int type,
|
||||
return ELF_T_NUM;
|
||||
}
|
||||
}
|
||||
+
|
||||
+/* Return symbolic representation of section type. */
|
||||
+const char *
|
||||
+x86_64_section_type_name (int type,
|
||||
+ char *buf __attribute__ ((unused)),
|
||||
+ size_t len __attribute__ ((unused)))
|
||||
+{
|
||||
+ if (type == SHT_X86_64_UNWIND)
|
||||
+ return "X86_64_UNWIND";
|
||||
+
|
||||
+ return NULL;
|
||||
+}
|
||||
|
||||
commit 22ec8efc1dd87cdc7892523457eb55990b967224
|
||||
Author: Mark Wielaard <mark@klomp.org>
|
||||
Date: Sat Nov 10 23:33:03 2018 +0100
|
||||
|
||||
elflint: Allow PT_GNU_EH_FRAME segment to match SHT_X86_64_UNWIND section.
|
||||
|
||||
The gold linker might generate an .eh_frame_hdr with a SHT_X86_64_UNWIND
|
||||
type instead of a SHT_PROGBITS type.
|
||||
|
||||
Signed-off-by: Mark Wielaard <mark@klomp.org>
|
||||
|
||||
diff --git a/src/elflint.c b/src/elflint.c
|
||||
index 184ca12..810c8bd 100644
|
||||
--- a/src/elflint.c
|
||||
+++ b/src/elflint.c
|
||||
@@ -4633,8 +4633,10 @@ program header offset in ELF header and PHDR entry do not match"));
|
||||
any = true;
|
||||
shdr = gelf_getshdr (scn, &shdr_mem);
|
||||
if (shdr != NULL
|
||||
- && shdr->sh_type == (is_debuginfo
|
||||
- ? SHT_NOBITS : SHT_PROGBITS)
|
||||
+ && ((is_debuginfo && shdr->sh_type == SHT_NOBITS)
|
||||
+ || (! is_debuginfo
|
||||
+ && (shdr->sh_type == SHT_PROGBITS
|
||||
+ || shdr->sh_type == SHT_X86_64_UNWIND)))
|
||||
&& elf_strptr (ebl->elf, shstrndx, shdr->sh_name) != NULL
|
||||
&& ! strcmp (".eh_frame_hdr",
|
||||
elf_strptr (ebl->elf, shstrndx, shdr->sh_name)))
|
||||
|
|
@ -1,35 +0,0 @@
|
|||
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,135 +0,0 @@
|
|||
From f66135f16fe44182a3fc5b651d7e5071c936217d Mon Sep 17 00:00:00 2001
|
||||
From: Aaron Merey <amerey@redhat.com>
|
||||
Date: Mon, 27 Oct 2025 22:00:12 -0400
|
||||
Subject: [PATCH] readelf: Allocate job_data one-by-one as needed
|
||||
|
||||
Currently, job_data is stored in an array whose size is equal to the
|
||||
number of debug sections (.debug_*, .eh_frame, .gdb_index, etc.).
|
||||
|
||||
This size may be too small if a binary contains multiple debug sections
|
||||
with the same name. For example an ET_REL binary compiled with -ggdb3
|
||||
can contain multiple .debug_macro sections.
|
||||
|
||||
Fix this by allocating job_data on the fly when preparing to read a
|
||||
debug section. This supports an arbitrary number of debug sections
|
||||
while also avoiding unnecessary memory allocation.
|
||||
|
||||
https://sourceware.org/bugzilla/show_bug.cgi?id=33580
|
||||
|
||||
Signed-off-by: Aaron Merey <amerey@redhat.com>
|
||||
---
|
||||
src/readelf.c | 49 +++++++++++++++++++++++++------------------------
|
||||
1 file changed, 25 insertions(+), 24 deletions(-)
|
||||
|
||||
diff --git a/src/readelf.c b/src/readelf.c
|
||||
index ee6c203d..a2d17358 100644
|
||||
--- a/src/readelf.c
|
||||
+++ b/src/readelf.c
|
||||
@@ -12200,7 +12200,8 @@ getone_dwflmod (Dwfl_Module *dwflmod,
|
||||
return DWARF_CB_OK;
|
||||
}
|
||||
|
||||
-typedef struct {
|
||||
+typedef struct Job_Data {
|
||||
+ struct Job_Data *next;
|
||||
Dwfl_Module *dwflmod;
|
||||
Ebl *ebl;
|
||||
GElf_Ehdr *ehdr;
|
||||
@@ -12230,7 +12231,7 @@ do_job (void *data, FILE *out)
|
||||
If thread safety is not supported or the maximum number of threads is set
|
||||
to 1, then immediately call START_ROUTINE with the given arguments. */
|
||||
static void
|
||||
-schedule_job (job_data jdata[], size_t idx,
|
||||
+schedule_job (job_data **jdatalist,
|
||||
void (*start_routine) (Dwfl_Module *, Ebl *, GElf_Ehdr *,
|
||||
Elf_Scn *, GElf_Shdr *, Dwarf *, FILE *),
|
||||
Dwfl_Module *dwflmod, Ebl *ebl, GElf_Ehdr *ehdr, Elf_Scn *scn,
|
||||
@@ -12239,21 +12240,24 @@ schedule_job (job_data jdata[], size_t idx,
|
||||
#ifdef USE_LOCKS
|
||||
if (max_threads > 1)
|
||||
{
|
||||
- /* Add to the job queue. */
|
||||
- jdata[idx].dwflmod = dwflmod;
|
||||
- jdata[idx].ebl = ebl;
|
||||
- jdata[idx].ehdr = ehdr;
|
||||
- jdata[idx].scn = *scn;
|
||||
- jdata[idx].shdr = *shdr;
|
||||
- jdata[idx].dbg = dbg;
|
||||
- jdata[idx].fp = start_routine;
|
||||
+ job_data *jdata = xmalloc (sizeof (job_data));
|
||||
+
|
||||
+ jdata->dwflmod = dwflmod;
|
||||
+ jdata->ebl = ebl;
|
||||
+ jdata->ehdr = ehdr;
|
||||
+ jdata->scn = *scn;
|
||||
+ jdata->shdr = *shdr;
|
||||
+ jdata->dbg = dbg;
|
||||
+ jdata->fp = start_routine;
|
||||
+ jdata->next = *jdatalist;
|
||||
+ *jdatalist = jdata;
|
||||
|
||||
- add_job (do_job, (void *) &jdata[idx]);
|
||||
+ add_job (do_job, (void *) jdata);
|
||||
}
|
||||
else
|
||||
start_routine (dwflmod, ebl, ehdr, scn, shdr, dbg, stdout);
|
||||
#else
|
||||
- (void) jdata; (void) idx;
|
||||
+ (void) jdatalist;
|
||||
|
||||
start_routine (dwflmod, ebl, ehdr, scn, shdr, dbg, stdout);
|
||||
#endif
|
||||
@@ -12431,8 +12435,7 @@ print_debug (Dwfl_Module *dwflmod, Ebl *ebl, GElf_Ehdr *ehdr)
|
||||
if (unlikely (elf_getshdrstrndx (ebl->elf, &shstrndx) < 0))
|
||||
error_exit (0, _("cannot get section header string table index"));
|
||||
|
||||
- ssize_t num_jobs = 0;
|
||||
- job_data *jdata = NULL;
|
||||
+ job_data *jdatalist = NULL;
|
||||
|
||||
/* If the .debug_info section is listed as implicitly required then
|
||||
we must make sure to handle it before handling any other debug
|
||||
@@ -12531,13 +12534,6 @@ print_debug (Dwfl_Module *dwflmod, Ebl *ebl, GElf_Ehdr *ehdr)
|
||||
if (name == NULL)
|
||||
continue;
|
||||
|
||||
- if (jdata == NULL)
|
||||
- {
|
||||
- jdata = calloc (ndebug_sections, sizeof (*jdata));
|
||||
- if (jdata == NULL)
|
||||
- error_exit (0, _("failed to allocate job data"));
|
||||
- }
|
||||
-
|
||||
int n;
|
||||
for (n = 0; n < ndebug_sections; ++n)
|
||||
{
|
||||
@@ -12561,10 +12557,9 @@ print_debug (Dwfl_Module *dwflmod, Ebl *ebl, GElf_Ehdr *ehdr)
|
||||
{
|
||||
if (((print_debug_sections | implicit_debug_sections)
|
||||
& debug_sections[n].bitmask))
|
||||
- schedule_job (jdata, num_jobs++, debug_sections[n].fp,
|
||||
+ schedule_job (&jdatalist, debug_sections[n].fp,
|
||||
dwflmod, ebl, ehdr, scn, shdr, dbg);
|
||||
|
||||
- assert (num_jobs <= ndebug_sections);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -12579,7 +12574,13 @@ print_debug (Dwfl_Module *dwflmod, Ebl *ebl, GElf_Ehdr *ehdr)
|
||||
|
||||
dwfl_end (skel_dwfl);
|
||||
free (skel_name);
|
||||
- free (jdata);
|
||||
+
|
||||
+ while (jdatalist != NULL)
|
||||
+ {
|
||||
+ job_data *jdata = jdatalist;
|
||||
+ jdatalist = jdatalist->next;
|
||||
+ free (jdata);
|
||||
+ }
|
||||
|
||||
/* Turn implicit and/or explicit back on in case we go over another file. */
|
||||
if (implicit_info)
|
||||
--
|
||||
2.51.0
|
||||
|
||||
|
|
@ -1,301 +0,0 @@
|
|||
From 4a5cf8be906d5991e7527e69e3f2ceaa74811301 Mon Sep 17 00:00:00 2001
|
||||
From: Andreas Schwab <schwab@suse.de>
|
||||
Date: Mon, 24 Nov 2025 13:46:16 +0100
|
||||
Subject: [PATCH] Fix const-correctness issues
|
||||
|
||||
These were uncovered by the C23 const-preserving library macros.
|
||||
---
|
||||
debuginfod/debuginfod-client.c | 2 +-
|
||||
libcpu/riscv_disasm.c | 52 +++++++++++++++++-----------------
|
||||
libdw/dwarf_getsrclines.c | 6 ++--
|
||||
src/readelf.c | 8 +++---
|
||||
4 files changed, 34 insertions(+), 34 deletions(-)
|
||||
|
||||
diff --git a/debuginfod/debuginfod-client.c b/debuginfod/debuginfod-client.c
|
||||
index c0ff5967..c5bc8a4f 100644
|
||||
--- a/debuginfod/debuginfod-client.c
|
||||
+++ b/debuginfod/debuginfod-client.c
|
||||
@@ -3104,7 +3104,7 @@ int debuginfod_add_http_header (debuginfod_client *client, const char* header)
|
||||
/* Sanity check header value is of the form Header: Value.
|
||||
It should contain at least one colon that isn't the first or
|
||||
last character. */
|
||||
- char *colon = strchr (header, ':'); /* first colon */
|
||||
+ const char *colon = strchr (header, ':'); /* first colon */
|
||||
if (colon == NULL /* present */
|
||||
|| colon == header /* not at beginning - i.e., have a header name */
|
||||
|| *(colon + 1) == '\0') /* not at end - i.e., have a value */
|
||||
diff --git a/libcpu/riscv_disasm.c b/libcpu/riscv_disasm.c
|
||||
index 0dee842a..749d4567 100644
|
||||
--- a/libcpu/riscv_disasm.c
|
||||
+++ b/libcpu/riscv_disasm.c
|
||||
@@ -77,7 +77,7 @@ static const char *regnames[32] =
|
||||
"a6", "a7", "s2", "s3", "s4", "s5", "s6", "s7",
|
||||
"s8", "s9", "s10", "s11", "t3", "t4", "t5", "t6"
|
||||
};
|
||||
-#define REG(nr) ((char *) regnames[nr])
|
||||
+#define REG(nr) regnames[nr]
|
||||
#define REGP(nr) REG (8 + (nr))
|
||||
|
||||
|
||||
@@ -88,7 +88,7 @@ static const char *fregnames[32] =
|
||||
"fa6", "fa7", "fs2", "fs3", "fs4", "fs5", "fs6", "fs7",
|
||||
"fs8", "fs9", "fs10", "fs11", "ft8", "ft9", "ft10", "ft11"
|
||||
};
|
||||
-#define FREG(nr) ((char *) fregnames[nr])
|
||||
+#define FREG(nr) fregnames[nr]
|
||||
#define FREGP(nr) FREG (8 + (nr))
|
||||
|
||||
|
||||
@@ -163,12 +163,12 @@ riscv_disasm (Ebl *ebl,
|
||||
break;
|
||||
}
|
||||
|
||||
- char *mne = NULL;
|
||||
+ const char *mne = NULL;
|
||||
/* Max length is 24, which is "illegal", so we print it as
|
||||
"0x<48 hex chars>"
|
||||
See: No instruction encodings defined for these sizes yet, below */
|
||||
char mnebuf[50];
|
||||
- char *op[5] = { NULL, NULL, NULL, NULL, NULL };
|
||||
+ const char *op[5] = { NULL, NULL, NULL, NULL, NULL };
|
||||
char immbuf[32];
|
||||
size_t len;
|
||||
char *strp = NULL;
|
||||
@@ -400,7 +400,7 @@ riscv_disasm (Ebl *ebl,
|
||||
{
|
||||
"sub", "xor", "or", "and", "subw", "addw", NULL, NULL
|
||||
};
|
||||
- mne = (char *) arithmne[((first >> 10) & 0x4) | ((first >> 5) & 0x3)];
|
||||
+ mne = arithmne[((first >> 10) & 0x4) | ((first >> 5) & 0x3)];
|
||||
}
|
||||
op[0] = op[1] = REGP ((first >> 7) & 0x7);
|
||||
break;
|
||||
@@ -572,7 +572,7 @@ riscv_disasm (Ebl *ebl,
|
||||
{
|
||||
NULL, NULL, "flw", "fld", "flq", NULL, NULL, NULL
|
||||
};
|
||||
- mne = (char *) (idx == 0x00 ? loadmne[func] : floadmne[func]);
|
||||
+ mne = idx == 0x00 ? loadmne[func] : floadmne[func];
|
||||
break;
|
||||
case 0x03:
|
||||
// MISC-MEM
|
||||
@@ -595,8 +595,8 @@ riscv_disasm (Ebl *ebl,
|
||||
uint32_t succ = (word >> 24) & 0xf;
|
||||
if (pred != 0xf || succ != 0xf)
|
||||
{
|
||||
- op[0] = (char *) order[succ];
|
||||
- op[1] = (char *) order[pred];
|
||||
+ op[0] = order[succ];
|
||||
+ op[1] = order[pred];
|
||||
}
|
||||
mne = "fence";
|
||||
}
|
||||
@@ -614,7 +614,7 @@ riscv_disasm (Ebl *ebl,
|
||||
"addi", NULL, "slti", "sltiu", "xori", NULL, "ori", "andi"
|
||||
};
|
||||
func = (word >> 12) & 0x7;
|
||||
- mne = (char *) opimmmne[func];
|
||||
+ mne = opimmmne[func];
|
||||
if (mne == NULL)
|
||||
{
|
||||
const uint64_t shiftmask = ebl->class == ELFCLASS32 ? 0x1f : 0x3f;
|
||||
@@ -697,7 +697,7 @@ riscv_disasm (Ebl *ebl,
|
||||
{
|
||||
NULL, NULL, "fsw", "fsd", "fsq", NULL, NULL, NULL
|
||||
};
|
||||
- mne = (char *) (idx == 0x08 ? storemne[func] : fstoremne[func]);
|
||||
+ mne = idx == 0x08 ? storemne[func] : fstoremne[func];
|
||||
break;
|
||||
case 0x0b:
|
||||
// AMO
|
||||
@@ -778,7 +778,7 @@ riscv_disasm (Ebl *ebl,
|
||||
}
|
||||
else
|
||||
{
|
||||
- mne = (char *) (idx == 0x0c ? arithmne2[func] : arithmne3[func]);
|
||||
+ mne = idx == 0x0c ? arithmne2[func] : arithmne3[func];
|
||||
op[1] = REG (rs1);
|
||||
op[2] = REG (rs2);
|
||||
}
|
||||
@@ -811,7 +811,7 @@ riscv_disasm (Ebl *ebl,
|
||||
op[2] = FREG (rs2);
|
||||
op[3] = FREG (rs3);
|
||||
if (rm != 0x7)
|
||||
- op[4] = (char *) rndmode[rm];
|
||||
+ op[4] = rndmode[rm];
|
||||
}
|
||||
break;
|
||||
case 0x14:
|
||||
@@ -839,7 +839,7 @@ riscv_disasm (Ebl *ebl,
|
||||
op[1] = FREG (rs1);
|
||||
op[2] = FREG (rs2);
|
||||
if (rm != 0x7)
|
||||
- op[3] = (char *) rndmode[rm];
|
||||
+ op[3] = rndmode[rm];
|
||||
}
|
||||
else if (func == 0x1c && width != 2 && rs2 == 0 && rm <= 1)
|
||||
{
|
||||
@@ -950,7 +950,7 @@ riscv_disasm (Ebl *ebl,
|
||||
}
|
||||
mne = mnebuf;
|
||||
if (rm != 0x7 && (func == 0x18 || width == 0 || rs2 >= 2))
|
||||
- op[2] = (char *) rndmode[rm];
|
||||
+ op[2] = rndmode[rm];
|
||||
}
|
||||
else if (func == 0x0b && rs2 == 0)
|
||||
{
|
||||
@@ -961,7 +961,7 @@ riscv_disasm (Ebl *ebl,
|
||||
*cp = '\0';
|
||||
mne = mnebuf;
|
||||
if (rm != 0x7)
|
||||
- op[2] = (char *) rndmode[rm];
|
||||
+ op[2] = rndmode[rm];
|
||||
}
|
||||
else if (func == 0x05 && rm < 2)
|
||||
{
|
||||
@@ -1007,7 +1007,7 @@ riscv_disasm (Ebl *ebl,
|
||||
"beq", "bne", NULL, NULL, "blt", "bge", "bltu", "bgeu"
|
||||
};
|
||||
func = (word >> 12) & 0x7;
|
||||
- mne = (char *) branchmne[func];
|
||||
+ mne = branchmne[func];
|
||||
if (rs1 == 0 && func == 5)
|
||||
{
|
||||
op[0] = op[1];
|
||||
@@ -1035,7 +1035,7 @@ riscv_disasm (Ebl *ebl,
|
||||
else if (func == 5 || func == 7)
|
||||
{
|
||||
// binutils use these opcodes and the reverse parameter order
|
||||
- char *tmp = op[0];
|
||||
+ const char *tmp = op[0];
|
||||
op[0] = op[1];
|
||||
op[1] = tmp;
|
||||
mne = func == 5 ? "ble" : "bleu";
|
||||
@@ -1103,7 +1103,7 @@ riscv_disasm (Ebl *ebl,
|
||||
{
|
||||
NULL, "frflags", "frrm", "frsr",
|
||||
};
|
||||
- mne = (char *) unprivrw[csr - 0x000];
|
||||
+ mne = unprivrw[csr - 0x000];
|
||||
}
|
||||
else if (csr >= 0xc00 && csr <= 0xc03)
|
||||
{
|
||||
@@ -1111,7 +1111,7 @@ riscv_disasm (Ebl *ebl,
|
||||
{
|
||||
"rdcycle", "rdtime", "rdinstret"
|
||||
};
|
||||
- mne = (char *) unprivrolow[csr - 0xc00];
|
||||
+ mne = unprivrolow[csr - 0xc00];
|
||||
}
|
||||
op[0] = REG ((word >> 7) & 0x1f);
|
||||
}
|
||||
@@ -1128,7 +1128,7 @@ riscv_disasm (Ebl *ebl,
|
||||
{
|
||||
NULL, "fsflagsi", "fsrmi", NULL
|
||||
};
|
||||
- mne = (char *) ((word & 0x4000) == 0 ? unprivrs : unprivrsi)[csr - 0x000];
|
||||
+ mne = ((word & 0x4000) == 0 ? unprivrs : unprivrsi)[csr - 0x000];
|
||||
|
||||
if ((word & 0x4000) == 0)
|
||||
op[0] = REG ((word >> 15) & 0x1f);
|
||||
@@ -1259,12 +1259,12 @@ riscv_disasm (Ebl *ebl,
|
||||
if (rd != 0)
|
||||
op[last++] = REG (rd);
|
||||
struct known_csrs key = { csr, NULL };
|
||||
- struct known_csrs *found = bsearch (&key, known,
|
||||
- sizeof (known) / sizeof (known[0]),
|
||||
- sizeof (known[0]),
|
||||
- compare_csr);
|
||||
+ const struct known_csrs *found = bsearch (&key, known,
|
||||
+ sizeof (known) / sizeof (known[0]),
|
||||
+ sizeof (known[0]),
|
||||
+ compare_csr);
|
||||
if (found)
|
||||
- op[last] = (char *) found->name;
|
||||
+ op[last] = found->name;
|
||||
else
|
||||
{
|
||||
snprintf (addrbuf, sizeof (addrbuf), "0x%" PRIx32, csr);
|
||||
@@ -1289,7 +1289,7 @@ riscv_disasm (Ebl *ebl,
|
||||
else if (instr == 3 && rd == 0)
|
||||
mne = "csrc";
|
||||
else
|
||||
- mne = (char *) mnecsr[instr];
|
||||
+ mne = mnecsr[instr];
|
||||
}
|
||||
break;
|
||||
default:
|
||||
diff --git a/libdw/dwarf_getsrclines.c b/libdw/dwarf_getsrclines.c
|
||||
index be10cdee..76db2929 100644
|
||||
--- a/libdw/dwarf_getsrclines.c
|
||||
+++ b/libdw/dwarf_getsrclines.c
|
||||
@@ -364,7 +364,7 @@ read_srcfiles (Dwarf *dbg,
|
||||
const unsigned char *dirp = linep;
|
||||
while (dirp < lineendp && *dirp != 0)
|
||||
{
|
||||
- uint8_t *endp = memchr (dirp, '\0', lineendp - dirp);
|
||||
+ const uint8_t *endp = memchr (dirp, '\0', lineendp - dirp);
|
||||
if (endp == NULL)
|
||||
goto invalid_data;
|
||||
++ndirs;
|
||||
@@ -440,7 +440,7 @@ read_srcfiles (Dwarf *dbg,
|
||||
for (unsigned int n = 1; n < ndirlist; n++)
|
||||
{
|
||||
dirarray[n].dir = (char *) linep;
|
||||
- uint8_t *endp = memchr (linep, '\0', lineendp - linep);
|
||||
+ const uint8_t *endp = memchr (linep, '\0', lineendp - linep);
|
||||
assert (endp != NULL); // Checked above when calculating ndirlist.
|
||||
dirarray[n].len = endp - linep;
|
||||
linep = endp + 1;
|
||||
@@ -927,7 +927,7 @@ read_srclines (Dwarf *dbg,
|
||||
case DW_LNE_define_file:
|
||||
{
|
||||
char *fname = (char *) linep;
|
||||
- uint8_t *endp = memchr (linep, '\0', lineendp - linep);
|
||||
+ const uint8_t *endp = memchr (linep, '\0', lineendp - linep);
|
||||
if (endp == NULL)
|
||||
goto invalid_data;
|
||||
size_t fnamelen = endp - linep;
|
||||
diff --git a/src/readelf.c b/src/readelf.c
|
||||
index a2d17358..fbdf8c71 100644
|
||||
--- a/src/readelf.c
|
||||
+++ b/src/readelf.c
|
||||
@@ -8269,7 +8269,7 @@ attr_callback (Dwarf_Attribute *attrp, void *arg)
|
||||
valuestr = dwarf_filesrc (files, num, NULL, NULL);
|
||||
if (valuestr != NULL)
|
||||
{
|
||||
- char *filename = strrchr (valuestr, '/');
|
||||
+ const char *filename = strrchr (valuestr, '/');
|
||||
if (filename != NULL)
|
||||
valuestr = filename + 1;
|
||||
}
|
||||
@@ -9033,7 +9033,7 @@ print_form_data (Dwarf *dbg, int form, const unsigned char *readp,
|
||||
Dwarf_Off str_offsets_base, FILE *out)
|
||||
{
|
||||
Dwarf_Word val;
|
||||
- unsigned char *endp;
|
||||
+ const unsigned char *endp;
|
||||
Elf_Data *data;
|
||||
char *str;
|
||||
switch (form)
|
||||
@@ -9530,7 +9530,7 @@ print_debug_line_section (Dwfl_Module *dwflmod, Ebl *ebl, GElf_Ehdr *ehdr,
|
||||
{
|
||||
while (linep < lineendp && *linep != 0)
|
||||
{
|
||||
- unsigned char *endp = memchr (linep, '\0', lineendp - linep);
|
||||
+ const unsigned char *endp = memchr (linep, '\0', lineendp - linep);
|
||||
if (unlikely (endp == NULL))
|
||||
goto invalid_unit;
|
||||
|
||||
@@ -9764,7 +9764,7 @@ print_debug_line_section (Dwfl_Module *dwflmod, Ebl *ebl, GElf_Ehdr *ehdr,
|
||||
case DW_LNE_define_file:
|
||||
{
|
||||
char *fname = (char *) linep;
|
||||
- unsigned char *endp = memchr (linep, '\0',
|
||||
+ const unsigned char *endp = memchr (linep, '\0',
|
||||
lineendp - linep);
|
||||
if (unlikely (endp == NULL))
|
||||
goto invalid_unit;
|
||||
--
|
||||
2.52.0
|
||||
|
||||
|
|
@ -1 +0,0 @@
|
|||
u debuginfod - "elfutils debuginfo server" /var/cache/debuginfod -
|
||||
867
elfutils.spec
867
elfutils.spec
File diff suppressed because it is too large
Load diff
14
gating.yaml
14
gating.yaml
|
|
@ -1,14 +0,0 @@
|
|||
--- !Policy
|
||||
product_versions:
|
||||
- fedora-*
|
||||
decision_context: bodhi_update_push_stable
|
||||
subject_type: koji_build
|
||||
rules:
|
||||
- !PassingTestCaseRule {test_case_name: fedora-ci.koji-build.tier0.functional}
|
||||
- !PassingTestCaseRule {test_case_name: fedora-ci.koji-build.rpminspect.static-analysis}
|
||||
--- !Policy
|
||||
product_versions:
|
||||
- rhel-9
|
||||
decision_context: osci_compose_gate
|
||||
rules:
|
||||
- !PassingTestCaseRule {test_case_name: baseos-ci.brew-build.tier1.functional}
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
summary: CI Gating Plan
|
||||
discover:
|
||||
how: fmf
|
||||
directory: tests
|
||||
execute:
|
||||
how: tmt
|
||||
2
sources
2
sources
|
|
@ -1 +1 @@
|
|||
SHA512 (elfutils-0.194.tar.bz2) = 5d00502f61b92643bf61dc61da4ddded36c423466388d992bcd388c5208761b8ed9db1a01492c085cd0984eef30c08f895a8e307e78e0df8df40b56ae35b78a5
|
||||
SHA512 (elfutils-0.174.tar.bz2) = 696708309c2a9a076099748809ecdc0490f4a8a842b2efc1aae0d746e7c5a8b203743f5626739eff837216b0c052696516b2821f5d3cc3f2eef86597c96d42df
|
||||
|
|
|
|||
|
|
@ -1,65 +0,0 @@
|
|||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# Makefile of /tools/elfutils/Regression/GNU-Attribute-notes-not-recognized
|
||||
# Description: GNU-Attribute-notes-not-recognized
|
||||
# Author: Martin Cermak <mcermak@redhat.com>
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# Copyright (c) 2018 Red Hat, Inc.
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License as
|
||||
# published by the Free Software Foundation, either version 2 of
|
||||
# the License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be
|
||||
# useful, but WITHOUT ANY WARRANTY; without even the implied
|
||||
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
# PURPOSE. See the GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see http://www.gnu.org/licenses/.
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
export TEST=/tools/elfutils/Regression/GNU-Attribute-notes-not-recognized
|
||||
export TESTVERSION=1.0
|
||||
|
||||
BUILT_FILES=
|
||||
|
||||
FILES=$(METADATA) runtest.sh Makefile PURPOSE
|
||||
|
||||
.PHONY: all install download clean
|
||||
|
||||
run: $(FILES) build
|
||||
./runtest.sh
|
||||
|
||||
build: $(BUILT_FILES)
|
||||
test -x runtest.sh || chmod a+x runtest.sh
|
||||
|
||||
clean:
|
||||
rm -f *~ $(BUILT_FILES)
|
||||
|
||||
|
||||
include /usr/share/rhts/lib/rhts-make.include
|
||||
|
||||
$(METADATA): Makefile
|
||||
@echo "Owner: Martin Cermak <mcermak@redhat.com>" > $(METADATA)
|
||||
@echo "Name: $(TEST)" >> $(METADATA)
|
||||
@echo "TestVersion: $(TESTVERSION)" >> $(METADATA)
|
||||
@echo "Path: $(TEST_DIR)" >> $(METADATA)
|
||||
@echo "Description: GNU-Attribute-notes-not-recognized" >> $(METADATA)
|
||||
@echo "Type: Regression" >> $(METADATA)
|
||||
@echo "TestTime: 48h" >> $(METADATA)
|
||||
@echo "RunFor: elfutils" >> $(METADATA)
|
||||
@echo "Requires: elfutils" >> $(METADATA)
|
||||
@echo "Requires: bash bash-debuginfo" >> $(METADATA)
|
||||
@echo "Priority: Normal" >> $(METADATA)
|
||||
@echo "License: GPLv2+" >> $(METADATA)
|
||||
@echo "Confidential: no" >> $(METADATA)
|
||||
@echo "Destructive: no" >> $(METADATA)
|
||||
@echo "Bug: 1650125" >> $(METADATA)
|
||||
@echo "Releases: -RHEL4 -RHEL6 -RHEL7 -RHELClient5 -RHELServer5" >> $(METADATA)
|
||||
|
||||
rhts-lint $(METADATA)
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
PURPOSE of /tools/elfutils/Regression/GNU-Attribute-notes-not-recognized
|
||||
Description: GNU-Attribute-notes-not-recognized
|
||||
Author: Martin Cermak <mcermak@redhat.com>
|
||||
Bug summary: elfutils doesn't recognize GNU Attribute notes
|
||||
Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1650125
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
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>
|
||||
component:
|
||||
- elfutils
|
||||
test: ./runtest.sh
|
||||
framework: beakerlib
|
||||
recommend:
|
||||
- elfutils
|
||||
- bash
|
||||
- bash-debuginfo
|
||||
duration: 48h
|
||||
extra-summary: /tools/elfutils/Regression/GNU-Attribute-notes-not-recognized
|
||||
extra-task: /tools/elfutils/Regression/GNU-Attribute-notes-not-recognized
|
||||
|
|
@ -1,66 +0,0 @@
|
|||
#!/bin/bash
|
||||
# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# runtest.sh of /tools/elfutils/Regression/GNU-Attribute-notes-not-recognized
|
||||
# Description: GNU-Attribute-notes-not-recognized
|
||||
# Author: Martin Cermak <mcermak@redhat.com>
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# Copyright (c) 2018 Red Hat, Inc.
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License as
|
||||
# published by the Free Software Foundation, either version 2 of
|
||||
# the License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be
|
||||
# useful, but WITHOUT ANY WARRANTY; without even the implied
|
||||
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
# PURPOSE. See the GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see http://www.gnu.org/licenses/.
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
# Include Beaker environment
|
||||
. /usr/share/beakerlib/beakerlib.sh || exit 1
|
||||
|
||||
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"
|
||||
rlPhaseEnd
|
||||
rlJournalPrintText
|
||||
rlJournalEnd
|
||||
|
|
@ -1,64 +0,0 @@
|
|||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# Makefile of /tools/elfutils/Regression/RFE-support-reading-compressed-ELF-objects
|
||||
# Description: Test for BZ#1674430 (RFE support reading compressed ELF objects)
|
||||
# Author: Martin Cermak <mcermak@redhat.com>
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# Copyright (c) 2019 Red Hat, Inc.
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License as
|
||||
# published by the Free Software Foundation, either version 2 of
|
||||
# the License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be
|
||||
# useful, but WITHOUT ANY WARRANTY; without even the implied
|
||||
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
# PURPOSE. See the GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see http://www.gnu.org/licenses/.
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
export TEST=/tools/elfutils/Regression/RFE-support-reading-compressed-ELF-objects
|
||||
export TESTVERSION=1.0
|
||||
|
||||
BUILT_FILES=
|
||||
|
||||
FILES=$(METADATA) runtest.sh Makefile PURPOSE
|
||||
|
||||
.PHONY: all install download clean
|
||||
|
||||
run: $(FILES) build
|
||||
./runtest.sh
|
||||
|
||||
build: $(BUILT_FILES)
|
||||
test -x runtest.sh || chmod a+x runtest.sh
|
||||
|
||||
clean:
|
||||
rm -f *~ $(BUILT_FILES)
|
||||
|
||||
|
||||
include /usr/share/rhts/lib/rhts-make.include
|
||||
|
||||
$(METADATA): Makefile
|
||||
@echo "Owner: Martin Cermak <mcermak@redhat.com>" > $(METADATA)
|
||||
@echo "Name: $(TEST)" >> $(METADATA)
|
||||
@echo "TestVersion: $(TESTVERSION)" >> $(METADATA)
|
||||
@echo "Path: $(TEST_DIR)" >> $(METADATA)
|
||||
@echo "Description: Test for BZ#1674430 (RFE support reading compressed ELF objects)" >> $(METADATA)
|
||||
@echo "Type: Regression" >> $(METADATA)
|
||||
@echo "TestTime: 48h" >> $(METADATA)
|
||||
@echo "RunFor: elfutils" >> $(METADATA)
|
||||
@echo "Requires: elfutils" >> $(METADATA)
|
||||
@echo "Priority: Normal" >> $(METADATA)
|
||||
@echo "License: GPLv2+" >> $(METADATA)
|
||||
@echo "Confidential: no" >> $(METADATA)
|
||||
@echo "Destructive: no" >> $(METADATA)
|
||||
@echo "Bug: 1674430" >> $(METADATA)
|
||||
@echo "Releases: -RHEL4 -RHELClient5 -RHELServer5" >> $(METADATA)
|
||||
|
||||
rhts-lint $(METADATA)
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
PURPOSE of /tools/elfutils/Regression/RFE-support-reading-compressed-ELF-objects
|
||||
Description: Test for BZ#1674430 (RFE support reading compressed ELF objects)
|
||||
Author: Martin Cermak <mcermak@redhat.com>
|
||||
Bug summary: RFE: support reading compressed ELF objects
|
||||
Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1674430
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
summary: Test for BZ#1674430 (RFE support reading compressed ELF objects)
|
||||
description: |
|
||||
Bug summary: RFE: support reading compressed ELF objects
|
||||
Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1674430
|
||||
contact:
|
||||
- Martin Cermak <mcermak@redhat.com>
|
||||
component:
|
||||
- elfutils
|
||||
test: ./runtest.sh
|
||||
framework: beakerlib
|
||||
recommend:
|
||||
- elfutils
|
||||
duration: 48h
|
||||
extra-summary: /tools/elfutils/Regression/RFE-support-reading-compressed-ELF-objects
|
||||
extra-task: /tools/elfutils/Regression/RFE-support-reading-compressed-ELF-objects
|
||||
|
|
@ -1,44 +0,0 @@
|
|||
#!/bin/bash
|
||||
# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# runtest.sh of /tools/elfutils/Regression/RFE-support-reading-compressed-ELF-objects
|
||||
# Description: Test for BZ#1674430 (RFE support reading compressed ELF objects)
|
||||
# Author: Martin Cermak <mcermak@redhat.com>
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# Copyright (c) 2019 Red Hat, Inc.
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License as
|
||||
# published by the Free Software Foundation, either version 2 of
|
||||
# the License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be
|
||||
# useful, but WITHOUT ANY WARRANTY; without even the implied
|
||||
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
# PURPOSE. See the GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see http://www.gnu.org/licenses/.
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
# Include Beaker environment
|
||||
. /usr/share/beakerlib/beakerlib.sh || exit 1
|
||||
|
||||
PACKAGE="elfutils"
|
||||
KOXZS_TO_TEST=20
|
||||
|
||||
rlJournalStart
|
||||
rlPhaseStartTest
|
||||
# Look to see that dwelf_elf_begin is now in libdw.so
|
||||
rlRun "eu-nm -D $(ldd $(which eu-readelf) | awk '/libdw.so/ {print $3}') | fgrep 'dwelf_elf_begin'"
|
||||
# Also eu-readelf now takes advantage of dwelf_elf_begin() to directly read compressed ELF files.
|
||||
for koxz in $(find /usr/lib/modules/ | fgrep '.ko.xz' | shuf -n $KOXZS_TO_TEST); do
|
||||
rlRun "eu-readelf -n $koxz"
|
||||
done
|
||||
rlPhaseEnd
|
||||
rlJournalPrintText
|
||||
rlJournalEnd
|
||||
|
|
@ -1,64 +0,0 @@
|
|||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# Makefile of /tools/elfutils/Regression/SHT_X86_64_UNWIND-section-not-recognized
|
||||
# Description: SHT_X86_64_UNWIND-section-not-recognized
|
||||
# Author: Martin Cermak <mcermak@redhat.com>
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# Copyright (c) 2018 Red Hat, Inc.
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License as
|
||||
# published by the Free Software Foundation, either version 2 of
|
||||
# the License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be
|
||||
# useful, but WITHOUT ANY WARRANTY; without even the implied
|
||||
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
# PURPOSE. See the GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see http://www.gnu.org/licenses/.
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
export TEST=/tools/elfutils/Regression/SHT_X86_64_UNWIND-section-not-recognized
|
||||
export TESTVERSION=1.0
|
||||
|
||||
BUILT_FILES=
|
||||
|
||||
FILES=$(METADATA) runtest.sh Makefile PURPOSE m.o
|
||||
|
||||
.PHONY: all install download clean
|
||||
|
||||
run: $(FILES) build
|
||||
./runtest.sh
|
||||
|
||||
build: $(BUILT_FILES)
|
||||
test -x runtest.sh || chmod a+x runtest.sh
|
||||
|
||||
clean:
|
||||
rm -f *~ $(BUILT_FILES)
|
||||
|
||||
|
||||
include /usr/share/rhts/lib/rhts-make.include
|
||||
|
||||
$(METADATA): Makefile
|
||||
@echo "Owner: Martin Cermak <mcermak@redhat.com>" > $(METADATA)
|
||||
@echo "Name: $(TEST)" >> $(METADATA)
|
||||
@echo "TestVersion: $(TESTVERSION)" >> $(METADATA)
|
||||
@echo "Path: $(TEST_DIR)" >> $(METADATA)
|
||||
@echo "Description: SHT_X86_64_UNWIND-section-not-recognized" >> $(METADATA)
|
||||
@echo "Type: Regression" >> $(METADATA)
|
||||
@echo "TestTime: 48h" >> $(METADATA)
|
||||
@echo "RunFor: elfutils" >> $(METADATA)
|
||||
@echo "Requires: elfutils" >> $(METADATA)
|
||||
@echo "Priority: Normal" >> $(METADATA)
|
||||
@echo "License: GPLv2+" >> $(METADATA)
|
||||
@echo "Confidential: no" >> $(METADATA)
|
||||
@echo "Destructive: no" >> $(METADATA)
|
||||
@echo "Bug: 1650114" >> $(METADATA)
|
||||
@echo "Releases: -RHEL4 -RHEL6 -RHEL7 -RHELClient5 -RHELServer5" >> $(METADATA)
|
||||
|
||||
rhts-lint $(METADATA)
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
PURPOSE of /tools/elfutils/Regression/SHT_X86_64_UNWIND-section-not-recognized
|
||||
Description: SHT_X86_64_UNWIND-section-not-recognized
|
||||
Author: Martin Cermak <mcermak@redhat.com>
|
||||
Bug summary: elfutils doesn't recognize gold linker SHT_X86_64_UNWIND section
|
||||
Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1650114
|
||||
Binary file not shown.
|
|
@ -1,15 +0,0 @@
|
|||
summary: SHT_X86_64_UNWIND-section-not-recognized
|
||||
description: |
|
||||
Bug summary: elfutils doesn't recognize gold linker SHT_X86_64_UNWIND section
|
||||
Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1650114
|
||||
contact:
|
||||
- Martin Cermak <mcermak@redhat.com>
|
||||
component:
|
||||
- elfutils
|
||||
test: ./runtest.sh
|
||||
framework: beakerlib
|
||||
recommend:
|
||||
- elfutils
|
||||
duration: 48h
|
||||
extra-summary: /tools/elfutils/Regression/SHT_X86_64_UNWIND-section-not-recognized
|
||||
extra-task: /tools/elfutils/Regression/SHT_X86_64_UNWIND-section-not-recognized
|
||||
|
|
@ -1,39 +0,0 @@
|
|||
#!/bin/bash
|
||||
# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# runtest.sh of /tools/elfutils/Regression/SHT_X86_64_UNWIND-section-not-recognized
|
||||
# Description: SHT_X86_64_UNWIND-section-not-recognized
|
||||
# Author: Martin Cermak <mcermak@redhat.com>
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# Copyright (c) 2018 Red Hat, Inc.
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License as
|
||||
# published by the Free Software Foundation, either version 2 of
|
||||
# the License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be
|
||||
# useful, but WITHOUT ANY WARRANTY; without even the implied
|
||||
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
# PURPOSE. See the GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see http://www.gnu.org/licenses/.
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
# Include Beaker environment
|
||||
. /usr/share/beakerlib/beakerlib.sh || exit 1
|
||||
|
||||
PACKAGE="elfutils"
|
||||
|
||||
rlJournalStart
|
||||
rlPhaseStartTest
|
||||
set -o pipefail
|
||||
rlRun "eu-readelf -S m.o | fgrep .eh_frame | fgrep X86_64_UNWIND"
|
||||
rlPhaseEnd
|
||||
rlJournalPrintText
|
||||
rlJournalEnd
|
||||
|
|
@ -1,63 +0,0 @@
|
|||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# Makefile of /tools/elfutils/Regression/abrt-faf-elfutils-IO-default-xsputn
|
||||
# Description: abrt-faf-elfutils-IO-default-xsputn
|
||||
# Author: Martin Cermak <mcermak@redhat.com>
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# Copyright (c) 2015 Red Hat, Inc.
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License as
|
||||
# published by the Free Software Foundation, either version 2 of
|
||||
# the License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be
|
||||
# useful, but WITHOUT ANY WARRANTY; without even the implied
|
||||
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
# PURPOSE. See the GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see http://www.gnu.org/licenses/.
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
export TEST=/tools/elfutils/Regression/abrt-faf-elfutils-IO-default-xsputn
|
||||
export TESTVERSION=1.0
|
||||
|
||||
BUILT_FILES=
|
||||
|
||||
FILES=$(METADATA) runtest.sh Makefile PURPOSE eu-readelf-n-crash.core.xz
|
||||
|
||||
.PHONY: all install download clean
|
||||
|
||||
run: $(FILES) build
|
||||
./runtest.sh
|
||||
|
||||
build: $(BUILT_FILES)
|
||||
test -x runtest.sh || chmod a+x runtest.sh
|
||||
|
||||
clean:
|
||||
rm -f *~ $(BUILT_FILES)
|
||||
|
||||
|
||||
include /usr/share/rhts/lib/rhts-make.include
|
||||
|
||||
$(METADATA): Makefile
|
||||
@echo "Owner: Martin Cermak <mcermak@redhat.com>" > $(METADATA)
|
||||
@echo "Name: $(TEST)" >> $(METADATA)
|
||||
@echo "TestVersion: $(TESTVERSION)" >> $(METADATA)
|
||||
@echo "Path: $(TEST_DIR)" >> $(METADATA)
|
||||
@echo "Description: abrt-faf-elfutils-IO-default-xsputn" >> $(METADATA)
|
||||
@echo "Type: Regression" >> $(METADATA)
|
||||
@echo "TestTime: 5m" >> $(METADATA)
|
||||
@echo "RunFor: elfutils" >> $(METADATA)
|
||||
@echo "Requires: elfutils xz" >> $(METADATA)
|
||||
@echo "Priority: Normal" >> $(METADATA)
|
||||
@echo "License: GPLv2+" >> $(METADATA)
|
||||
@echo "Confidential: no" >> $(METADATA)
|
||||
@echo "Destructive: no" >> $(METADATA)
|
||||
@echo "Bug: 1262839" >> $(METADATA)
|
||||
|
||||
rhts-lint $(METADATA)
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
PURPOSE of /tools/elfutils/Regression/abrt-faf-elfutils-IO-default-xsputn
|
||||
Description: abrt-faf-elfutils-IO-default-xsputn
|
||||
Author: Martin Cermak <mcermak@redhat.com>
|
||||
Bug summary: [abrt] [faf] elfutils: _IO_default_xsputn(): /usr/bin/eu-readelf killed by 11
|
||||
Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1262839
|
||||
Binary file not shown.
|
|
@ -1,16 +0,0 @@
|
|||
summary: abrt-faf-elfutils-IO-default-xsputn
|
||||
description: |
|
||||
Bug summary: [abrt] [faf] elfutils: _IO_default_xsputn(): /usr/bin/eu-readelf killed by 11
|
||||
Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1262839
|
||||
contact:
|
||||
- Martin Cermak <mcermak@redhat.com>
|
||||
component:
|
||||
- elfutils
|
||||
test: ./runtest.sh
|
||||
framework: beakerlib
|
||||
recommend:
|
||||
- elfutils
|
||||
- xz
|
||||
duration: 5m
|
||||
extra-summary: /tools/elfutils/Regression/abrt-faf-elfutils-IO-default-xsputn
|
||||
extra-task: /tools/elfutils/Regression/abrt-faf-elfutils-IO-default-xsputn
|
||||
|
|
@ -1,48 +0,0 @@
|
|||
#!/bin/bash
|
||||
# vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# runtest.sh of /tools/elfutils/Regression/abrt-faf-elfutils-IO-default-xsputn
|
||||
# Description: abrt-faf-elfutils-IO-default-xsputn
|
||||
# Author: Martin Cermak <mcermak@redhat.com>
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# Copyright (c) 2015 Red Hat, Inc.
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License as
|
||||
# published by the Free Software Foundation, either version 2 of
|
||||
# the License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be
|
||||
# useful, but WITHOUT ANY WARRANTY; without even the implied
|
||||
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
# PURPOSE. See the GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see http://www.gnu.org/licenses/.
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
# Include Beaker environment
|
||||
. /usr/share/beakerlib/beakerlib.sh || exit 1
|
||||
|
||||
rlJournalStart
|
||||
rlPhaseStartSetup
|
||||
rlRun "TMPD=$(mktemp -d)"
|
||||
rlRun "cp eu-readelf-n-crash.core.xz $TMPD/"
|
||||
rlRun "pushd $TMPD"
|
||||
rlRun "unxz eu-readelf-n-crash.core.xz"
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartTest
|
||||
rlRun "eu-readelf -n ./eu-readelf-n-crash.core"
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartCleanup
|
||||
rlRun "popd"
|
||||
rlRun "rm -r $TMPD"
|
||||
rlPhaseEnd
|
||||
rlJournalPrintText
|
||||
rlJournalEnd
|
||||
|
|
@ -1,65 +0,0 @@
|
|||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# Makefile of /tools/elfutils/Regression/add-ppc64-fallback-unwinder
|
||||
# Description: add-ppc64-fallback-unwinder
|
||||
# Author: Martin Cermak <mcermak@redhat.com>
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# Copyright (c) 2017 Red Hat, Inc.
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License as
|
||||
# published by the Free Software Foundation, either version 2 of
|
||||
# the License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be
|
||||
# useful, but WITHOUT ANY WARRANTY; without even the implied
|
||||
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
# PURPOSE. See the GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see http://www.gnu.org/licenses/.
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
export TEST=/tools/elfutils/Regression/add-ppc64-fallback-unwinder
|
||||
export TESTVERSION=1.0
|
||||
|
||||
BUILT_FILES=
|
||||
|
||||
FILES=$(METADATA) runtest.sh Makefile PURPOSE backtrace.ppc64le.fp.core.bz2 backtrace.ppc64le.fp.exec.bz2 output.ref
|
||||
|
||||
.PHONY: all install download clean
|
||||
|
||||
run: $(FILES) build
|
||||
./runtest.sh
|
||||
|
||||
build: $(BUILT_FILES)
|
||||
test -x runtest.sh || chmod a+x runtest.sh
|
||||
|
||||
clean:
|
||||
rm -f *~ $(BUILT_FILES)
|
||||
|
||||
|
||||
include /usr/share/rhts/lib/rhts-make.include
|
||||
|
||||
$(METADATA): Makefile
|
||||
@echo "Owner: Martin Cermak <mcermak@redhat.com>" > $(METADATA)
|
||||
@echo "Name: $(TEST)" >> $(METADATA)
|
||||
@echo "TestVersion: $(TESTVERSION)" >> $(METADATA)
|
||||
@echo "Path: $(TEST_DIR)" >> $(METADATA)
|
||||
@echo "Description: add-ppc64-fallback-unwinder" >> $(METADATA)
|
||||
@echo "Type: Regression" >> $(METADATA)
|
||||
@echo "TestTime: 10m" >> $(METADATA)
|
||||
@echo "RunFor: elfutils" >> $(METADATA)
|
||||
@echo "Requires: elfutils" >> $(METADATA)
|
||||
@echo "Requires: bzip2" >> $(METADATA)
|
||||
@echo "Priority: Normal" >> $(METADATA)
|
||||
@echo "License: GPLv2+" >> $(METADATA)
|
||||
@echo "Confidential: no" >> $(METADATA)
|
||||
@echo "Destructive: no" >> $(METADATA)
|
||||
@echo "Bug: 1454754" >> $(METADATA)
|
||||
@echo "Releases: -RHEL4 -RHELClient5 -RHELServer5" >> $(METADATA)
|
||||
|
||||
rhts-lint $(METADATA)
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
PURPOSE of /tools/elfutils/Regression/add-ppc64-fallback-unwinder
|
||||
Description: add-ppc64-fallback-unwinder
|
||||
Author: Martin Cermak <mcermak@redhat.com>
|
||||
Bug summary: Add ppc64 fallback unwinder to elfutils libdw
|
||||
Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1454754
|
||||
Binary file not shown.
Binary file not shown.
|
|
@ -1,16 +0,0 @@
|
|||
summary: add-ppc64-fallback-unwinder
|
||||
description: |
|
||||
Bug summary: Add ppc64 fallback unwinder to elfutils libdw
|
||||
Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1454754
|
||||
contact:
|
||||
- Martin Cermak <mcermak@redhat.com>
|
||||
component:
|
||||
- elfutils
|
||||
test: ./runtest.sh
|
||||
framework: beakerlib
|
||||
recommend:
|
||||
- elfutils
|
||||
- bzip2
|
||||
duration: 10m
|
||||
extra-summary: /tools/elfutils/Regression/add-ppc64-fallback-unwinder
|
||||
extra-task: /tools/elfutils/Regression/add-ppc64-fallback-unwinder
|
||||
|
|
@ -1,17 +0,0 @@
|
|||
PID 23727 - core
|
||||
TID 23728:
|
||||
#0 0x00000000100104bc raise
|
||||
#1 0x0000000010002a1c sigusr2
|
||||
#2 0x0000000010002a1c sigusr2
|
||||
#3 0x0000000010002b38 stdarg
|
||||
#4 0x0000000010002bc4 backtracegen
|
||||
#5 0x0000000010002bf0 start
|
||||
#6 0x0000000010004c28 start_thread
|
||||
eu-stack: dwfl_thread_getframes tid 23728 at 0x10004c27 in /root/mjw/elfutils/tests/backtrace.ppc64le.fp.exec: (null)
|
||||
TID 23727:
|
||||
#0 0x0000000010006034 pthread_join
|
||||
#1 0x00000000100025bc main
|
||||
#2 0x00000000100025bc main
|
||||
#3 0x00000000100123c4 generic_start_main
|
||||
#4 0x0000000010012570 __libc_start_main
|
||||
eu-stack: dwfl_thread_getframes tid 23727 at 0x1001256f in /root/mjw/elfutils/tests/backtrace.ppc64le.fp.exec: No DWARF information found
|
||||
|
|
@ -1,55 +0,0 @@
|
|||
#!/bin/bash
|
||||
# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# runtest.sh of /tools/elfutils/Regression/add-ppc64-fallback-unwinder
|
||||
# Description: add-ppc64-fallback-unwinder
|
||||
# Author: Martin Cermak <mcermak@redhat.com>
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# Copyright (c) 2017 Red Hat, Inc.
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License as
|
||||
# published by the Free Software Foundation, either version 2 of
|
||||
# the License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be
|
||||
# useful, but WITHOUT ANY WARRANTY; without even the implied
|
||||
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
# PURPOSE. See the GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see http://www.gnu.org/licenses/.
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
# Include Beaker environment
|
||||
. /usr/share/beakerlib/beakerlib.sh || exit 1
|
||||
|
||||
PACKAGE="elfutils"
|
||||
|
||||
rlJournalStart
|
||||
rlPhaseStartSetup
|
||||
rlAssertRpm $PACKAGE
|
||||
rlRun "TEMPD=\$(mktemp -d)"
|
||||
rlRun "cp backtrace.ppc64le.fp.core.bz2 backtrace.ppc64le.fp.exec.bz2 output.ref $TEMPD"
|
||||
rlRun "pushd $TEMPD"
|
||||
rlRun "bunzip2 backtrace.ppc64le.fp.core.bz2"
|
||||
rlRun "bunzip2 backtrace.ppc64le.fp.exec.bz2"
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartTest
|
||||
rlRun "eu-stack --exec backtrace.ppc64le.fp.exec --core backtrace.ppc64le.fp.core |& tee output.txt"
|
||||
rlRun "grep '^#' output.ref > output.ref.filtered"
|
||||
rlRun "grep '^#' output.txt > output.txt.filtered"
|
||||
rlRun "diff output.txt.filtered output.ref.filtered"
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartCleanup
|
||||
rlRun "popd"
|
||||
rlRun "rm -r $TEMPD"
|
||||
rlPhaseEnd
|
||||
rlJournalPrintText
|
||||
rlJournalEnd
|
||||
|
|
@ -1,65 +0,0 @@
|
|||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# Makefile of /tools/elfutils/Regression/api-break-in-libasm-h
|
||||
# Description: api-break-in-libasm-h
|
||||
# Author: Martin Cermak <mcermak@redhat.com>
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# Copyright (c) 2020 Red Hat, Inc.
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License as
|
||||
# published by the Free Software Foundation, either version 2 of
|
||||
# the License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be
|
||||
# useful, but WITHOUT ANY WARRANTY; without even the implied
|
||||
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
# PURPOSE. See the GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see http://www.gnu.org/licenses/.
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
export TEST=/tools/elfutils/Regression/api-break-in-libasm-h
|
||||
export TESTVERSION=1.0
|
||||
|
||||
BUILT_FILES=
|
||||
|
||||
FILES=$(METADATA) runtest.sh Makefile PURPOSE test.c
|
||||
|
||||
.PHONY: all install download clean
|
||||
|
||||
run: $(FILES) build
|
||||
./runtest.sh
|
||||
|
||||
build: $(BUILT_FILES)
|
||||
test -x runtest.sh || chmod a+x runtest.sh
|
||||
|
||||
clean:
|
||||
rm -f *~ $(BUILT_FILES)
|
||||
|
||||
|
||||
include /usr/share/rhts/lib/rhts-make.include
|
||||
|
||||
$(METADATA): Makefile
|
||||
@echo "Owner: Martin Cermak <mcermak@redhat.com>" > $(METADATA)
|
||||
@echo "Name: $(TEST)" >> $(METADATA)
|
||||
@echo "TestVersion: $(TESTVERSION)" >> $(METADATA)
|
||||
@echo "Path: $(TEST_DIR)" >> $(METADATA)
|
||||
@echo "Description: api-break-in-libasm-h" >> $(METADATA)
|
||||
@echo "Type: Regression" >> $(METADATA)
|
||||
@echo "TestTime: 48h" >> $(METADATA)
|
||||
@echo "RunFor: elfutils" >> $(METADATA)
|
||||
@echo "Requires: elfutils-devel" >> $(METADATA)
|
||||
@echo "Requires: gcc" >> $(METADATA)
|
||||
@echo "Priority: Normal" >> $(METADATA)
|
||||
@echo "License: GPLv2+" >> $(METADATA)
|
||||
@echo "Confidential: no" >> $(METADATA)
|
||||
@echo "Destructive: no" >> $(METADATA)
|
||||
@echo "Bug: 1789885" >> $(METADATA)
|
||||
@echo "Releases: -RHEL4 -RHELClient5 -RHELServer5" >> $(METADATA)
|
||||
|
||||
rhts-lint $(METADATA)
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
PURPOSE of /tools/elfutils/Regression/api-break-in-libasm-h
|
||||
Description: api-break-in-libasm-h
|
||||
Author: Martin Cermak <mcermak@redhat.com>
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
summary: api-break-in-libasm-h
|
||||
description: ''
|
||||
contact:
|
||||
- Martin Cermak <mcermak@redhat.com>
|
||||
component:
|
||||
- elfutils
|
||||
test: ./runtest.sh
|
||||
framework: beakerlib
|
||||
recommend:
|
||||
- elfutils-devel
|
||||
- gcc
|
||||
duration: 48h
|
||||
extra-summary: /tools/elfutils/Regression/api-break-in-libasm-h
|
||||
extra-task: /tools/elfutils/Regression/api-break-in-libasm-h
|
||||
|
|
@ -1,39 +0,0 @@
|
|||
#!/bin/bash
|
||||
# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# runtest.sh of /tools/elfutils/Regression/api-break-in-libasm-h
|
||||
# Description: api-break-in-libasm-h
|
||||
# Author: Martin Cermak <mcermak@redhat.com>
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# Copyright (c) 2020 Red Hat, Inc.
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License as
|
||||
# published by the Free Software Foundation, either version 2 of
|
||||
# the License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be
|
||||
# useful, but WITHOUT ANY WARRANTY; without even the implied
|
||||
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
# PURPOSE. See the GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see http://www.gnu.org/licenses/.
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
# Include Beaker environment
|
||||
. /usr/share/beakerlib/beakerlib.sh || exit 1
|
||||
|
||||
PACKAGE="elfutils"
|
||||
|
||||
rlJournalStart
|
||||
rlPhaseStartTest
|
||||
rlRun "test -f /usr/include/elfutils/libasm.h"
|
||||
rlRun "gcc -I/usr/include/elfutils -c test.c"
|
||||
rlPhaseEnd
|
||||
rlJournalPrintText
|
||||
rlJournalEnd
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
#include <libelf.h>
|
||||
#include <gelf.h>
|
||||
#include <libasm.h>
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,64 +0,0 @@
|
|||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# Makefile of /tools/elfutils/Regression/bz1059897-Support-64-bit-SYM64-symbol-table
|
||||
# Description: Test for BZ#1059897 (Support 64-bit /SYM64/ symbol table)
|
||||
# Author: Vaclav Kadlcik <vkadlcik@redhat.com>
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# Copyright (c) 2014 Red Hat, Inc.
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License as
|
||||
# published by the Free Software Foundation, either version 2 of
|
||||
# the License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be
|
||||
# useful, but WITHOUT ANY WARRANTY; without even the implied
|
||||
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
# PURPOSE. See the GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see http://www.gnu.org/licenses/.
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
export TEST=/tools/elfutils/Regression/bz1059897-Support-64-bit-SYM64-symbol-table
|
||||
export TESTVERSION=1.0
|
||||
|
||||
BUILT_FILES=
|
||||
|
||||
FILES=$(METADATA) runtest.sh Makefile PURPOSE libantlr.a.bz2
|
||||
|
||||
.PHONY: all install download clean
|
||||
|
||||
run: $(FILES) build
|
||||
./runtest.sh
|
||||
|
||||
build: $(BUILT_FILES)
|
||||
test -x runtest.sh || chmod a+x runtest.sh
|
||||
|
||||
clean:
|
||||
rm -f *~ $(BUILT_FILES)
|
||||
|
||||
|
||||
include /usr/share/rhts/lib/rhts-make.include
|
||||
|
||||
$(METADATA): Makefile
|
||||
@echo "Owner: Vaclav Kadlcik <vkadlcik@redhat.com>" > $(METADATA)
|
||||
@echo "Name: $(TEST)" >> $(METADATA)
|
||||
@echo "TestVersion: $(TESTVERSION)" >> $(METADATA)
|
||||
@echo "Path: $(TEST_DIR)" >> $(METADATA)
|
||||
@echo "Description: Test for BZ#1059897 (Support 64-bit /SYM64/ symbol table)" >> $(METADATA)
|
||||
@echo "Type: Regression" >> $(METADATA)
|
||||
@echo "TestTime: 5m" >> $(METADATA)
|
||||
@echo "RunFor: elfutils" >> $(METADATA)
|
||||
@echo "Requires: elfutils" >> $(METADATA)
|
||||
@echo "Requires: bzip2" >> $(METADATA)
|
||||
@echo "Priority: Normal" >> $(METADATA)
|
||||
@echo "License: GPLv2+" >> $(METADATA)
|
||||
@echo "Confidential: no" >> $(METADATA)
|
||||
@echo "Destructive: no" >> $(METADATA)
|
||||
@echo "Bug: 1059897" >> $(METADATA)
|
||||
|
||||
rhts-lint $(METADATA)
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
PURPOSE of /tools/elfutils/Regression/bz1059897-Support-64-bit-SYM64-symbol-table
|
||||
Description: Test for BZ#1059897 (Support 64-bit /SYM64/ symbol table)
|
||||
Author: Vaclav Kadlcik <vkadlcik@redhat.com>
|
||||
Bug summary: Support 64-bit /SYM64/ symbol table
|
||||
Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1059897
|
||||
|
||||
Verify that a 64-bit symbol table produced on s390x is readable by elfutils
|
||||
tools. The test is based on Ed Santiago's examples in Bugzilla; a test file
|
||||
(libantlr.a) is taken from antlr-C++-2.7.7-30.el7.s390x.rpm. Mark Wielaard
|
||||
mentioned another test included in the upstream; it gets processed within
|
||||
../../testsuite (which runs the complete upstream testsuite) so its omission
|
||||
here is intentional.
|
||||
Binary file not shown.
|
|
@ -1,23 +0,0 @@
|
|||
summary: Test for BZ#1059897 (Support 64-bit /SYM64/ symbol table)
|
||||
description: |
|
||||
Bug summary: Support 64-bit /SYM64/ symbol table
|
||||
Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1059897
|
||||
|
||||
Verify that a 64-bit symbol table produced on s390x is readable by elfutils
|
||||
tools. The test is based on Ed Santiago's examples in Bugzilla; a test file
|
||||
(libantlr.a) is taken from antlr-C++-2.7.7-30.el7.s390x.rpm. Mark Wielaard
|
||||
mentioned another test included in the upstream; it gets processed within
|
||||
../../testsuite (which runs the complete upstream testsuite) so its omission
|
||||
here is intentional.
|
||||
contact:
|
||||
- Vaclav Kadlcik <vkadlcik@redhat.com>
|
||||
component:
|
||||
- elfutils
|
||||
test: ./runtest.sh
|
||||
framework: beakerlib
|
||||
recommend:
|
||||
- elfutils
|
||||
- bzip2
|
||||
duration: 5m
|
||||
extra-summary: /tools/elfutils/Regression/bz1059897-Support-64-bit-SYM64-symbol-table
|
||||
extra-task: /tools/elfutils/Regression/bz1059897-Support-64-bit-SYM64-symbol-table
|
||||
|
|
@ -1,64 +0,0 @@
|
|||
#!/bin/bash
|
||||
# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# runtest.sh of /tools/elfutils/Regression/bz1059897-Support-64-bit-SYM64-symbol-table
|
||||
# Description: Test for BZ#1059897 (Support 64-bit /SYM64/ symbol table)
|
||||
# Author: Vaclav Kadlcik <vkadlcik@redhat.com>
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# Copyright (c) 2014 Red Hat, Inc.
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License as
|
||||
# published by the Free Software Foundation, either version 2 of
|
||||
# the License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be
|
||||
# useful, but WITHOUT ANY WARRANTY; without even the implied
|
||||
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
# PURPOSE. See the GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see http://www.gnu.org/licenses/.
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
# Include Beaker environment
|
||||
. /usr/share/beakerlib/beakerlib.sh || exit 1
|
||||
|
||||
PACKAGE="elfutils"
|
||||
|
||||
TEST_ARCHIVE_1='libantlr.a' # see PURPOSE & Bugzilla
|
||||
|
||||
rlJournalStart
|
||||
rlPhaseStartSetup
|
||||
rlAssertRpm $PACKAGE
|
||||
rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory"
|
||||
rlRun "cp ${TEST_ARCHIVE_1}.bz2 $TmpDir" 0 "Copying test files"
|
||||
rlRun "pushd $TmpDir"
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartTest
|
||||
|
||||
rlRun "bunzip2 ${TEST_ARCHIVE_1}.bz2"
|
||||
rlAssertExists "$TEST_ARCHIVE_1"
|
||||
|
||||
rlRun -s "eu-ar t $TEST_ARCHIVE_1" 0 "Checking eu-ar runs"
|
||||
rlAssertExists "$rlRun_LOG"
|
||||
rlAssertGrep '^/SYM64/$' "$rlRun_LOG"
|
||||
rlAssertGrep '^ANTLRUtil\.o$' "$rlRun_LOG"
|
||||
|
||||
rlRun -s "eu-readelf -a $TEST_ARCHIVE_1" 0 "Checking eu-readelf runs"
|
||||
rlAssertExists "$rlRun_LOG"
|
||||
rlAssertGrep '^ELF Header:$' "$rlRun_LOG"
|
||||
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartCleanup
|
||||
rlRun "popd"
|
||||
rlRun "rm -r $TmpDir" 0 "Removing tmp directory"
|
||||
rlPhaseEnd
|
||||
rlJournalPrintText
|
||||
rlJournalEnd
|
||||
|
|
@ -1,65 +0,0 @@
|
|||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# Makefile of /tools/elfutils/Regression/bz1371517-eu-stack-killed-by-SIGABRT-processing-gcore
|
||||
# Description: Test for BZ#1371517 (eu-stack killed by SIGABRT processing gcore)
|
||||
# Author: Martin Cermak <mcermak@redhat.com>
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# Copyright (c) 2017 Red Hat, Inc.
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License as
|
||||
# published by the Free Software Foundation, either version 2 of
|
||||
# the License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be
|
||||
# useful, but WITHOUT ANY WARRANTY; without even the implied
|
||||
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
# PURPOSE. See the GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see http://www.gnu.org/licenses/.
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
export TEST=/tools/elfutils/Regression/bz1371517-eu-stack-killed-by-SIGABRT-processing-gcore
|
||||
export TESTVERSION=1.0
|
||||
|
||||
BUILT_FILES=
|
||||
|
||||
FILES=$(METADATA) runtest.sh Makefile PURPOSE
|
||||
|
||||
.PHONY: all install download clean
|
||||
|
||||
run: $(FILES) build
|
||||
./runtest.sh
|
||||
|
||||
build: $(BUILT_FILES)
|
||||
test -x runtest.sh || chmod a+x runtest.sh
|
||||
|
||||
clean:
|
||||
rm -f *~ $(BUILT_FILES)
|
||||
|
||||
|
||||
include /usr/share/rhts/lib/rhts-make.include
|
||||
|
||||
$(METADATA): Makefile
|
||||
@echo "Owner: Martin Cermak <mcermak@redhat.com>" > $(METADATA)
|
||||
@echo "Name: $(TEST)" >> $(METADATA)
|
||||
@echo "TestVersion: $(TESTVERSION)" >> $(METADATA)
|
||||
@echo "Path: $(TEST_DIR)" >> $(METADATA)
|
||||
@echo "Description: Test for BZ#1371517 (eu-stack killed by SIGABRT processing gcore)" >> $(METADATA)
|
||||
@echo "Type: Regression" >> $(METADATA)
|
||||
@echo "TestTime: 48h" >> $(METADATA)
|
||||
@echo "RunFor: elfutils" >> $(METADATA)
|
||||
@echo "Requires: elfutils" >> $(METADATA)
|
||||
@echo "Requires: gdb" >> $(METADATA)
|
||||
@echo "Priority: Normal" >> $(METADATA)
|
||||
@echo "License: GPLv2+" >> $(METADATA)
|
||||
@echo "Confidential: no" >> $(METADATA)
|
||||
@echo "Destructive: no" >> $(METADATA)
|
||||
@echo "Bug: 1371517" >> $(METADATA)
|
||||
@echo "Releases: -RHEL4 -RHELClient5 -RHELServer5" >> $(METADATA)
|
||||
|
||||
rhts-lint $(METADATA)
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
PURPOSE of /tools/elfutils/Regression/bz1371517-eu-stack-killed-by-SIGABRT-processing-gcore
|
||||
Description: Test for BZ#1371517 (eu-stack killed by SIGABRT processing gcore)
|
||||
Author: Martin Cermak <mcermak@redhat.com>
|
||||
Bug summary: eu-stack killed by SIGABRT processing gcore created core file
|
||||
Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1371517
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
summary: Test for BZ#1371517 (eu-stack killed by SIGABRT processing gcore)
|
||||
description: |
|
||||
Bug summary: eu-stack killed by SIGABRT processing gcore created core file
|
||||
Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1371517
|
||||
contact:
|
||||
- Martin Cermak <mcermak@redhat.com>
|
||||
component:
|
||||
- elfutils
|
||||
test: ./runtest.sh
|
||||
framework: beakerlib
|
||||
recommend:
|
||||
- elfutils
|
||||
- gdb
|
||||
duration: 48h
|
||||
extra-summary: /tools/elfutils/Regression/bz1371517-eu-stack-killed-by-SIGABRT-processing-gcore
|
||||
extra-task: /tools/elfutils/Regression/bz1371517-eu-stack-killed-by-SIGABRT-processing-gcore
|
||||
|
|
@ -1,72 +0,0 @@
|
|||
#!/bin/bash
|
||||
# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# runtest.sh of /tools/elfutils/Regression/bz1371517-eu-stack-killed-by-SIGABRT-processing-gcore
|
||||
# Description: Test for BZ#1371517 (eu-stack killed by SIGABRT processing gcore)
|
||||
# Author: Martin Cermak <mcermak@redhat.com>
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# Copyright (c) 2017 Red Hat, Inc.
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License as
|
||||
# published by the Free Software Foundation, either version 2 of
|
||||
# the License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be
|
||||
# useful, but WITHOUT ANY WARRANTY; without even the implied
|
||||
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
# PURPOSE. See the GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see http://www.gnu.org/licenses/.
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
# Include Beaker environment
|
||||
. /usr/share/beakerlib/beakerlib.sh || exit 1
|
||||
|
||||
rlJournalStart
|
||||
rlPhaseStartSetup
|
||||
rlRun "rpm -q elfutils"
|
||||
rlRun "rpm -q gdb"
|
||||
rlRun "TMPD=\$(mktemp -d)"
|
||||
rlRun "pushd $TMPD"
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStart FAIL "Build an unstripped binary"
|
||||
# ... so that we don't need to rely on the infra providing us with
|
||||
# a (coreutils-) debuginfo package.
|
||||
echo -e "#include <unistd.h>\nint main () { sleep(100); return 0; }" | gcc -g -xc -o sleep100 -
|
||||
rlRun "file sleep100 | fgrep 'not stripped'"
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartTest
|
||||
./sleep100 &
|
||||
SLEEP_PID=$!
|
||||
rlRun "gcore $SLEEP_PID"
|
||||
# On some arches, such as aarch64, or s390x, eu-stack doesn't end at some
|
||||
# reasonable point, when printing the trace, and goes across main, to
|
||||
# __libc_start_main and even higher and then finally complains about
|
||||
# "no matching address range". But we don't want to be so strict to check
|
||||
# for this right now. Mark Wielaard says it is okay, so I trust him ...
|
||||
# Following assert fails when we get SEGV, which would be bz1371517, which
|
||||
# reproduces e.g. on f25 using elfutils-0.166-2.fc25, or on rhel-7.3
|
||||
# using elfutils-0.166-2.el7.
|
||||
rlRun "eu-stack --executable=./sleep100 --core=core.$SLEEP_PID > output.txt" 0,1
|
||||
# Print the output. Yeah, this could be done using tee or something in
|
||||
# the above line and play games with exitcodes within a pipe chain, but
|
||||
# this actually is https://en.wikipedia.org/wiki/KISS_principle :)
|
||||
rlRun "cat output.txt"
|
||||
# ... we do want to check at least that "main" was listed in the trace.
|
||||
rlRun "awk {'print \$3'} output.txt | grep ^main$"
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartCleanup
|
||||
rlRun "popd"
|
||||
rlRun "rm -r $TMPD"
|
||||
rlPhaseEnd
|
||||
rlJournalPrintText
|
||||
rlJournalEnd
|
||||
|
|
@ -1,64 +0,0 @@
|
|||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# Makefile of /tools/elfutils/Regression/bz1717349-vaguely-related-SEGV
|
||||
# Description: bz1717349-vaguely-related-SEGV
|
||||
# Author: Martin Cermak <mcermak@redhat.com>
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# Copyright (c) 2019 Red Hat, Inc.
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License as
|
||||
# published by the Free Software Foundation, either version 2 of
|
||||
# the License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be
|
||||
# useful, but WITHOUT ANY WARRANTY; without even the implied
|
||||
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
# PURPOSE. See the GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see http://www.gnu.org/licenses/.
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
export TEST=/tools/elfutils/Regression/bz1717349-vaguely-related-SEGV
|
||||
export TESTVERSION=1.0
|
||||
|
||||
BUILT_FILES=
|
||||
|
||||
FILES=$(METADATA) runtest.sh Makefile PURPOSE qat_c3xxx.ko
|
||||
|
||||
.PHONY: all install download clean
|
||||
|
||||
run: $(FILES) build
|
||||
./runtest.sh
|
||||
|
||||
build: $(BUILT_FILES)
|
||||
test -x runtest.sh || chmod a+x runtest.sh
|
||||
|
||||
clean:
|
||||
rm -f *~ $(BUILT_FILES)
|
||||
|
||||
|
||||
include /usr/share/rhts/lib/rhts-make.include
|
||||
|
||||
$(METADATA): Makefile
|
||||
@echo "Owner: Martin Cermak <mcermak@redhat.com>" > $(METADATA)
|
||||
@echo "Name: $(TEST)" >> $(METADATA)
|
||||
@echo "TestVersion: $(TESTVERSION)" >> $(METADATA)
|
||||
@echo "Path: $(TEST_DIR)" >> $(METADATA)
|
||||
@echo "Description: bz1717349-vaguely-related-SEGV" >> $(METADATA)
|
||||
@echo "Type: Regression" >> $(METADATA)
|
||||
@echo "TestTime: 48h" >> $(METADATA)
|
||||
@echo "RunFor: elfutils" >> $(METADATA)
|
||||
@echo "Requires: elfutils" >> $(METADATA)
|
||||
@echo "Priority: Normal" >> $(METADATA)
|
||||
@echo "License: GPLv2+" >> $(METADATA)
|
||||
@echo "Confidential: no" >> $(METADATA)
|
||||
@echo "Destructive: no" >> $(METADATA)
|
||||
@echo "Bug: 1717349" >> $(METADATA)
|
||||
@echo "Releases: -RHEL4 -RHELClient5 -RHELServer5" >> $(METADATA)
|
||||
|
||||
rhts-lint $(METADATA)
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
PURPOSE of /tools/elfutils/Regression/bz1717349-vaguely-related-SEGV
|
||||
Description: bz1717349-vaguely-related-SEGV
|
||||
Author: Martin Cermak <mcermak@redhat.com>
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
summary: bz1717349-vaguely-related-SEGV
|
||||
description: ''
|
||||
contact:
|
||||
- Martin Cermak <mcermak@redhat.com>
|
||||
component:
|
||||
- elfutils
|
||||
test: ./runtest.sh
|
||||
framework: beakerlib
|
||||
recommend:
|
||||
- elfutils
|
||||
duration: 48h
|
||||
extra-summary: /tools/elfutils/Regression/bz1717349-vaguely-related-SEGV
|
||||
extra-task: /tools/elfutils/Regression/bz1717349-vaguely-related-SEGV
|
||||
Binary file not shown.
|
|
@ -1,42 +0,0 @@
|
|||
#!/bin/bash
|
||||
# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# runtest.sh of /tools/elfutils/Regression/bz1717349-vaguely-related-SEGV
|
||||
# Description: bz1717349-vaguely-related-SEGV
|
||||
# Author: Martin Cermak <mcermak@redhat.com>
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# Copyright (c) 2019 Red Hat, Inc.
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License as
|
||||
# published by the Free Software Foundation, either version 2 of
|
||||
# the License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be
|
||||
# useful, but WITHOUT ANY WARRANTY; without even the implied
|
||||
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
# PURPOSE. See the GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see http://www.gnu.org/licenses/.
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
# Include Beaker environment
|
||||
. /usr/share/beakerlib/beakerlib.sh || exit 1
|
||||
|
||||
PACKAGE="elfutils"
|
||||
|
||||
rlJournalStart
|
||||
rlPhaseStartTest
|
||||
# This works with base rhel eu-strip, as well as with various SCL versions of it. Convenience :)
|
||||
rlRun "which eu-strip"
|
||||
rlRun "rpm -qf `which eu-strip`"
|
||||
# Test: SEGV is considered a FAIL (reproduces with elfutils-0.176-4.el8), whereas fixed version exists with 0)
|
||||
rlRun "eu-strip --remove-comment --reloc-debug-sections -f qat_c3xxx.ko.debug qat_c3xxx.ko"
|
||||
rlPhaseEnd
|
||||
rlJournalPrintText
|
||||
rlJournalEnd
|
||||
|
|
@ -1,63 +0,0 @@
|
|||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# Makefile of /tools/elfutils/Regression/bz806474-eu-unstrip-unwilling-to-reassembled-corrupted
|
||||
# Description: Test for BZ#806474 (eu-unstrip unwilling to reassembled corrupted)
|
||||
# Author: Vaclav Kadlcik <vkadlcik@redhat.com>
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# Copyright (c) 2014 Red Hat, Inc.
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License as
|
||||
# published by the Free Software Foundation, either version 2 of
|
||||
# the License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be
|
||||
# useful, but WITHOUT ANY WARRANTY; without even the implied
|
||||
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
# PURPOSE. See the GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see http://www.gnu.org/licenses/.
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
export TEST=/tools/elfutils/Regression/bz806474-eu-unstrip-unwilling-to-reassembled-corrupted
|
||||
export TESTVERSION=1.0
|
||||
|
||||
BUILT_FILES=
|
||||
|
||||
FILES=$(METADATA) runtest.sh Makefile PURPOSE ld.bz2 ld.debug.bz2
|
||||
|
||||
.PHONY: all install download clean
|
||||
|
||||
run: $(FILES) build
|
||||
./runtest.sh
|
||||
|
||||
build: $(BUILT_FILES)
|
||||
test -x runtest.sh || chmod a+x runtest.sh
|
||||
|
||||
clean:
|
||||
rm -f *~ $(BUILT_FILES)
|
||||
|
||||
|
||||
include /usr/share/rhts/lib/rhts-make.include
|
||||
|
||||
$(METADATA): Makefile
|
||||
@echo "Owner: Vaclav Kadlcik <vkadlcik@redhat.com>" > $(METADATA)
|
||||
@echo "Name: $(TEST)" >> $(METADATA)
|
||||
@echo "TestVersion: $(TESTVERSION)" >> $(METADATA)
|
||||
@echo "Path: $(TEST_DIR)" >> $(METADATA)
|
||||
@echo "Description: Test for BZ#806474 (eu-unstrip unwilling to reassembled corrupted)" >> $(METADATA)
|
||||
@echo "Type: Regression" >> $(METADATA)
|
||||
@echo "TestTime: 5m" >> $(METADATA)
|
||||
@echo "RunFor: elfutils" >> $(METADATA)
|
||||
@echo "Requires: elfutils bzip2" >> $(METADATA)
|
||||
@echo "Priority: Normal" >> $(METADATA)
|
||||
@echo "License: GPLv2+" >> $(METADATA)
|
||||
@echo "Confidential: no" >> $(METADATA)
|
||||
@echo "Destructive: no" >> $(METADATA)
|
||||
@echo "Bug: 806474" >> $(METADATA)
|
||||
|
||||
rhts-lint $(METADATA)
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
PURPOSE of /tools/elfutils/Regression/bz806474-eu-unstrip-unwilling-to-reassembled-corrupted
|
||||
Description: Test for BZ#806474 (eu-unstrip unwilling to reassembled corrupted)
|
||||
Author: Vaclav Kadlcik <vkadlcik@redhat.com>
|
||||
Bug summary: eu-unstrip unwilling to reassembled corrupted separate debuginfo
|
||||
Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=806474
|
||||
|
||||
Make sure eu-unstrip can merge (when forced) a stripped binary and a separate
|
||||
debuginfo in spite of the debuginfo was produced by a buggy version of binutils
|
||||
(see BZ#698005). The test is based on Mark Wielaard's suggestion in Bugzilla.
|
||||
Binary file not shown.
Binary file not shown.
|
|
@ -1,20 +0,0 @@
|
|||
summary: Test for BZ#806474 (eu-unstrip unwilling to reassembled corrupted)
|
||||
description: |
|
||||
Bug summary: eu-unstrip unwilling to reassembled corrupted separate debuginfo
|
||||
Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=806474
|
||||
|
||||
Make sure eu-unstrip can merge (when forced) a stripped binary and a separate
|
||||
debuginfo in spite of the debuginfo was produced by a buggy version of binutils
|
||||
(see BZ#698005). The test is based on Mark Wielaard's suggestion in Bugzilla.
|
||||
contact:
|
||||
- Vaclav Kadlcik <vkadlcik@redhat.com>
|
||||
component:
|
||||
- elfutils
|
||||
test: ./runtest.sh
|
||||
framework: beakerlib
|
||||
recommend:
|
||||
- elfutils
|
||||
- bzip2
|
||||
duration: 5m
|
||||
extra-summary: /tools/elfutils/Regression/bz806474-eu-unstrip-unwilling-to-reassembled-corrupted
|
||||
extra-task: /tools/elfutils/Regression/bz806474-eu-unstrip-unwilling-to-reassembled-corrupted
|
||||
|
|
@ -1,74 +0,0 @@
|
|||
#!/bin/bash
|
||||
# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# runtest.sh of /tools/elfutils/Regression/bz806474-eu-unstrip-unwilling-to-reassembled-corrupted
|
||||
# Description: Test for BZ#806474 (eu-unstrip unwilling to reassembled corrupted)
|
||||
# Author: Vaclav Kadlcik <vkadlcik@redhat.com>
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# Copyright (c) 2014 Red Hat, Inc.
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License as
|
||||
# published by the Free Software Foundation, either version 2 of
|
||||
# the License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be
|
||||
# useful, but WITHOUT ANY WARRANTY; without even the implied
|
||||
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
# PURPOSE. See the GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see http://www.gnu.org/licenses/.
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
# Include Beaker environment
|
||||
. /usr/share/beakerlib/beakerlib.sh || exit 1
|
||||
|
||||
PACKAGE="elfutils"
|
||||
|
||||
TEST_STRIPPED='ld' # see PURPOSE, BZ#806474, and 698005
|
||||
TEST_DEBUGIFO='ld.debug' # ditto
|
||||
TEST_MERGED='ld-debug'
|
||||
|
||||
rlJournalStart
|
||||
rlPhaseStartSetup
|
||||
rlAssertRpm $PACKAGE
|
||||
rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory"
|
||||
rlRun "cp ${TEST_STRIPPED}.bz2 ${TEST_DEBUGIFO}.bz2 $TmpDir" 0 "Copying test files"
|
||||
rlRun "pushd $TmpDir"
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartTest
|
||||
|
||||
rlRun "bunzip2 ${TEST_STRIPPED}.bz2" 0
|
||||
rlRun "bunzip2 ${TEST_DEBUGIFO}.bz2" 0
|
||||
rlAssertExists "$TEST_STRIPPED"
|
||||
rlAssertExists "$TEST_DEBUGIFO"
|
||||
|
||||
rlRun -t -s "eu-unstrip -o $TEST_MERGED $TEST_STRIPPED $TEST_DEBUGIFO" 1 'unstrip with corrupted debuginfo'
|
||||
rlAssertNotExists "$TEST_MERGED"
|
||||
rlAssertGrep '^STDERR:.*ELF header identification.*different, use --force' "$rlRun_LOG"
|
||||
|
||||
rlRun -t -s "eu-unstrip --force -o $TEST_MERGED $TEST_STRIPPED $TEST_DEBUGIFO" 0 'Forced unstrip with corrupted debuginfo'
|
||||
rlAssertExists "$TEST_MERGED"
|
||||
rlAssertGrep '^STDERR:.*WARNING:.*ELF header identification.*different' "$rlRun_LOG"
|
||||
|
||||
rlRun -t -s "file $TEST_MERGED" 0 'Detecting type of merged file'
|
||||
rlAssertGrep '^STDOUT:.*not stripped$' "$rlRun_LOG"
|
||||
|
||||
rlRun -s "eu-objdump -s $TEST_MERGED" 0 'Running objdump on merged file'
|
||||
rlAssertGrep '^Contents of section .debug_info:' "$rlRun_LOG"
|
||||
rlAssertGrep '^Contents of section .debug_line:' "$rlRun_LOG"
|
||||
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartCleanup
|
||||
rlRun "popd"
|
||||
rlRun "rm -r $TmpDir" 0 "Removing tmp directory"
|
||||
rlPhaseEnd
|
||||
rlJournalPrintText
|
||||
rlJournalEnd
|
||||
|
|
@ -1,64 +0,0 @@
|
|||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# Makefile of /tools/elfutils/Regression/bz917874-RHDT-Assertion-failure-in-eu-addr2line
|
||||
# Description: Test for BZ#917874 ([RHDT] Assertion failure in eu-addr2line)
|
||||
# Author: Dagmar Prokopova <dprokopo@redhat.com>
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# Copyright (c) 2013 Red Hat, Inc. All rights reserved.
|
||||
#
|
||||
# This copyrighted material is made available to anyone wishing
|
||||
# to use, modify, copy, or redistribute it subject to the terms
|
||||
# and conditions of the GNU General Public License version 2.
|
||||
#
|
||||
# This program is distributed in the hope that it will be
|
||||
# useful, but WITHOUT ANY WARRANTY; without even the implied
|
||||
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
# PURPOSE. See the GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public
|
||||
# License along with this program; if not, write to the Free
|
||||
# Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
# Boston, MA 02110-1301, USA.
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
export TEST=/tools/elfutils/Regression/bz917874-RHDT-Assertion-failure-in-eu-addr2line
|
||||
export TESTVERSION=1.0
|
||||
|
||||
BUILT_FILES=
|
||||
|
||||
FILES=$(METADATA) runtest.sh Makefile PURPOSE a.out
|
||||
|
||||
.PHONY: all install download clean
|
||||
|
||||
run: $(FILES) build
|
||||
./runtest.sh
|
||||
|
||||
build: $(BUILT_FILES)
|
||||
test -x runtest.sh || chmod a+x runtest.sh
|
||||
|
||||
clean:
|
||||
rm -f *~ $(BUILT_FILES)
|
||||
|
||||
|
||||
include /usr/share/rhts/lib/rhts-make.include
|
||||
|
||||
$(METADATA): Makefile
|
||||
@echo "Owner: Dagmar Prokopova <dprokopo@redhat.com>" > $(METADATA)
|
||||
@echo "Name: $(TEST)" >> $(METADATA)
|
||||
@echo "TestVersion: $(TESTVERSION)" >> $(METADATA)
|
||||
@echo "Path: $(TEST_DIR)" >> $(METADATA)
|
||||
@echo "Description: Test for BZ#917874 ([RHDT] Assertion failure in eu-addr2line)" >> $(METADATA)
|
||||
@echo "Type: Regression" >> $(METADATA)
|
||||
@echo "TestTime: 5m" >> $(METADATA)
|
||||
@echo "RunFor: elfutils" >> $(METADATA)
|
||||
@echo "Requires: elfutils" >> $(METADATA)
|
||||
@echo "Priority: Normal" >> $(METADATA)
|
||||
@echo "License: GPLv2" >> $(METADATA)
|
||||
@echo "Confidential: no" >> $(METADATA)
|
||||
@echo "Destructive: no" >> $(METADATA)
|
||||
@echo "Bug: 917874" >> $(METADATA)
|
||||
|
||||
rhts-lint $(METADATA)
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
PURPOSE of /tools/elfutils/Regression/bz917874-RHDT-Assertion-failure-in-eu-addr2line
|
||||
Description: Test for BZ#917874 ([RHDT] Assertion failure in eu-addr2line)
|
||||
Author: Dagmar Prokopova <dprokopo@redhat.com>
|
||||
Bug summary: [RHDT] Assertion failure in eu-addr2line
|
||||
Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=917874
|
||||
Binary file not shown.
|
|
@ -1,15 +0,0 @@
|
|||
summary: Test for BZ#917874 ([RHDT] Assertion failure in eu-addr2line)
|
||||
description: |
|
||||
Bug summary: [RHDT] Assertion failure in eu-addr2line
|
||||
Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=917874
|
||||
contact:
|
||||
- Dagmar Prokopova <dprokopo@redhat.com>
|
||||
component:
|
||||
- elfutils
|
||||
test: ./runtest.sh
|
||||
framework: beakerlib
|
||||
recommend:
|
||||
- elfutils
|
||||
duration: 5m
|
||||
extra-summary: /tools/elfutils/Regression/bz917874-RHDT-Assertion-failure-in-eu-addr2line
|
||||
extra-task: /tools/elfutils/Regression/bz917874-RHDT-Assertion-failure-in-eu-addr2line
|
||||
|
|
@ -1,60 +0,0 @@
|
|||
#!/bin/bash
|
||||
# vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# runtest.sh of /tools/elfutils/Regression/bz917874-RHDT-Assertion-failure-in-eu-addr2line
|
||||
# Description: Test for BZ#917874 ([RHDT] Assertion failure in eu-addr2line)
|
||||
# Author: Dagmar Prokopova <dprokopo@redhat.com>
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# Copyright (c) 2013 Red Hat, Inc. All rights reserved.
|
||||
#
|
||||
# This copyrighted material is made available to anyone wishing
|
||||
# to use, modify, copy, or redistribute it subject to the terms
|
||||
# and conditions of the GNU General Public License version 2.
|
||||
#
|
||||
# This program is distributed in the hope that it will be
|
||||
# useful, but WITHOUT ANY WARRANTY; without even the implied
|
||||
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
# PURPOSE. See the GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public
|
||||
# License along with this program; if not, write to the Free
|
||||
# Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
# Boston, MA 02110-1301, USA.
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
# Include Beaker environment
|
||||
. /usr/share/beakerlib/beakerlib.sh || exit 1
|
||||
|
||||
# This was fixed in devtoolset-2-elfutils-0.155-6.
|
||||
|
||||
PACKAGES=(elfutils)
|
||||
|
||||
rlJournalStart
|
||||
rlPhaseStartSetup
|
||||
for p in "${PACKAGES[@]}"; do
|
||||
rlAssertRpm "$p" || yum -y install "$p"
|
||||
done; unset p
|
||||
|
||||
rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory"
|
||||
|
||||
# We need the reproducer.
|
||||
cp -v a.out $TmpDir
|
||||
|
||||
rlRun "pushd $TmpDir"
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartTest
|
||||
# This should succeed without assertion fail.
|
||||
rlRun "eu-addr2line -e a.out 0x400589" 0
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartCleanup
|
||||
rlRun "popd"
|
||||
rlRun "rm -r $TmpDir" 0 "Removing tmp directory"
|
||||
rlPhaseEnd
|
||||
rlJournalPrintText
|
||||
rlJournalEnd
|
||||
|
|
@ -1,64 +0,0 @@
|
|||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# Makefile of /tools/elfutils/Regression/bz927626-RHDT-Stack-overflow-in-dwarf-getsrclines
|
||||
# Description: Test for BZ#927626 ([RHDT] Stack overflow in dwarf_getsrclines)
|
||||
# Author: Dagmar Prokopova <dprokopo@redhat.com>
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# Copyright (c) 2013 Red Hat, Inc. All rights reserved.
|
||||
#
|
||||
# This copyrighted material is made available to anyone wishing
|
||||
# to use, modify, copy, or redistribute it subject to the terms
|
||||
# and conditions of the GNU General Public License version 2.
|
||||
#
|
||||
# This program is distributed in the hope that it will be
|
||||
# useful, but WITHOUT ANY WARRANTY; without even the implied
|
||||
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
# PURPOSE. See the GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public
|
||||
# License along with this program; if not, write to the Free
|
||||
# Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
# Boston, MA 02110-1301, USA.
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
export TEST=/tools/elfutils/Regression/bz927626-RHDT-Stack-overflow-in-dwarf-getsrclines
|
||||
export TESTVERSION=1.0
|
||||
|
||||
BUILT_FILES=
|
||||
|
||||
FILES=$(METADATA) runtest.sh Makefile PURPOSE vpoolengineUS.bz2
|
||||
|
||||
.PHONY: all install download clean
|
||||
|
||||
run: $(FILES) build
|
||||
./runtest.sh
|
||||
|
||||
build: $(BUILT_FILES)
|
||||
test -x runtest.sh || chmod a+x runtest.sh
|
||||
|
||||
clean:
|
||||
rm -f *~ $(BUILT_FILES)
|
||||
|
||||
|
||||
include /usr/share/rhts/lib/rhts-make.include
|
||||
|
||||
$(METADATA): Makefile
|
||||
@echo "Owner: Dagmar Prokopova <dprokopo@redhat.com>" > $(METADATA)
|
||||
@echo "Name: $(TEST)" >> $(METADATA)
|
||||
@echo "TestVersion: $(TESTVERSION)" >> $(METADATA)
|
||||
@echo "Path: $(TEST_DIR)" >> $(METADATA)
|
||||
@echo "Description: Test for BZ#927626 ([RHDT] Stack overflow in dwarf_getsrclines)" >> $(METADATA)
|
||||
@echo "Type: Regression" >> $(METADATA)
|
||||
@echo "TestTime: 30m" >> $(METADATA)
|
||||
@echo "RunFor: elfutils" >> $(METADATA)
|
||||
@echo "Requires: elfutils bzip2 gcc" >> $(METADATA)
|
||||
@echo "Priority: Normal" >> $(METADATA)
|
||||
@echo "License: GPLv2" >> $(METADATA)
|
||||
@echo "Confidential: no" >> $(METADATA)
|
||||
@echo "Destructive: no" >> $(METADATA)
|
||||
@echo "Bug: 927626" >> $(METADATA)
|
||||
|
||||
rhts-lint $(METADATA)
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
PURPOSE of /tools/elfutils/Regression/bz927626-RHDT-Stack-overflow-in-dwarf-getsrclines
|
||||
Description: Test for BZ#927626 ([RHDT] Stack overflow in dwarf_getsrclines)
|
||||
Author: Dagmar Prokopova <dprokopo@redhat.com>
|
||||
Bug summary: [RHDT] Stack overflow in dwarf_getsrclines
|
||||
Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=927626
|
||||
|
|
@ -1,17 +0,0 @@
|
|||
summary: Test for BZ#927626 ([RHDT] Stack overflow in dwarf_getsrclines)
|
||||
description: |
|
||||
Bug summary: [RHDT] Stack overflow in dwarf_getsrclines
|
||||
Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=927626
|
||||
contact:
|
||||
- Dagmar Prokopova <dprokopo@redhat.com>
|
||||
component:
|
||||
- elfutils
|
||||
test: ./runtest.sh
|
||||
framework: beakerlib
|
||||
recommend:
|
||||
- elfutils
|
||||
- bzip2
|
||||
- gcc
|
||||
duration: 30m
|
||||
extra-summary: /tools/elfutils/Regression/bz927626-RHDT-Stack-overflow-in-dwarf-getsrclines
|
||||
extra-task: /tools/elfutils/Regression/bz927626-RHDT-Stack-overflow-in-dwarf-getsrclines
|
||||
|
|
@ -1,56 +0,0 @@
|
|||
#!/bin/bash
|
||||
# vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# runtest.sh of /tools/elfutils/Regression/bz927626-RHDT-Stack-overflow-in-dwarf-getsrclines
|
||||
# Description: Test for BZ#927626 ([RHDT] Stack overflow in dwarf_getsrclines)
|
||||
# Author: Dagmar Prokopova <dprokopo@redhat.com>
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# Copyright (c) 2013 Red Hat, Inc. All rights reserved.
|
||||
#
|
||||
# This copyrighted material is made available to anyone wishing
|
||||
# to use, modify, copy, or redistribute it subject to the terms
|
||||
# and conditions of the GNU General Public License version 2.
|
||||
#
|
||||
# This program is distributed in the hope that it will be
|
||||
# useful, but WITHOUT ANY WARRANTY; without even the implied
|
||||
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
# PURPOSE. See the GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public
|
||||
# License along with this program; if not, write to the Free
|
||||
# Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
# Boston, MA 02110-1301, USA.
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
# Include Beaker environment
|
||||
. /usr/share/beakerlib/beakerlib.sh || exit 1
|
||||
|
||||
# This was fixed in elfutils-0.155-7.
|
||||
|
||||
PACKAGE="elfutils"
|
||||
|
||||
rlJournalStart
|
||||
rlPhaseStartSetup
|
||||
rlAssertRpm $PACKAGE
|
||||
rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory"
|
||||
# We need the reproducer.
|
||||
cp -v vpoolengineUS.bz2 $TmpDir
|
||||
rlRun "pushd $TmpDir"
|
||||
rlRun "bunzip2 vpoolengineUS.bz2"
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartTest
|
||||
# No segfault should appear.
|
||||
rlRun "eu-addr2line -e vpoolengineUS 0x6682f7" 0
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartCleanup
|
||||
rlRun "popd"
|
||||
rlRun "rm -r $TmpDir" 0 "Removing tmp directory"
|
||||
rlPhaseEnd
|
||||
rlJournalPrintText
|
||||
rlJournalEnd
|
||||
Binary file not shown.
|
|
@ -1,64 +0,0 @@
|
|||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# Makefile of /tools/elfutils/Regression/bz967130-RHDT-eu-unstrip-M-abort-on-socket-line
|
||||
# Description: Test for BZ#967130 ([RHDT] eu-unstrip -M abort on socket line)
|
||||
# Author: Dagmar Prokopova <dprokopo@redhat.com>
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# Copyright (c) 2013 Red Hat, Inc. All rights reserved.
|
||||
#
|
||||
# This copyrighted material is made available to anyone wishing
|
||||
# to use, modify, copy, or redistribute it subject to the terms
|
||||
# and conditions of the GNU General Public License version 2.
|
||||
#
|
||||
# This program is distributed in the hope that it will be
|
||||
# useful, but WITHOUT ANY WARRANTY; without even the implied
|
||||
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
# PURPOSE. See the GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public
|
||||
# License along with this program; if not, write to the Free
|
||||
# Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
# Boston, MA 02110-1301, USA.
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
export TEST=/tools/elfutils/Regression/bz967130-RHDT-eu-unstrip-M-abort-on-socket-line
|
||||
export TESTVERSION=1.0
|
||||
|
||||
BUILT_FILES=
|
||||
|
||||
FILES=$(METADATA) runtest.sh Makefile PURPOSE proc_maps.txt
|
||||
|
||||
.PHONY: all install download clean
|
||||
|
||||
run: $(FILES) build
|
||||
./runtest.sh
|
||||
|
||||
build: $(BUILT_FILES)
|
||||
test -x runtest.sh || chmod a+x runtest.sh
|
||||
|
||||
clean:
|
||||
rm -f *~ $(BUILT_FILES)
|
||||
|
||||
|
||||
include /usr/share/rhts/lib/rhts-make.include
|
||||
|
||||
$(METADATA): Makefile
|
||||
@echo "Owner: Dagmar Prokopova <dprokopo@redhat.com>" > $(METADATA)
|
||||
@echo "Name: $(TEST)" >> $(METADATA)
|
||||
@echo "TestVersion: $(TESTVERSION)" >> $(METADATA)
|
||||
@echo "Path: $(TEST_DIR)" >> $(METADATA)
|
||||
@echo "Description: Test for BZ#967130 ([RHDT] eu-unstrip -M abort on socket line)" >> $(METADATA)
|
||||
@echo "Type: Regression" >> $(METADATA)
|
||||
@echo "TestTime: 5m" >> $(METADATA)
|
||||
@echo "RunFor: elfutils" >> $(METADATA)
|
||||
@echo "Requires: elfutils" >> $(METADATA)
|
||||
@echo "Priority: Normal" >> $(METADATA)
|
||||
@echo "License: GPLv2" >> $(METADATA)
|
||||
@echo "Confidential: no" >> $(METADATA)
|
||||
@echo "Destructive: no" >> $(METADATA)
|
||||
@echo "Bug: 967130" >> $(METADATA)
|
||||
|
||||
rhts-lint $(METADATA)
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
PURPOSE of /tools/elfutils/Regression/bz967130-RHDT-eu-unstrip-M-abort-on-socket-line
|
||||
Description: Test for BZ#967130 ([RHDT] eu-unstrip -M abort on socket line)
|
||||
Author: Dagmar Prokopova <dprokopo@redhat.com>
|
||||
Bug summary: [RHDT] eu-unstrip -M abort on socket: line
|
||||
Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=967130
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
summary: Test for BZ#967130 ([RHDT] eu-unstrip -M abort on socket line)
|
||||
description: |
|
||||
Bug summary: [RHDT] eu-unstrip -M abort on socket: line
|
||||
Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=967130
|
||||
contact:
|
||||
- Dagmar Prokopova <dprokopo@redhat.com>
|
||||
component:
|
||||
- elfutils
|
||||
test: ./runtest.sh
|
||||
framework: beakerlib
|
||||
recommend:
|
||||
- elfutils
|
||||
duration: 5m
|
||||
extra-summary: /tools/elfutils/Regression/bz967130-RHDT-eu-unstrip-M-abort-on-socket-line
|
||||
extra-task: /tools/elfutils/Regression/bz967130-RHDT-eu-unstrip-M-abort-on-socket-line
|
||||
|
|
@ -1,82 +0,0 @@
|
|||
00400000-024aa000 r-xp 00000000 08:02 159659 /opt/MessageRouter/bin/msgrouter_dbg
|
||||
026aa000-026b2000 rwxp 020aa000 08:02 159659 /opt/MessageRouter/bin/msgrouter_dbg
|
||||
026b2000-026bf000 rwxp 00000000 00:00 0
|
||||
0335a000-03e6f000 rwxp 00000000 00:00 0 [heap]
|
||||
2b7b2d6fa000-2b7b2d71a000 r-xp 00000000 08:02 128802 /lib64/ld-2.12.so
|
||||
2b7b2d71a000-2b7b2d89c000 rwxp 00000000 00:00 0
|
||||
2b7b2d919000-2b7b2d91a000 r-xp 0001f000 08:02 128802 /lib64/ld-2.12.so
|
||||
2b7b2d91a000-2b7b2d91b000 rwxp 00020000 08:02 128802 /lib64/ld-2.12.so
|
||||
2b7b2d91b000-2b7b2d91c000 rwxp 00000000 00:00 0
|
||||
2b7b2d91c000-2b7b2d933000 r-xp 00000000 08:02 128833 /lib64/libpthread-2.12.so
|
||||
2b7b2d933000-2b7b2db32000 ---p 00017000 08:02 128833 /lib64/libpthread-2.12.so
|
||||
2b7b2db32000-2b7b2db33000 r-xp 00016000 08:02 128833 /lib64/libpthread-2.12.so
|
||||
2b7b2db33000-2b7b2db34000 rwxp 00017000 08:02 128833 /lib64/libpthread-2.12.so
|
||||
2b7b2db34000-2b7b2db39000 rwxp 00000000 00:00 0
|
||||
2b7b2db39000-2b7b2db40000 r-xp 00000000 08:02 128837 /lib64/librt-2.12.so
|
||||
2b7b2db40000-2b7b2dd3f000 ---p 00007000 08:02 128837 /lib64/librt-2.12.so
|
||||
2b7b2dd3f000-2b7b2dd40000 r-xp 00006000 08:02 128837 /lib64/librt-2.12.so
|
||||
2b7b2dd40000-2b7b2dd41000 rwxp 00007000 08:02 128837 /lib64/librt-2.12.so
|
||||
2b7b2dd41000-2b7b2dd43000 r-xp 00000000 08:02 128815 /lib64/libdl-2.12.so
|
||||
2b7b2dd43000-2b7b2df43000 ---p 00002000 08:02 128815 /lib64/libdl-2.12.so
|
||||
2b7b2df43000-2b7b2df44000 r-xp 00002000 08:02 128815 /lib64/libdl-2.12.so
|
||||
2b7b2df44000-2b7b2df45000 rwxp 00003000 08:02 128815 /lib64/libdl-2.12.so
|
||||
2b7b2df45000-2b7b2e032000 r-xp 00000000 08:02 276647 /usr/lib64/libboost_regex.so.5
|
||||
2b7b2e032000-2b7b2e232000 ---p 000ed000 08:02 276647 /usr/lib64/libboost_regex.so.5
|
||||
2b7b2e232000-2b7b2e239000 rwxp 000ed000 08:02 276647 /usr/lib64/libboost_regex.so.5
|
||||
2b7b2e239000-2b7b2e23a000 rwxp 00000000 00:00 0
|
||||
2b7b2e23a000-2b7b2e322000 r-xp 00000000 08:02 260385 /usr/lib64/libstdc++.so.6.0.13
|
||||
2b7b2e322000-2b7b2e522000 ---p 000e8000 08:02 260385 /usr/lib64/libstdc++.so.6.0.13
|
||||
2b7b2e522000-2b7b2e529000 r-xp 000e8000 08:02 260385 /usr/lib64/libstdc++.so.6.0.13
|
||||
2b7b2e529000-2b7b2e52b000 rwxp 000ef000 08:02 260385 /usr/lib64/libstdc++.so.6.0.13
|
||||
2b7b2e52b000-2b7b2e540000 rwxp 00000000 00:00 0
|
||||
2b7b2e540000-2b7b2e5c3000 r-xp 00000000 08:02 128817 /lib64/libm-2.12.so
|
||||
2b7b2e5c3000-2b7b2e7c2000 ---p 00083000 08:02 128817 /lib64/libm-2.12.so
|
||||
2b7b2e7c2000-2b7b2e7c3000 r-xp 00082000 08:02 128817 /lib64/libm-2.12.so
|
||||
2b7b2e7c3000-2b7b2e7c4000 rwxp 00083000 08:02 128817 /lib64/libm-2.12.so
|
||||
2b7b2e7c4000-2b7b2e7da000 r-xp 00000000 08:02 136724 /lib64/libgcc_s-4.4.6-20110824.so.1
|
||||
2b7b2e7da000-2b7b2e9d9000 ---p 00016000 08:02 136724 /lib64/libgcc_s-4.4.6-20110824.so.1
|
||||
2b7b2e9d9000-2b7b2e9da000 rwxp 00015000 08:02 136724 /lib64/libgcc_s-4.4.6-20110824.so.1
|
||||
2b7b2e9da000-2b7b2e9db000 rwxp 00000000 00:00 0
|
||||
2b7b2e9db000-2b7b2eb72000 r-xp 00000000 08:02 128809 /lib64/libc-2.12.so
|
||||
2b7b2eb72000-2b7b2ed72000 ---p 00197000 08:02 128809 /lib64/libc-2.12.so
|
||||
2b7b2ed72000-2b7b2ed76000 r-xp 00197000 08:02 128809 /lib64/libc-2.12.so
|
||||
2b7b2ed76000-2b7b2ed77000 rwxp 0019b000 08:02 128809 /lib64/libc-2.12.so
|
||||
2b7b2ed77000-2b7b2ed7c000 rwxp 00000000 00:00 0
|
||||
2b7b2ed7c000-2b7b2eebb000 r-xp 00000000 08:02 276645 /usr/lib64/libicuuc.so.42.1
|
||||
2b7b2eebb000-2b7b2f0bb000 ---p 0013f000 08:02 276645 /usr/lib64/libicuuc.so.42.1
|
||||
2b7b2f0bb000-2b7b2f0cc000 rwxp 0013f000 08:02 276645 /usr/lib64/libicuuc.so.42.1
|
||||
2b7b2f0cc000-2b7b2f0ce000 rwxp 00000000 00:00 0
|
||||
2b7b2f0ce000-2b7b2f256000 r-xp 00000000 08:02 276635 /usr/lib64/libicui18n.so.42.1
|
||||
2b7b2f256000-2b7b2f456000 ---p 00188000 08:02 276635 /usr/lib64/libicui18n.so.42.1
|
||||
2b7b2f456000-2b7b2f463000 rwxp 00188000 08:02 276635 /usr/lib64/libicui18n.so.42.1
|
||||
2b7b2f463000-2b7b2f465000 rwxp 00000000 00:00 0
|
||||
2b7b2f465000-2b7b303aa000 r-xp 00000000 08:02 276633 /usr/lib64/libicudata.so.42.1
|
||||
2b7b303aa000-2b7b305a9000 ---p 00f45000 08:02 276633 /usr/lib64/libicudata.so.42.1
|
||||
2b7b305a9000-2b7b305aa000 rwxp 00f44000 08:02 276633 /usr/lib64/libicudata.so.42.1
|
||||
2b7b305aa000-2b7b313f5000 rwxp 00000000 00:00 0
|
||||
2b7b313f5000-2b7b313f6000 ---p 00000000 00:00 0
|
||||
2b7b313f6000-2b7b31df6000 rwxp 00000000 00:00 0
|
||||
2b7b31df6000-2b7b31df7000 ---p 00000000 00:00 0
|
||||
2b7b31df7000-2b7b327f7000 rwxp 00000000 00:00 0
|
||||
2b7b34000000-2b7b34021000 rwxp 00000000 00:00 0
|
||||
2b7b34021000-2b7b38000000 ---p 00000000 00:00 0
|
||||
2b7b38000000-2b7b38282000 rwxp 00000000 00:00 0
|
||||
2b7b38282000-2b7b38302000 rwxs 00000000 00:06 493872 socket:[493872]
|
||||
2b7b38302000-2b7b38312000 rwxs 00000000 00:06 493872 socket:[493872]
|
||||
2b7b38312000-2b7b38b12000 r-xs 00000000 00:06 493872 socket:[493872]
|
||||
2b7b38b12000-2b7b38b22000 rwxs 00000000 00:06 493872 socket:[493872]
|
||||
2b7b38b22000-2b7b39322000 rwxs 00000000 00:06 493872 socket:[493872]
|
||||
2b7b39322000-2b7b39323000 ---p 00000000 00:00 0
|
||||
2b7b39323000-2b7b39d23000 rwxp 00000000 00:00 0
|
||||
2b7b3c000000-2b7b3c021000 rwxp 00000000 00:00 0
|
||||
2b7b3c021000-2b7b40000000 ---p 00000000 00:00 0
|
||||
2b7b40000000-2b7b40021000 rwxp 00000000 00:00 0
|
||||
2b7b40021000-2b7b44000000 ---p 00000000 00:00 0
|
||||
2b7b44010000-2b7b4401c000 r-xp 00000000 08:02 128825 /lib64/libnss_files-2.12.so
|
||||
2b7b4401c000-2b7b4421c000 ---p 0000c000 08:02 128825 /lib64/libnss_files-2.12.so
|
||||
2b7b4421c000-2b7b4421d000 r-xp 0000c000 08:02 128825 /lib64/libnss_files-2.12.so
|
||||
2b7b4421d000-2b7b4421e000 rwxp 0000d000 08:02 128825 /lib64/libnss_files-2.12.so
|
||||
2b7b4439f000-2b7b45ea1000 rwxp 00000000 00:00 0
|
||||
7fff26cf7000-7fff26d0c000 rwxp 00000000 00:00 0 [stack]
|
||||
7fff26dff000-7fff26e00000 r-xp 00000000 00:00 0 [vdso]
|
||||
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0 [vsyscall]
|
||||
|
|
@ -1,53 +0,0 @@
|
|||
#!/bin/bash
|
||||
# vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# runtest.sh of /tools/elfutils/Regression/bz967130-RHDT-eu-unstrip-M-abort-on-socket-line
|
||||
# Description: Test for BZ#967130 ([RHDT] eu-unstrip -M abort on socket line)
|
||||
# Author: Dagmar Prokopova <dprokopo@redhat.com>
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# Copyright (c) 2013 Red Hat, Inc. All rights reserved.
|
||||
#
|
||||
# This copyrighted material is made available to anyone wishing
|
||||
# to use, modify, copy, or redistribute it subject to the terms
|
||||
# and conditions of the GNU General Public License version 2.
|
||||
#
|
||||
# This program is distributed in the hope that it will be
|
||||
# useful, but WITHOUT ANY WARRANTY; without even the implied
|
||||
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
# PURPOSE. See the GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public
|
||||
# License along with this program; if not, write to the Free
|
||||
# Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
# Boston, MA 02110-1301, USA.
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
# Include Beaker environment
|
||||
. /usr/share/beakerlib/beakerlib.sh || exit 1
|
||||
|
||||
PACKAGE="elfutils"
|
||||
|
||||
rlJournalStart
|
||||
rlPhaseStartSetup
|
||||
rlAssertRpm $PACKAGE
|
||||
rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory"
|
||||
# We need a reproducer.
|
||||
cp -v proc_maps.txt $TmpDir
|
||||
rlRun "pushd $TmpDir"
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartTest
|
||||
#No Abort here.
|
||||
rlRun "eu-unstrip -n -M proc_maps.txt " 0
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartCleanup
|
||||
rlRun "popd"
|
||||
rlRun "rm -r $TmpDir" 0 "Removing tmp directory"
|
||||
rlPhaseEnd
|
||||
rlJournalPrintText
|
||||
rlJournalEnd
|
||||
|
|
@ -1,64 +0,0 @@
|
|||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# Makefile of /tools/elfutils/Regression/elfutils-segmentation-fault-in-elf64-xlatetom-in
|
||||
# Description: elfutils-segmentation-fault-in-elf64-xlatetom-in
|
||||
# Author: Martin Cermak <mcermak@redhat.com>
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# Copyright (c) 2019 Red Hat, Inc.
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License as
|
||||
# published by the Free Software Foundation, either version 2 of
|
||||
# the License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be
|
||||
# useful, but WITHOUT ANY WARRANTY; without even the implied
|
||||
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
# PURPOSE. See the GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see http://www.gnu.org/licenses/.
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
export TEST=/tools/elfutils/Regression/elfutils-segmentation-fault-in-elf64-xlatetom-in
|
||||
export TESTVERSION=1.0
|
||||
|
||||
BUILT_FILES=
|
||||
|
||||
FILES=$(METADATA) runtest.sh Makefile PURPOSE POC2
|
||||
|
||||
.PHONY: all install download clean
|
||||
|
||||
run: $(FILES) build
|
||||
./runtest.sh
|
||||
|
||||
build: $(BUILT_FILES)
|
||||
test -x runtest.sh || chmod a+x runtest.sh
|
||||
|
||||
clean:
|
||||
rm -f *~ $(BUILT_FILES)
|
||||
|
||||
|
||||
include /usr/share/rhts/lib/rhts-make.include
|
||||
|
||||
$(METADATA): Makefile
|
||||
@echo "Owner: Martin Cermak <mcermak@redhat.com>" > $(METADATA)
|
||||
@echo "Name: $(TEST)" >> $(METADATA)
|
||||
@echo "TestVersion: $(TESTVERSION)" >> $(METADATA)
|
||||
@echo "Path: $(TEST_DIR)" >> $(METADATA)
|
||||
@echo "Description: elfutils-segmentation-fault-in-elf64-xlatetom-in" >> $(METADATA)
|
||||
@echo "Type: Regression" >> $(METADATA)
|
||||
@echo "TestTime: 48h" >> $(METADATA)
|
||||
@echo "RunFor: elfutils" >> $(METADATA)
|
||||
@echo "Requires: elfutils" >> $(METADATA)
|
||||
@echo "Priority: Normal" >> $(METADATA)
|
||||
@echo "License: GPLv2+" >> $(METADATA)
|
||||
@echo "Confidential: no" >> $(METADATA)
|
||||
@echo "Destructive: no" >> $(METADATA)
|
||||
@echo "Bug: 1680048" >> $(METADATA)
|
||||
@echo "Releases: -RHEL4 -RHELClient5 -RHELServer5" >> $(METADATA)
|
||||
|
||||
rhts-lint $(METADATA)
|
||||
Binary file not shown.
|
|
@ -1,5 +0,0 @@
|
|||
PURPOSE of /tools/elfutils/Regression/elfutils-segmentation-fault-in-elf64-xlatetom-in
|
||||
Description: elfutils-segmentation-fault-in-elf64-xlatetom-in
|
||||
Author: Martin Cermak <mcermak@redhat.com>
|
||||
Bug summary: elfutils: segmentation fault in elf64_xlatetom in libelf/elf32_xlatetom.c [rhdts-8]
|
||||
Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1680048
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
summary: elfutils-segmentation-fault-in-elf64-xlatetom-in
|
||||
description: |
|
||||
Bug summary: elfutils: segmentation fault in elf64_xlatetom in libelf/elf32_xlatetom.c [rhdts-8]
|
||||
Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1680048
|
||||
contact:
|
||||
- Martin Cermak <mcermak@redhat.com>
|
||||
component:
|
||||
- elfutils
|
||||
test: ./runtest.sh
|
||||
framework: beakerlib
|
||||
recommend:
|
||||
- elfutils
|
||||
duration: 48h
|
||||
extra-summary: /tools/elfutils/Regression/elfutils-segmentation-fault-in-elf64-xlatetom-in
|
||||
extra-task: /tools/elfutils/Regression/elfutils-segmentation-fault-in-elf64-xlatetom-in
|
||||
|
|
@ -1,39 +0,0 @@
|
|||
#!/bin/bash
|
||||
# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# runtest.sh of /tools/elfutils/Regression/elfutils-segmentation-fault-in-elf64-xlatetom-in
|
||||
# Description: elfutils-segmentation-fault-in-elf64-xlatetom-in
|
||||
# Author: Martin Cermak <mcermak@redhat.com>
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# Copyright (c) 2019 Red Hat, Inc.
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License as
|
||||
# published by the Free Software Foundation, either version 2 of
|
||||
# the License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be
|
||||
# useful, but WITHOUT ANY WARRANTY; without even the implied
|
||||
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
# PURPOSE. See the GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see http://www.gnu.org/licenses/.
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
# Include Beaker environment
|
||||
. /usr/share/beakerlib/beakerlib.sh || exit 1
|
||||
|
||||
PACKAGE="elfutils"
|
||||
|
||||
rlJournalStart
|
||||
rlPhaseStartTest
|
||||
# failure is 139 - SEGV, 2 is okay
|
||||
rlRun "eu-stack --core=POC2" 2
|
||||
rlPhaseEnd
|
||||
rlJournalPrintText
|
||||
rlJournalEnd
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
int main()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
summary: eu-elfcompress-breaks-hard-links
|
||||
description: ''
|
||||
link:
|
||||
- relates: https://bugzilla.redhat.com/show_bug.cgi?id=2188064
|
||||
contact: Martin Cermak <mcermak@redhat.com>
|
||||
component:
|
||||
- elfutils
|
||||
test: ./runtest.sh
|
||||
framework: beakerlib
|
||||
recommend:
|
||||
- elfutils
|
||||
- gcc
|
||||
duration: 1h
|
||||
extra-summary: /tools/elfutils/Regression/eu-elfcompress-breaks-hard-links
|
||||
extra-task: /tools/elfutils/Regression/eu-elfcompress-breaks-hard-links
|
||||
|
|
@ -1,55 +0,0 @@
|
|||
#!/bin/bash
|
||||
# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# runtest.sh of /tools/elfutils/Regression/eu-elfcompress-breaks-hard-links
|
||||
# Description: eu-elfcompress-breaks-hard-links
|
||||
# Author: Martin Cermak <mcermak@redhat.com>
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# Copyright (c) 2023 Red Hat, Inc.
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License as
|
||||
# published by the Free Software Foundation, either version 2 of
|
||||
# the License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be
|
||||
# useful, but WITHOUT ANY WARRANTY; without even the implied
|
||||
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
# PURPOSE. See the GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see http://www.gnu.org/licenses/.
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
# Include Beaker environment
|
||||
. /usr/share/beakerlib/beakerlib.sh || exit 1
|
||||
|
||||
PACKAGE="elfutils"
|
||||
|
||||
rlJournalStart
|
||||
rlPhaseStartSetup
|
||||
rlAssertRpm $PACKAGE
|
||||
rlRun "TMP=$(mktemp -d)"
|
||||
rlRun "cp bubble.c $TMP/"
|
||||
rlRun "pushd $TMP"
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartTest
|
||||
rlRun "gcc -o a.out -g bubble.c"
|
||||
rlRun "ln a.out a.lnk"
|
||||
rlRun "eu-elfcompress -q -p -t none a.lnk"
|
||||
rlRun "i0=$(stat -c '%i' a.out)"
|
||||
rlRun "i1=$(stat -c '%i' a.lnk)"
|
||||
rlRun "test $i0 -eq $i1"
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartCleanup
|
||||
rlRun "popd"
|
||||
rlRun "rm -r $TMP"
|
||||
rlPhaseEnd
|
||||
rlJournalPrintText
|
||||
rlJournalEnd
|
||||
|
|
@ -1,64 +0,0 @@
|
|||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# Makefile of /tools/elfutils/Regression/eu-readelf-reports-machine-type-is-unknown
|
||||
# Description: Test for BZ#1724350 (eu-readelf reports machine type is <unknown>)
|
||||
# Author: Martin Cermak <mcermak@redhat.com>
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# Copyright (c) 2019 Red Hat, Inc.
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License as
|
||||
# published by the Free Software Foundation, either version 2 of
|
||||
# the License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be
|
||||
# useful, but WITHOUT ANY WARRANTY; without even the implied
|
||||
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
# PURPOSE. See the GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see http://www.gnu.org/licenses/.
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
export TEST=/tools/elfutils/Regression/eu-readelf-reports-machine-type-is-unknown
|
||||
export TESTVERSION=1.0
|
||||
|
||||
BUILT_FILES=
|
||||
|
||||
FILES=$(METADATA) runtest.sh Makefile PURPOSE
|
||||
|
||||
.PHONY: all install download clean
|
||||
|
||||
run: $(FILES) build
|
||||
./runtest.sh
|
||||
|
||||
build: $(BUILT_FILES)
|
||||
test -x runtest.sh || chmod a+x runtest.sh
|
||||
|
||||
clean:
|
||||
rm -f *~ $(BUILT_FILES)
|
||||
|
||||
|
||||
include /usr/share/rhts/lib/rhts-make.include
|
||||
|
||||
$(METADATA): Makefile
|
||||
@echo "Owner: Martin Cermak <mcermak@redhat.com>" > $(METADATA)
|
||||
@echo "Name: $(TEST)" >> $(METADATA)
|
||||
@echo "TestVersion: $(TESTVERSION)" >> $(METADATA)
|
||||
@echo "Path: $(TEST_DIR)" >> $(METADATA)
|
||||
@echo "Description: Test for BZ#1724350 (eu-readelf reports machine type is <unknown>)" >> $(METADATA)
|
||||
@echo "Type: Regression" >> $(METADATA)
|
||||
@echo "TestTime: 48h" >> $(METADATA)
|
||||
@echo "RunFor: elfutils" >> $(METADATA)
|
||||
@echo "Requires: elfutils linux-firmware" >> $(METADATA)
|
||||
@echo "Priority: Normal" >> $(METADATA)
|
||||
@echo "License: GPLv2+" >> $(METADATA)
|
||||
@echo "Confidential: no" >> $(METADATA)
|
||||
@echo "Destructive: no" >> $(METADATA)
|
||||
@echo "Bug: 1724350" >> $(METADATA)
|
||||
@echo "Releases: -RHEL4 -RHELClient5 -RHELServer5" >> $(METADATA)
|
||||
|
||||
rhts-lint $(METADATA)
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
PURPOSE of /tools/elfutils/Regression/eu-readelf-reports-machine-type-is-unknown
|
||||
Description: Test for BZ#1724350 (eu-readelf reports machine type is <unknown>)
|
||||
Author: Martin Cermak <mcermak@redhat.com>
|
||||
Bug summary: eu-readelf reports machine type is <unknown> on firmware blobs
|
||||
Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1724350
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
summary: Test for BZ#1724350 (eu-readelf reports machine type is <unknown>)
|
||||
description: |
|
||||
Bug summary: eu-readelf reports machine type is <unknown> on firmware blobs
|
||||
Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1724350
|
||||
contact:
|
||||
- Martin Cermak <mcermak@redhat.com>
|
||||
component:
|
||||
- elfutils
|
||||
test: ./runtest.sh
|
||||
framework: beakerlib
|
||||
recommend:
|
||||
- elfutils
|
||||
- linux-firmware
|
||||
duration: 48h
|
||||
extra-summary: /tools/elfutils/Regression/eu-readelf-reports-machine-type-is-unknown
|
||||
extra-task: /tools/elfutils/Regression/eu-readelf-reports-machine-type-is-unknown
|
||||
|
|
@ -1,50 +0,0 @@
|
|||
#!/bin/bash
|
||||
# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# runtest.sh of /tools/elfutils/Regression/eu-readelf-reports-machine-type-is-unknown
|
||||
# Description: Test for BZ#1724350 (eu-readelf reports machine type is <unknown>)
|
||||
# Author: Martin Cermak <mcermak@redhat.com>
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# Copyright (c) 2019 Red Hat, Inc.
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License as
|
||||
# published by the Free Software Foundation, either version 2 of
|
||||
# the License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be
|
||||
# useful, but WITHOUT ANY WARRANTY; without even the implied
|
||||
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
# PURPOSE. See the GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see http://www.gnu.org/licenses/.
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
# Include Beaker environment
|
||||
. /usr/share/beakerlib/beakerlib.sh || exit 1
|
||||
|
||||
PACKAGE="elfutils"
|
||||
|
||||
__showgreenlight ()
|
||||
{
|
||||
rlJournalStart
|
||||
rlPhaseStartTest
|
||||
rlRun "echo \"Irrelevant for $X_SCLS\""
|
||||
rlPhaseEnd
|
||||
rlJournalEnd
|
||||
exit 0
|
||||
}
|
||||
|
||||
echo $X_SCLS | fgrep -q gcc-toolset-9 && __showgreenlight
|
||||
|
||||
rlJournalStart
|
||||
rlPhaseStartTest
|
||||
rlRun "find /usr/lib/firmware/ -name '*.nffw' | xargs eu-readelf -h | awk '/Machine/ {print \$NF}' | fgrep '<unknown>'" 1
|
||||
rlPhaseEnd
|
||||
rlJournalPrintText
|
||||
rlJournalEnd
|
||||
|
|
@ -1,64 +0,0 @@
|
|||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# Makefile of /tools/elfutils/Regression/eu-strip-generates-empty-output-if
|
||||
# Description: eu-strip-generates-empty-output-if
|
||||
# Author: Martin Cermak <mcermak@redhat.com>
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# Copyright (c) 2017 Red Hat, Inc.
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License as
|
||||
# published by the Free Software Foundation, either version 2 of
|
||||
# the License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be
|
||||
# useful, but WITHOUT ANY WARRANTY; without even the implied
|
||||
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
# PURPOSE. See the GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see http://www.gnu.org/licenses/.
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
export TEST=/tools/elfutils/Regression/eu-strip-generates-empty-output-if
|
||||
export TESTVERSION=1.0
|
||||
|
||||
BUILT_FILES=
|
||||
|
||||
FILES=$(METADATA) runtest.sh Makefile PURPOSE
|
||||
|
||||
.PHONY: all install download clean
|
||||
|
||||
run: $(FILES) build
|
||||
./runtest.sh
|
||||
|
||||
build: $(BUILT_FILES)
|
||||
test -x runtest.sh || chmod a+x runtest.sh
|
||||
|
||||
clean:
|
||||
rm -f *~ $(BUILT_FILES)
|
||||
|
||||
|
||||
include /usr/share/rhts/lib/rhts-make.include
|
||||
|
||||
$(METADATA): Makefile
|
||||
@echo "Owner: Martin Cermak <mcermak@redhat.com>" > $(METADATA)
|
||||
@echo "Name: $(TEST)" >> $(METADATA)
|
||||
@echo "TestVersion: $(TESTVERSION)" >> $(METADATA)
|
||||
@echo "Path: $(TEST_DIR)" >> $(METADATA)
|
||||
@echo "Description: eu-strip-generates-empty-output-if" >> $(METADATA)
|
||||
@echo "Type: Regression" >> $(METADATA)
|
||||
@echo "TestTime: 48h" >> $(METADATA)
|
||||
@echo "RunFor: elfutils" >> $(METADATA)
|
||||
@echo "Requires: elfutils" >> $(METADATA)
|
||||
@echo "Priority: Normal" >> $(METADATA)
|
||||
@echo "License: GPLv2+" >> $(METADATA)
|
||||
@echo "Confidential: no" >> $(METADATA)
|
||||
@echo "Destructive: no" >> $(METADATA)
|
||||
@echo "Bug: 1455620" >> $(METADATA)
|
||||
@echo "Releases: -RHEL4 -RHELClient5 -RHELServer5" >> $(METADATA)
|
||||
|
||||
rhts-lint $(METADATA)
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
PURPOSE of /tools/elfutils/Regression/eu-strip-generates-empty-output-if
|
||||
Description: eu-strip-generates-empty-output-if
|
||||
Author: Martin Cermak <mcermak@redhat.com>
|
||||
Bug summary: eu-strip generates empty output if there is nothing to do
|
||||
Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1455620
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
summary: eu-strip-generates-empty-output-if
|
||||
description: |
|
||||
Bug summary: eu-strip generates empty output if there is nothing to do
|
||||
Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1455620
|
||||
contact:
|
||||
- Martin Cermak <mcermak@redhat.com>
|
||||
component:
|
||||
- elfutils
|
||||
test: ./runtest.sh
|
||||
framework: beakerlib
|
||||
recommend:
|
||||
- elfutils
|
||||
duration: 48h
|
||||
extra-summary: /tools/elfutils/Regression/eu-strip-generates-empty-output-if
|
||||
extra-task: /tools/elfutils/Regression/eu-strip-generates-empty-output-if
|
||||
|
|
@ -1,52 +0,0 @@
|
|||
#!/bin/bash
|
||||
# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# runtest.sh of /tools/elfutils/Regression/eu-strip-generates-empty-output-if
|
||||
# Description: eu-strip-generates-empty-output-if
|
||||
# Author: Martin Cermak <mcermak@redhat.com>
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# Copyright (c) 2017 Red Hat, Inc.
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License as
|
||||
# published by the Free Software Foundation, either version 2 of
|
||||
# the License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be
|
||||
# useful, but WITHOUT ANY WARRANTY; without even the implied
|
||||
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
# PURPOSE. See the GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see http://www.gnu.org/licenses/.
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
# Include Beaker environment
|
||||
. /usr/share/beakerlib/beakerlib.sh || exit 1
|
||||
|
||||
PACKAGE="elfutils"
|
||||
|
||||
rlJournalStart
|
||||
rlPhaseStartSetup
|
||||
rlAssertRpm $PACKAGE
|
||||
rlRun "tmp=\$(mktemp -d)"
|
||||
rlRun "pushd $tmp"
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartTest
|
||||
rlRun "echo 'int main() { return 1; }' > test.c"
|
||||
rlRun "gcc test.c"
|
||||
rlRun "eu-strip -g -o test ./a.out"
|
||||
rlRun "test $(stat --format='%s' test) -gt 0"
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartCleanup
|
||||
rlRun "popd"
|
||||
rlRun "rm -r $tmp"
|
||||
rlPhaseEnd
|
||||
rlJournalPrintText
|
||||
rlJournalEnd
|
||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue