☺ Buildbot (Sourceware): elfutils - build successful (main)

2024-02-06 Thread builder
A restored build has been detected on builder elfutils-opensusetw-x86_64 while 
building elfutils.

Full details are available at:
https://builder.sourceware.org/buildbot/#/builders/88/builds/240

Build state: build successful
Revision: 75fb8c0152892873fc0a905d228f50d6dfd3dc0d
Worker: bbo1-2
Build Reason: (unknown)
Blamelist: Housam Alamour 

Steps:

- 0: worker_preparation ( success )

- 1: set package name ( success )

- 2: git checkout ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#/builders/88/builds/240/steps/2/logs/stdio

- 3: autoreconf ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#/builders/88/builds/240/steps/3/logs/stdio

- 4: configure ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#/builders/88/builds/240/steps/4/logs/stdio
- config.log: 
https://builder.sourceware.org/buildbot/#/builders/88/builds/240/steps/4/logs/config_log

- 5: get version ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#/builders/88/builds/240/steps/5/logs/stdio
- property changes: 
https://builder.sourceware.org/buildbot/#/builders/88/builds/240/steps/5/logs/property_changes

- 6: make ( warnings )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#/builders/88/builds/240/steps/6/logs/stdio
- warnings (3): 
https://builder.sourceware.org/buildbot/#/builders/88/builds/240/steps/6/logs/warnings__3_

- 7: make check ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#/builders/88/builds/240/steps/7/logs/stdio
- test-suite.log: 
https://builder.sourceware.org/buildbot/#/builders/88/builds/240/steps/7/logs/test-suite_log

- 8: make distcheck ( warnings )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#/builders/88/builds/240/steps/8/logs/stdio
- test-suite.log: 
https://builder.sourceware.org/buildbot/#/builders/88/builds/240/steps/8/logs/test-suite_log
- warnings (5): 
https://builder.sourceware.org/buildbot/#/builders/88/builds/240/steps/8/logs/warnings__5_

- 9: prep ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#/builders/88/builds/240/steps/9/logs/stdio

- 10: build bunsen.cpio.gz ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#/builders/88/builds/240/steps/10/logs/stdio

- 11: fetch bunsen.cpio.gz ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#/builders/88/builds/240/steps/11/logs/stdio

- 12: unpack bunsen.cpio.gz ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#/builders/88/builds/240/steps/12/logs/stdio

- 13: pass .bunsen.source.gitname ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#/builders/88/builds/240/steps/13/logs/stdio

- 14: pass .bunsen.source.gitdescribe ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#/builders/88/builds/240/steps/14/logs/stdio

- 15: pass .bunsen.source.gitbranch ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#/builders/88/builds/240/steps/15/logs/stdio

- 16: pass .bunsen.source.gitrepo ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#/builders/88/builds/240/steps/16/logs/stdio

- 17: upload to bunsen ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#/builders/88/builds/240/steps/17/logs/stdio

- 18: clean up ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#/builders/88/builds/240/steps/18/logs/stdio

- 19: make distclean ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#/builders/88/builds/240/steps/19/logs/stdio



[COMMITTED] srcfiles: Fix --enable-gcov (BUILD_STATIC) build

2024-02-06 Thread Mark Wielaard
When configuring with --enable-gcov we build most things static.
Including libdebuginfod. The src Makefile was only setup for a
shared library build of libdebuginfod.so. Fix this by providing
a static libdebuginfod in case of BUILD_STATIC.

This fixes the builder.sourceware.org elfutils-snapshots-coverage
and provides fresh coverage reports again at
https://snapshots.sourceware.org/elfutils/coverage/latest/

* Makefile.am (BUILD_STATIC): Provide libdebuginfod.a

Signed-off-by: Mark Wielaard 
---
 src/Makefile.am | 11 ---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/src/Makefile.am b/src/Makefile.am
index 28fab5f5..1d592d4d 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -43,18 +43,23 @@ if BUILD_STATIC
 libasm = ../libasm/libasm.a
 libdw = ../libdw/libdw.a -lz $(zip_LIBS) $(libelf) -ldl -lpthread
 libelf = ../libelf/libelf.a -lz $(zstd_LIBS)
+if LIBDEBUGINFOD
+libdebuginfod = ../debuginfod/libdebuginfod.a -lpthread $(libcurl_LIBS)
+else
+libdebuginfod =
+endif
 else
 libasm = ../libasm/libasm.so
 libdw = ../libdw/libdw.so
 libelf = ../libelf/libelf.so
-endif
-libebl = ../libebl/libebl.a ../backends/libebl_backends.a ../libcpu/libcpu.a
-libeu = ../lib/libeu.a
 if LIBDEBUGINFOD
 libdebuginfod = ../debuginfod/libdebuginfod.so
 else
 libdebuginfod =
 endif
+endif
+libebl = ../libebl/libebl.a ../backends/libebl_backends.a ../libcpu/libcpu.a
+libeu = ../lib/libeu.a
 
 if DEMANGLE
 demanglelib = -lstdc++
-- 
2.39.3



Re: [PATCH] PR 30991: srcfiles tarball feature

2024-02-06 Thread Mark Wielaard
Hi,

On Mon, Feb 05, 2024 at 07:24:33PM -0500, Aaron Merey wrote:
> > diff --git a/NEWS b/NEWS
> > index 0420d3b8..3391d6a1 100644
> > --- a/NEWS
> > +++ b/NEWS
> > @@ -1,3 +1,8 @@
> > +Version 0.191 (after 0.189)
> > +
> > +srcfiles: Can now fetch the source files of a DWARF/ELF file and
> > +  place them into a zip.
> > +
> >  Version 0.190 "Woke!"
> >
> >  CONTRIBUTING: Switch from real name policy to known identity policy.
> > @@ -9,6 +14,9 @@ libelf: Add RELR support.
> >
> >  libdw: Recognize .debug_[ct]u_index sections
> >
> > +srcfiles: added srcfiles tool that lists all the source files of a given
> > +  DWARF/ELF file.
> > +
> >  readelf: Support readelf -Ds, --use-dynamic --symbol.
> >   Support .gdb_index version 9
> >

This looks like a merge issue after the 0.190 release. I updated the
version at the top and removed the duplicate entry under 0.190.

> > diff --git a/debuginfod/debuginfod.cxx b/debuginfod/debuginfod.cxx
> > index 524be948..6b21f46f 100644
> > --- a/debuginfod/debuginfod.cxx
> > +++ b/debuginfod/debuginfod.cxx
> > @@ -2996,8 +2996,6 @@ dwarf_extract_source_paths (Elf *elf, set& 
> > debug_sourcefiles)
> >
> >if (comp_dir[0] == '\0' && cuname[0] != '/')
> >  {
> > -  // This is a common symptom for dwz-compressed debug files,
> > -  // where the altdebug file cannot be resolved.
> >if (verbose > 3)
> >  obatched(clog) << "skipping cu=" << cuname << " due to empty 
> > comp_dir" << endl;
> >continue;

Was it intended to remove this comment?

Cheers,

Mark>From 71794afb54fd9668a02a361134f15180ce85f3ad Mon Sep 17 00:00:00 2001
From: Mark Wielaard 
Date: Tue, 6 Feb 2024 12:53:54 +0100
Subject: [PATCH] NEWS: Update version number and remove duplicate 0.190 entry

---
 NEWS | 5 +
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/NEWS b/NEWS
index e2393e77..98dc78f5 100644
--- a/NEWS
+++ b/NEWS
@@ -1,4 +1,4 @@
-Version 0.191 (after 0.189)
+Version 0.191 (after 0.190)
 
 srcfiles: Can now fetch the source files of a DWARF/ELF file and
   place them into a zip.
@@ -14,9 +14,6 @@ libelf: Add RELR support.
 
 libdw: Recognize .debug_[ct]u_index sections
 
-srcfiles: added srcfiles tool that lists all the source files of a given
-  DWARF/ELF file.
-
 readelf: Support readelf -Ds, --use-dynamic --symbol.
  Support .gdb_index version 9
 
-- 
2.39.3



Re: [PATCH] PR 30991: srcfiles tarball feature

2024-02-06 Thread Frank Ch. Eigler
Hi -

> > > -  // This is a common symptom for dwz-compressed debug files,
> > > -  // where the altdebug file cannot be resolved.
> 
> Was it intended to remove this comment?

Yes, it was copy/pasted from debuginfod by mistake.

- FChE



Re: [PATCH] unstrip: Call adjust_relocs no more than once per section.

2024-02-06 Thread Mark Wielaard
Hi Aaron,

On Mon, 2024-02-05 at 18:11 -0500, Aaron Merey wrote:
> During symtab merging, adjust_relocs might be called multiple times on
> some SHT_REL/SHT_RELA sections.  In these cases it is possible for a
> relocation's symbol index to be correctly mapped from X to Y during the
> first call to adjust_relocs but then wrongly remapped from Y to Z during
> the second call.
> 
> Fix this by adjusting relocation symbol indices just once per section.
> 
> Also add stable sorting for symbols during symtab merging so that the
> symbol order in the output file's symtab does not depend on undefined
> behaviour in qsort.
> 
> Note that adjust_relocs still might be called a second time on a section
> during add_new_section_symbols.  However since add_new_section_symbols
> generates its own distinct symbol index map, this should not trigger the
> bug described above.
> 
> https://sourceware.org/bugzilla/show_bug.cgi?id=31097
> 
> Signed-off-by: Aaron Merey 
> ---
> 
> I added some tests to run-unstrip-test.sh to verify that strip+unstrip
> does not alter the symbols referred to by relocations.  I tried to use
> eu-elfcmp for this purpose.  However for a pair of i386 ET_REL binaries
> I did some testing with, eu-elfcmp skips checking the SHT_REL/SHT_RELA
> sections because the sh_flags do not contain SHF_ALLOC (the flags only
> contain SHF_INFO_LINK in this case).
> 
> I'm not sure if this eu-elfcmp behaviour is intentional or if eu-elfcmp
> should start comparing REL/RELA sections even if they aren't allocated.

So it looks like elfcmp explicitly checks ebl_section_strip_p and
doesn't compare sections that are strippable. Maybe we should add an
eu-elfcmp --all-sections flag?

We should probably also check that it handles the new SHT_RELR sections
correctly. I see it only checks for SHT_REL and SHT_RELA in the code.
Although RELR is really simple and doesn't have symbol references. So
it is probably fine.

>  src/unstrip.c|  81 
>  tests/.gitignore |   1 +
>  tests/Makefile.am|   3 +-
>  tests/elf-print-reloc-syms.c | 144 +++
>  tests/run-unstrip-test.sh|   8 ++
>  5 files changed, 221 insertions(+), 16 deletions(-)
>  create mode 100644 tests/elf-print-reloc-syms.c
> 
> diff --git a/src/unstrip.c b/src/unstrip.c
> index d5bd1821..f37d6c58 100644
> --- a/src/unstrip.c
> +++ b/src/unstrip.c
> @@ -598,21 +598,30 @@ adjust_relocs (Elf_Scn *outscn, Elf_Scn *inscn, const 
> GElf_Shdr *shdr,
>  /* Adjust all the relocation sections in the file.  */
>  static void
>  adjust_all_relocs (Elf *elf, Elf_Scn *symtab, const GElf_Shdr *symshdr,
> -size_t map[], size_t map_size)
> +size_t map[], size_t map_size, bool *scn_filter)
>  {

Maybe bool scn_filter[] since it really is an array?

>size_t new_sh_link = elf_ndxscn (symtab);
>Elf_Scn *scn = NULL;
>while ((scn = elf_nextscn (elf, scn)) != NULL)
>  if (scn != symtab)
>{
> + if (scn_filter != NULL)
> +   {
> + size_t ndx = elf_ndxscn (scn);
> +
> + /* Skip relocations that were already mapped during adjust_relocs
> +for the stripped symtab.  This is to avoid mapping a relocation's
> +symbol index from X to Y during the first adjust_relocs and then
> +wrongly remapping it from Y to Z during the second call.  */
> + if (scn_filter[ndx])
> +   continue;
> +   }
> +
>   GElf_Shdr shdr_mem;
>   GElf_Shdr *shdr = gelf_getshdr (scn, &shdr_mem);
>   ELF_CHECK (shdr != NULL, _("cannot get section header: %s"));
> - /* Don't redo SHT_GROUP, groups are in both the stripped and debug,
> -it will already have been done by adjust_relocs for the
> -stripped_symtab.  */
> - if (shdr->sh_type != SHT_NOBITS && shdr->sh_type != SHT_GROUP
> - && shdr->sh_link == new_sh_link)
> +
> + if (shdr->sh_type != SHT_NOBITS && shdr->sh_link == new_sh_link)
> adjust_relocs (scn, scn, shdr, map, map_size, symshdr);
>}
>  }

OK.

> @@ -697,7 +706,7 @@ add_new_section_symbols (Elf_Scn *old_symscn, size_t 
> old_shnum,
>  }
>  
>/* Adjust any relocations referring to the old symbol table.  */
> -  adjust_all_relocs (elf, symscn, shdr, symndx_map, nsym - 1);
> +  adjust_all_relocs (elf, symscn, shdr, symndx_map, nsym - 1, NULL);
>  
>return symdata;
>  }

OK.

> @@ -874,6 +883,7 @@ collect_symbols (Elf *outelf, bool rel, Elf_Scn *symscn, 
> Elf_Scn *strscn,
>s->shndx = shndx;
>s->info.info = sym->st_info;
>s->info.other = sym->st_other;
> +  s->duplicate = NULL;
>  
>if (scnmap != NULL && shndx != SHN_UNDEF && shndx < SHN_LORESERVE)
>   s->shndx = scnmap[shndx - 1];
> @@ -903,8 +913,7 @@ collect_symbols (Elf *outelf, bool rel, Elf_Scn *symscn, 
> Elf_Scn *strscn,
>if (s1->value > s2->value)   \
>  return 1
>  
> -/* Comp

[Bug tools/31345] New: eu-elfcmp: Add option to compare all sections

2024-02-06 Thread amerey at redhat dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=31345

Bug ID: 31345
   Summary: eu-elfcmp: Add option to compare all sections
   Product: elfutils
   Version: unspecified
Status: NEW
  Severity: normal
  Priority: P2
 Component: tools
  Assignee: unassigned at sourceware dot org
  Reporter: amerey at redhat dot com
CC: elfutils-devel at sourceware dot org
  Target Milestone: ---

eu-elfcmp currently skips comparing sections that are strippable.  Having an
--all-sections flag to compare all sections regardless of strippability can be
useful. For example this feature could have been used to detect PR31097 sooner.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Re: [PATCH] unstrip: Call adjust_relocs no more than once per section.

2024-02-06 Thread Aaron Merey
Hi Mark,

On Tue, Feb 6, 2024 at 10:36 AM Mark Wielaard  wrote:
>
> So it looks like elfcmp explicitly checks ebl_section_strip_p and
> doesn't compare sections that are strippable. Maybe we should add an
> eu-elfcmp --all-sections flag?
>
> We should probably also check that it handles the new SHT_RELR sections
> correctly. I see it only checks for SHT_REL and SHT_RELA in the code.
> Although RELR is really simple and doesn't have symbol references. So
> it is probably fine.

I added a PR for this: https://sourceware.org/bugzilla/show_bug.cgi?id=31345

> >  adjust_all_relocs (Elf *elf, Elf_Scn *symtab, const GElf_Shdr *symshdr,
> > -size_t map[], size_t map_size)
> > +size_t map[], size_t map_size, bool *scn_filter)
> >  {
>
> Maybe bool scn_filter[] since it really is an array?

Done.

> Looks good in general. Just clean up in the new testcase and run it
> with testrun.

Done. Pushed as commit 2f9b180cc1.

Aaron



[Bug tools/31097] strip/unstrip on ET_REL binary might fail elflint on i386

2024-02-06 Thread amerey at redhat dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=31097

Aaron Merey  changed:

   What|Removed |Added

 Resolution|--- |FIXED
 Status|NEW |RESOLVED

--- Comment #1 from Aaron Merey  ---
Fixed in the following commit:

commit 2f9b180cc1057fb351332689886b2492b3711aad
Author: Aaron Merey 
Date:   Sun Jan 21 19:44:34 2024 -0500

unstrip: Call adjust_relocs no more than once per section.

During symtab merging, adjust_relocs might be called multiple times on
some SHT_REL/SHT_RELA sections.  In these cases it is possible for a
relocation's symbol index to be correctly mapped from X to Y during the
first call to adjust_relocs but then wrongly remapped from Y to Z during
the second call.

Fix this by adjusting relocation symbol indices just once per section.

Also add stable sorting for symbols during symtab merging so that the
symbol order in the output file's symtab does not depend on undefined
behaviour in qsort.

Note that adjust_relocs still might be called a second time on a section
during add_new_section_symbols.  However since add_new_section_symbols
generates its own distinct symbol index map, this should not trigger the
bug described above.

-- 
You are receiving this mail because:
You are on the CC list for the bug.