Re: [PATCH] drop executable bits from **/*.bz2

2025-08-11 Thread Mark Wielaard
Hi Matthias, On Mon, 2025-08-11 at 14:46 +, Matthias Männich wrote: > Archives are usually not meant to be executable and hence should not > need the executable bit set. Drop it consistently to avoid unintential > (and potentially harmful) execution. > > Note, no binary in this repository has

Re: Cybersecurity Risk Assessment Request from Emerson for elfutils

2025-08-11 Thread Mark Wielaard
Hi Saurabh, On Mon, 2025-08-11 at 11:11 +, KATARE, SAURABH [EMR/MSOL/PUNE] wrote:  > As part of our ongoing efforts to comply with theEU Cyber Resilience > Act (CRA), we are currently conducting a cybersecurity risk assessment > of third-party software vendors whose products or components are

Re: [PATCH 3/3 v5] src/readelf.c: Support concurrency for -w, --debug-dump

2025-08-05 Thread Mark Wielaard
single threaded. > Restore static qualifier for sort_listptr_name Ack. > On Wed, Jul 2, 2025 at 5:21 PM Mark Wielaard wrote: > > > > > +  unsigned fn = 0; > > > > > +#ifdef HAVE_GETRLIMIT > > > > > +  { > > > > > +    struct rlim

Re: [PATCH 2/3 v5] src/readelf.c: Add support for print_debug_* output buffering

2025-08-05 Thread Mark Wielaard
Hi Aaron, On Mon, Aug 04, 2025 at 11:20:53PM -0400, Aaron Merey wrote: > Safely handle stdout output during concurrent calls to print_debug_* > functions. > > For any print_debug_* function and any function that could be called > from print_debug_* which also prints to stdout: add a FILE * argume

Re: [PATCH 1/3 v5] src: Add threadlib library for parallel job execution

2025-08-05 Thread Mark Wielaard
Hi Aaron, On Mon, Aug 04, 2025 at 11:20:52PM -0400, Aaron Merey wrote: > Add new internal static library libthread.a that provides infrastructure > for eu-* tools to run functions concurrently using pthreads. > > threadlib.c manages per-job threads as well as per-job buffers for stdout > output.

Sourceware infrastructure updates for Q2 2025

2025-07-29 Thread Mark Wielaard
Sourceware infrastructure community updates for Q2 2025 Sourceware has provided the infrastructure for core toolchain and developer tools projects for more than 25 years. https://sourceware.org/sourceware-25-roadmap.html Keep Sourceware worry-free, friendly and independent by donating https:/

Re: [PATCH 6/7 v3] doc: Add elf_cntl.3

2025-07-17 Thread Mark Wielaard
Hi Aaron, On Tue, 2025-07-15 at 00:25 -0400, Aaron Merey wrote: > Signed-off-by: Aaron Merey > > --- > v3: Clarify that future operations might fail after ELF_C_FDDONE > unless ELF_C_FDREAD is used first. Looks good. Thanks, Mark

Re: [PATCH 5/7 v3] doc: Add elf_getarhdr.3

2025-07-17 Thread Mark Wielaard
Hi Aaron, On Tue, 2025-07-15 at 00:25 -0400, Aaron Merey wrote: > Signed-off-by: Aaron Merey > > --- > v3: Remove mention of elf_rand and elf_next invalidating Elf_Arhdr. > Change thread safety attribute to MT-safe. Yes, looks correct to me. I am not sure your patch "elf_getarhdr: Replace per-

Re: [PATCH 4/7 v3] doc: Add elf_getaroff.3

2025-07-17 Thread Mark Wielaard
Hi Aaron, On Tue, 2025-07-15 at 00:25 -0400, Aaron Merey wrote: > Signed-off-by: Aaron Merey > > --- > v3 changes: > > Update return value description to reflect that elf_getaroff returns > -1 if there's an error, not ELF_C_NULL (0). Yes, looks good. Thanks, Mark

Re: [PATCH 3/7 v3] doc: Add elf_next.3

2025-07-17 Thread Mark Wielaard
Hi Aaron, On Tue, 2025-07-15 at 00:25 -0400, Aaron Merey wrote: > Signed-off-by: Aaron Merey > > --- > v3 changes: Use .B for EXAMPLES. > > On Fri, Jun 27, 2025 at 6:36 PM Mark Wielaard wrote: > > > +  /* Get the members of the archive one after the other.

Re: [PATCH 2/7] elf_getarhdr: Replace per-archive Elf_Arhdr storage with per-member storage

2025-07-15 Thread Mark Wielaard
Hi Aaron, On Tue, 2025-07-15 at 00:25 -0400, Aaron Merey wrote: > Currently each archive descriptor maintains a single Elf_Arhdr for the > current archive member (as determined by elf_next or elf_rand) which is > returned by elf_getarhdr. > > A single per-archive Elf_Arhdr is not ideal since elf_

Re: [PATCH 1/7] elf_getaroff: Fix elf_getaroff error return value

2025-07-15 Thread Mark Wielaard
Hi Aaron, On Tue, 2025-07-15 at 00:25 -0400, Aaron Merey wrote: > elf_getaroff currently returns ELF_C_NULL (0) to indicate that an error > occured (ex. the Elf descriptor is not associated with an archive). > > However elf_getaroff is intended to return -1 if an error occurs. > eu-ar assumes -1

Re: [PATCH 16/16] doc: Add elf_strptr.3

2025-07-10 Thread Mark Wielaard
Hi Aaron, On Mon, 2025-06-30 at 23:12 -0400, Aaron Merey wrote: > Signed-off-by: Aaron Merey > --- > doc/Makefile.am | 1 + > doc/elf_strptr.3 | 72 > 2 files changed, 73 insertions(+) > create mode 100644 doc/elf_strptr.3 > > diff --git a/doc

Re: [PATCH 15/16] doc: Add elf_scnshndx.3

2025-07-10 Thread Mark Wielaard
Hi Aaron, On Mon, 2025-06-30 at 23:12 -0400, Aaron Merey wrote: > Signed-off-by: Aaron Merey > --- > doc/Makefile.am| 1 + > doc/elf_scnshndx.3 | 68 ++ > 2 files changed, 69 insertions(+) > create mode 100644 doc/elf_scnshndx.3 > > diff --git a

Re: [PATCH 14/16] doc: Add elf_rawfile.3

2025-07-10 Thread Mark Wielaard
Hi Aaron, Funny, I had no idea this existed. But it is actually used by readelf (for showing the program interpreter) and there is one test case (that does the same). On Mon, 2025-06-30 at 23:12 -0400, Aaron Merey wrote: > Signed-off-by: Aaron Merey > --- > doc/Makefile.am | 1 + > doc/elf_r

Re: [PATCH 13/16] doc: Add elf_rawdata.3

2025-07-09 Thread Mark Wielaard
Hi Aaron, On Mon, Jun 30, 2025 at 11:12:30PM -0400, Aaron Merey wrote: > Signed-off-by: Aaron Merey > --- > doc/Makefile.am | 1 + > doc/elf_rawdata.3 | 97 +++ > 2 files changed, 98 insertions(+) > create mode 100644 doc/elf_rawdata.3 > > diff --

Re: [PATCH 12/16] doc: Add elf_rand.3

2025-07-09 Thread Mark Wielaard
Hi Aaron, On Mon, Jun 30, 2025 at 11:12:29PM -0400, Aaron Merey wrote: > Signed-off-by: Aaron Merey > --- > doc/Makefile.am | 1 + > doc/elf_rand.3 | 68 + > 2 files changed, 69 insertions(+) > create mode 100644 doc/elf_rand.3 > > diff --git a

Re: [PATCH 11/16] doc: Add elf_nextscn.3

2025-07-08 Thread Mark Wielaard
Hi Aaron, On Mon, Jun 30, 2025 at 11:12:28PM -0400, Aaron Merey wrote: > Signed-off-by: Aaron Merey > --- > doc/Makefile.am | 1 + > doc/elf_nextscn.3 | 65 +++ > 2 files changed, 66 insertions(+) > create mode 100644 doc/elf_nextscn.3 > > diff --

Re: [PATCH 10/16] doc: Add elf_newscn.3

2025-07-08 Thread Mark Wielaard
Hi Aaron, On Mon, Jun 30, 2025 at 11:12:27PM -0400, Aaron Merey wrote: > Signed-off-by: Aaron Merey > --- > doc/Makefile.am | 1 + > doc/elf_newscn.3 | 70 > 2 files changed, 71 insertions(+) > create mode 100644 doc/elf_newscn.3 > > diff --gi

Re: [PATCH 09/16] doc: Add elf_newdata.3

2025-07-08 Thread Mark Wielaard
Hi Aaron, On Mon, Jun 30, 2025 at 11:12:26PM -0400, Aaron Merey wrote: > Signed-off-by: Aaron Merey > --- > doc/Makefile.am | 1 + > doc/elf_newdata.3 | 75 +++ > 2 files changed, 76 insertions(+) > create mode 100644 doc/elf_newdata.3 > > diff --

Re: [PATCH 08/16] doc: Add elf_gnu_hash.3

2025-07-08 Thread Mark Wielaard
Hi Aaron, On Mon, Jun 30, 2025 at 11:12:25PM -0400, Aaron Merey wrote: > Signed-off-by: Aaron Merey > --- > doc/Makefile.am| 1 + > doc/elf_gnu_hash.3 | 1 + > doc/elf_hash.3 | 20 +--- > 3 files changed, 19 insertions(+), 3 deletions(-) > create mode 100644 doc/elf_gn

Re: [PATCH 07/16] doc: Add elf_getshdrstrndx.3 and elf_getshstrndx.3

2025-07-08 Thread Mark Wielaard
Hi Aaron, On Mon, 2025-06-30 at 23:12 -0400, Aaron Merey wrote: > diff --git a/doc/Makefile.am b/doc/Makefile.am > index cf60a271..129c612d 100644 > --- a/doc/Makefile.am > +++ b/doc/Makefile.am > @@ -71,7 +71,9 @@ notrans_dist_man3_MANS= elf32_checksum.3 \ > elf_getphdrnum.3

Re: [PATCH 06/16] doc: Add elf_getshdrnum.3 and elf_getshnum.3

2025-07-08 Thread Mark Wielaard
Hi Aaron, On Mon, 2025-06-30 at 23:12 -0400, Aaron Merey wrote: > Signed-off-by: Aaron Merey > --- > doc/Makefile.am | 2 ++ > doc/elf_getshdrnum.3 | 76 > doc/elf_getshnum.3 | 1 + > 3 files changed, 79 insertions(+) > create mode 100644 do

Re: [PATCH 05/16] doc: Add elf_getphdrnum.3

2025-07-08 Thread Mark Wielaard
Hi Aaron, On Mon, 2025-06-30 at 23:12 -0400, Aaron Merey wrote: > Signed-off-by: Aaron Merey > --- > doc/Makefile.am | 1 + > doc/elf_getphdrnum.3 | 74 > 2 files changed, 75 insertions(+) > create mode 100644 doc/elf_getphdrnum.3 > > diff --g

Re: [PATCH 04/16] doc: Add elf_getident.3

2025-07-07 Thread Mark Wielaard
Hi Aaron, On Mon, Jun 30, 2025 at 11:12:21PM -0400, Aaron Merey wrote: > Signed-off-by: Aaron Merey > --- > doc/Makefile.am| 1 + > doc/elf_getident.3 | 89 ++ > 2 files changed, 90 insertions(+) > create mode 100644 doc/elf_getident.3 > > diff

Re: [PATCH 03/16] doc: Add elf_getdata_rawchunk.3

2025-07-07 Thread Mark Wielaard
Hi Aaron, On Mon, 2025-06-30 at 23:12 -0400, Aaron Merey wrote: > Signed-off-by: Aaron Merey > --- > doc/Makefile.am| 1 + > doc/elf_getdata_rawchunk.3 | 133 + > 2 files changed, 134 insertions(+) > create mode 100644 doc/elf_getdata_rawchunk.3

Re: [PATCH 02/16] doc: Add elf_flag*.3

2025-07-04 Thread Mark Wielaard
Hi Aaron, On Mon, Jun 30, 2025 at 11:12:19PM -0400, Aaron Merey wrote: > Signed-off-by: Aaron Merey > --- > doc/Makefile.am| 6 ++ > doc/elf_flagdata.3 | 1 + > doc/elf_flagehdr.3 | 1 + > doc/elf_flagelf.3 | 145 + > doc/elf_flagphdr.3 |

Re: [PATCH 01/16] doc: Add elf_memory.3

2025-07-04 Thread Mark Wielaard
Hi Aaron, On Mon, Jun 30, 2025 at 11:12:18PM -0400, Aaron Merey wrote: > Signed-off-by: Aaron Merey > --- > doc/Makefile.am | 1 + > doc/elf_memory.3 | 84 > 2 files changed, 85 insertions(+) > create mode 100644 doc/elf_memory.3 > > diff --gi

Re: [PATCH] libdwP.h: Remove abbrev_lock

2025-07-03 Thread Mark Wielaard
Hi Aaron, On Sun, 2025-06-22 at 20:00 -0400, Aaron Merey wrote: > Improve __libdw_dieabbrev performance by removing abbrev_lock. This > lock protects the Dwarf_Die abbrev member due to lazy loading. > > Instead, eagerly load abbrev during Dwarf_Die initialization so that > the member is readonly

Re: [PATCH 6/6] doc: Add elf_compress.3 and elf_compress_gnu.3

2025-07-03 Thread Mark Wielaard
Hi Aaron, On Sun, 2025-06-22 at 19:02 -0400, Aaron Merey wrote: > Signed-off-by: Aaron Merey > --- > doc/Makefile.am| 2 + > doc/elf_compress.3 | 183 + > doc/elf_compress_gnu.3 | 1 + > 3 files changed, 186 insertions(+) > create mode 100

Re: [PATCH 5/6] doc: Add elf_cntl.3

2025-07-03 Thread Mark Wielaard
Hi Aaron, On Sun, 2025-06-22 at 19:02 -0400, Aaron Merey wrote: > Signed-off-by: Aaron Merey > --- > doc/Makefile.am | 1 + > doc/elf_cntl.3 | 66 + > 2 files changed, 67 insertions(+) > create mode 100644 doc/elf_cntl.3 > > diff --git a/doc/Ma

Re: [PATCH 3/3 v4] src/readelf.c: Support concurrency for -w, --debug-dump

2025-07-02 Thread Mark Wielaard
Hi Aaron, On Sun, Jun 29, 2025 at 11:51:58PM -0400, Aaron Merey wrote: > Implement concurrent execution of print_debug_* functions during handling > of -w, --debug-dump using libthread.a. > > A new `-C, --concurrency=NUM` command line option controls the maximum > number of threads that may be us

Re: [PATCH 1/3 v3] src: Add threadlib library for parallel job execution

2025-07-02 Thread Mark Wielaard
Hi Aaron, On Sun, 2025-06-29 at 23:51 -0400, Aaron Merey wrote: > Add new internal static library libthread.a that provides infrastructure > for eu-* tools to run functions concurrently using pthreads. > > threadlib.c manages per-job threads as well as per-job buffers for stdout > output. Output

Re: [PATCH] readelf.c: Avoid repeating calls to gettext _() in hotpath

2025-07-02 Thread Mark Wielaard
Hi Aaron, On Sun, 2025-06-29 at 23:51 -0400, Aaron Merey wrote: > Calls to the gettext _() macro in hotpaths cause many runtime lookups > of the same translation strings. This patch introduces macro __() > which caches the result of _() at each call site where __() is used. > > When a cached tra

Re: [PATCH 2/3 v3] src/readelf.c: Add support for print_debug_* output buffering

2025-07-02 Thread Mark Wielaard
On Sun, 2025-06-29 at 23:51 -0400, Aaron Merey wrote: > Safely handle stdout output during concurrent calls to print_debug_* > functions. > > For any print_debug_* function and any function that could be called > from print_debug_* which also prints to stdout: add a FILE * argument > and replace a

Re: [PATCH 4/6 v2] doc: Add elf_getarsym.3

2025-06-27 Thread Mark Wielaard
Hi Aaron, On Sun, Jun 22, 2025 at 07:02:06PM -0400, Aaron Merey wrote: > v2: Clarify that narsyms can be NULL and that the end of the > archive symbol table contains a special NULL entry. Looks good to me. Thanks, Mark>

Re: [PATCH 3/6 v2] doc: Add elf_getarhdr.3

2025-06-27 Thread Mark Wielaard
Hi Aaron, On Sun, Jun 22, 2025 at 07:02:05PM -0400, Aaron Merey wrote: > Signed-off-by: Aaron Merey > > --- > v2 changes: clarify when changes to the parent archive descriptor > invalidate the return value. Change thread safety attribute to > MT-Unsafe race. So I think this describes the curren

Re: [PATCH 2/6 v2] doc: Add elf_getaroff.3

2025-06-27 Thread Mark Wielaard
Hi Aaron, On Sun, Jun 22, 2025 at 07:02:04PM -0400, Aaron Merey wrote: > Signed-off-by: Aaron Merey > > --- > v2: Clarify that the offset refers to the archive member header. > > > > +.SH RETURN VALUE > > > +Return the file offset, in bytes, of the archive member referred to by > > > +.IR elf .

Re: [PATCH 1/6 v2] doc: Add elf_next.3

2025-06-27 Thread Mark Wielaard
Hi Aaron, On Sun, Jun 22, 2025 at 07:02:03PM -0400, Aaron Merey wrote: > Signed-off-by: Aaron Merey > > --- > v2: Clarify that elf_next is called with an archive member in order > to update the descriptor for the parent archive. Added a code example. Looks nice. Just two small questions below.

[COMMITTED] libdw: Add DEFAULT_INCLUDES to CHECK_DEF_FLAGS

2025-06-26 Thread Mark Wielaard
DEFAULT_INCLUDES includes -I. which is needed for compiling the testcases with -DMAIN_CHECK=1. This fixes make check after commit 76bd5f6bea9b "config: Adjust AM_CPPFLAGS for srcdir and .. path includes" * libdw/Makefile.am (CHECK_DEF_FLAGS): Add DEFAULT_INCLUDES. Signed-of

[COMMITTED] config: Adjust AM_CPPFLAGS for srcdir and .. path includes

2025-06-26 Thread Mark Wielaard
ed header files. * config/eu.am (AM_CPPFLAGS): Use -iquote for $(srcdir) and replace -I.. with -I$(abs_top_builddir). * libdw/libdwP.h: Include "libdw.h" and "dwarf.h" instead of the system headers and . https://sourceware.org/bugzilla/show_bu

[PATCH] libdwl: Add validate_strdata to limit Elf_Data d_size to valid strings.

2025-06-22 Thread Mark Wielaard
(validate_strdata): New function taking Elf_Data and restricting d_size to last zero char. (translate_offs): Call validate_strdata. (find_symtab): Likewise for both symstrdata and aux_symstrdata. https://sourceware.org/bugzilla/show_bug.cgi?id=33099 Signed-off-by: Mark

Re: [PATCH 4/4] doc: Add elf_getarsym.3

2025-06-17 Thread Mark Wielaard
Hi Aaron, On Mon, Jun 09, 2025 at 12:24:39PM -0400, Aaron Merey wrote: > Signed-off-by: Aaron Merey > --- > doc/Makefile.am| 1 + > doc/elf_getarsym.3 | 91 ++ > 2 files changed, 92 insertions(+) > create mode 100644 doc/elf_getarsym.3 > > diff

Re: [PATCH 3/4] doc: Add elf_getarhdr.3

2025-06-17 Thread Mark Wielaard
Hi Aaron, On Mon, Jun 09, 2025 at 12:24:38PM -0400, Aaron Merey wrote: > Signed-off-by: Aaron Merey > --- > doc/Makefile.am| 1 + > doc/elf_getarhdr.3 | 76 ++ > 2 files changed, 77 insertions(+) > create mode 100644 doc/elf_getarhdr.3 > > diff

Re: [PATCH 2/4] doc: Add elf_getaroff.3

2025-06-17 Thread Mark Wielaard
Hi Aaron, On Mon, 2025-06-09 at 12:24 -0400, Aaron Merey wrote: > Signed-off-by: Aaron Merey > --- > doc/Makefile.am| 1 + > doc/elf_getaroff.3 | 55 ++ > 2 files changed, 56 insertions(+) > create mode 100644 doc/elf_getaroff.3 > > diff --git a

Re: [PATCH 1/4] doc: Add elf_next.3

2025-06-17 Thread Mark Wielaard
Hi Aaron, On Mon, 2025-06-09 at 12:24 -0400, Aaron Merey wrote: > diff --git a/doc/Makefile.am b/doc/Makefile.am > index 1ced7858..fbfebfe0 100644 > --- a/doc/Makefile.am > +++ b/doc/Makefile.am > @@ -61,6 +61,7 @@ notrans_dist_man3_MANS= elf32_checksum.3 \ > elf_hash.3 \ >

Re: [PATCH 3/3 v2] src/readelf.c: Add support for print_debug_* output buffering

2025-06-06 Thread Mark Wielaard
Hi Aaron, On Thu, 2025-05-22 at 18:28 -0400, Aaron Merey wrote: > Safely handle stdout output during concurrent calls to print_debug_* > functions. > > For any print_debug_* function and any function that could be called > from print_debug_* which also prints to stdout: add a FILE * argument > an

Re: [PATCH v2] doc: Update elf_begin.3

2025-06-06 Thread Mark Wielaard
Hi Aaron, On Thu, 2025-06-05 at 17:12 -0400, Aaron Merey wrote: > Signed-off-by: Aaron Merey > --- > > v2: Address Mark's suggestions > https://patchwork.sourceware.org/project/elfutils/patch/20250603012245.411580-1-ame...@redhat.com/ It does indeed. Thanks. Just one nitpick, feel free to igno

Re: [PATCH 2/3 v3] src/readelf.c: Support concurrency for -w, --debug-dump

2025-06-05 Thread Mark Wielaard
Hi Aaron, On Tue, May 27, 2025 at 10:04:20AM -0400, Aaron Merey wrote: > Implement concurrent execution of print_debug_* functions during handling > of -w, --debug-dump using libthread.a. Do you intend to also enable this for other sections? > A new `-C, --concurrency=NUM` command line option co

Re: [PATCH 1/3 v2] src: Add threadlib library for parallel job execution

2025-06-05 Thread Mark Wielaard
Hi Aaron, Part 2... On Thu, May 22, 2025 at 06:28:52PM -0400, Aaron Merey wrote: > +typedef enum { > + /* pthread_create has not been called. */ > + NOT_STARTED, > + > + /* pthread_create has been called. */ > + STARTED, > + > + /* The thread has finished running the job but has not been j

Re: [PATCH 1/3 v2] src: Add threadlib library for parallel job execution

2025-06-05 Thread Mark Wielaard
Hi Aaron, On Thu, 2025-05-22 at 18:28 -0400, Aaron Merey wrote: > Add new internal static library libthread.a that provides infrastructure > for eu-* tools to run functions concurrently using pthreads. > > threadlib.c manages per-job threads as well as per-job buffers for stdout > output. Output

Re: [PATCH] doc: Update elf_begin.3

2025-06-04 Thread Mark Wielaard
Hi Aaron, On Mon, 2025-06-02 at 21:22 -0400, Aaron Merey wrote: > Signed-off-by: Aaron Merey > --- > doc/elf_begin.3 | 104 > 1 file changed, 79 insertions(+), 25 deletions(-) > > diff --git a/doc/elf_begin.3 b/doc/elf_begin.3 > index 6a1d0c27..c

[COMMITTED] elfutils_debian_amd64_builder use elfutils_factory_mua

2025-06-04 Thread Mark Wielaard
Debian stable only has valgrind 3.19.0 which doesn't have an openat2 syscall wrapper. This makes some elfutils tests fail under valgrind since it uses openat2 explicitly now. So switch the build factory to not use valgrind, but the gcc address (and undefined) sanitizer. --- builder/master.cfg | 2

[COMMITTED] unstrip: update unstripped_shnum when adding a new section

2025-06-03 Thread Mark Wielaard
If some section doesn't match between the stripped and unstripped file we invent a new one. Make sure to also update the shnum value. * src/unstrip.c (copy_elided_sections): Update unstripped_shnum. Signed-off-by: Mark Wielaard --- src/unstrip.c | 1 + 1 file changed, 1 insertion(+)

[COMMITTED] libcpu: riscv_disasm use 50 char mnebuf

2025-06-03 Thread Mark Wielaard
ions. Without we just use a few extra bytes on the stack (which aren't used afterwards, without any issue, even though it is technically UB). * libcpu/riscv_disasm.c (riscv_disasm): Extend char mnebuf array to 50. Signed-off-by: Mark Wielaard --- libcpu/riscv_disasm.c | 5 -

[COMMITTED] unstrip: exit early if there are no sections in the stripped file

2025-06-01 Thread Mark Wielaard
If there is only section zero that shouldn't count. Then we would still try to work on an empty set of sections and give an obscure error later. * src/unstrip.c (copy_elided_sections): Check stripped_shnum <= 1. Signed-off-by: Mark Wielaard --- src/unstrip.c | 2 +- 1 file ch

[PATCH] libdw: Make __libdw_fde_by_offset static in libdw/fde.c

2025-05-31 Thread Mark Wielaard
__libdw_fde_by_offset is marked as an extern internal function in libdw/cfi.h (a not public header file). But it is (now) only used in libdw/fde.c, called from __libdw_find_fde. It was originally used for dwarf_cfi_validate_fde, but that function was deleted and never made public. So simplify thing

Re: [PATCH v3] libdw: Fix eu_search_tree TOCTOU bugs

2025-05-30 Thread Mark Wielaard
Hi Aaron, On Thu, May 29, 2025 at 05:44:32PM -0400, Aaron Merey wrote: > eu_tfind is used to facilitate lazy loading throughout libdw. > If a result is not found via eu_tfind, work is done to load > the result and cache it in an eu_search_tree. > > Some calls to eu_tfind allow for TOCTOU bugs. M

Re: [PATCH v2] libdw: Fix eu_search_tree TOCTOU bugs

2025-05-27 Thread Mark Wielaard
Hi Aaron, On Mon, May 19, 2025 at 03:10:30PM -0400, Aaron Merey wrote: > eu_tfind is used to facilitate lazy loading throughout libdw. > If a result is not found via eu_tfind, work is done to load > the result and cache it in an eu_search_tree. > > Some calls to eu_tfind allow for TOCTOU bugs. M

Re: [PATCH] backends/ppc_attrs.c: Add PPC long double tags

2025-05-27 Thread Mark Wielaard
Hi, On Tue, 2025-05-27 at 00:05 -0500, A. Wilcox wrote: > When an explicit type of long double is specified in the ELF > GNU_Power_ABI_FP attribute, elflint and friends were erroring out: > > section [36] '.gnu.attributes': offset 15: unrecognized GNU_Power_ABI_FP > attribute value 9 > > Ad

Re: [PATCH v2] src/readelf.c: Access symbol and version data only if available

2025-05-20 Thread Mark Wielaard
Hi Aaron, On Mon, May 19, 2025 at 03:02:07PM -0400, Aaron Merey wrote: > handle_dynamic_symtab can attempt to read symbol and version data from > file offset of 0 or address of 0 if the associated DT_ tags aren't found. > > Fix this by only reading symbol and version data when non-zero file > off

Re: [RFC] tests/run-stack-live-test.sh: prototype 'live' eu-stack testing

2025-05-15 Thread Mark Wielaard
Hi Serhei, On Wed, 2025-05-14 at 16:35 -0400, Serhei Makarov wrote: > There's also the possibility of awk being powerful enough to make > me want to use it. Do you know if awk is considered sufficiently > standard for the testsuite to depend on it? We already check for GNU awk in configure for ma

Re: [PATCH 6/6 v2] doc: Add elf_kind.3

2025-05-14 Thread Mark Wielaard
Hi Aaron, On Mon, 2025-05-12 at 20:33 -0400, Aaron Merey wrote: > v2: Mention ar(1) and that elfutils libelf does not support COFF object > files. > > On Thu, May 1, 2025 at 1:17 PM Mark Wielaard wrote: > > > > > +.SH SEE ALSO > > > +.BR libelf (3), >

Re: [PATCH 5/6 v2] doc: Add elf_hash.3

2025-05-14 Thread Mark Wielaard
Hi Aaron, On Mon, 2025-05-12 at 20:33 -0400, Aaron Merey wrote: > v2: Mention use with SHT_HASH and clarify that only the lower 32 bits of > the return value are used. Looks good. Thanks, Mark

Re: [PATCH 3/6 v2] doc: Add elf_fill.3

2025-05-14 Thread Mark Wielaard
Hi Aaron, On Mon, 2025-05-12 at 20:33 -0400, Aaron Merey wrote: > v2: Mention fill value only applies to new gaps and set Thread Safety > atrribute to 'MT-Unsafe race' Looks good. Thanks, Mark

Re: [PATCH 4/6] doc: Add elf_getbase.3

2025-05-14 Thread Mark Wielaard
Hi Aaron, On Mon, 2025-05-12 at 20:33 -0400, Aaron Merey wrote: > v2: mention that base offset returned is always 0 for non ELF_K_AR > kinds. Also mention elf_getaroff and elf_rawelf. Looks good. Thanks, Mark

Re: [PATCH 2/6 v2] doc: Add elf_end.3

2025-05-14 Thread Mark Wielaard
Hi Aaron, On Mon, 2025-05-12 at 20:33 -0400, Aaron Merey wrote: > v2: Mention elf arg may be NULL. Looks good. > On Wed, Apr 30, 2025 at 1:18 PM Mark Wielaard wrote: > > > > So we do have a tiny elf_begin.3 man page, but it doesn't really > > describe anything.

Re: [PATCH 1/6] doc/Makefile.am: Sort manpages in alphabetical order

2025-05-14 Thread Mark Wielaard
Hi Aaron, Yes, please. Thanks, Mark

Re: [RFC] tests/run-stack-live-test.sh: prototype 'live' eu-stack testing

2025-05-14 Thread Mark Wielaard
Hi Serhei, On Thu, 2025-05-08 at 18:28 -0400, Serhei Makarov wrote: > Missing a few pieces, but worth sharing as an RFC. My idea is to > ensure better test coverage for eu-stack and then > eu-stacktrace+libdwfl_stacktrace by running against a live process > with known content, stopped at a known l

Re: [PATCH] tests: Create random test_dir name

2025-05-13 Thread Mark Wielaard
Hi, On Tue, May 06, 2025 at 11:50:12AM +0200, Mark Wielaard wrote: > The testsuite relies on there being no files in the test directory > after the test finishes. A test will fail if the test dir cannot be > removed. But the test dir isn't really random, it uses the pid of the >

Re: [PATCH v2] src/readelf.c: Access symbol and version data only if available

2025-05-06 Thread Mark Wielaard
Hi Aaron, Hi Constantine, On Mon, 2025-05-05 at 10:44 -0400, Aaron Merey wrote: > handle_dynamic_symtab can attempt to read symbol and version data from > file offset of 0 or address of 0 if the associated DT_ tags aren't found. > > Fix this by only reading symbol and version data when non-zero f

[PATCH] tests: Create random test_dir name

2025-05-06 Thread Mark Wielaard
those to define test_dir. Signed-off-by: Mark Wielaard --- tests/test-subr.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/test-subr.sh b/tests/test-subr.sh index ea80cbec3bc7..2a956b47de2f 100644 --- a/tests/test-subr.sh +++ b/tests/test-subr.sh @@ -23,7 +23,9 @@ s

[COMMITTED] libdw: Add RPATH to MAIN_CHECK programs

2025-05-02 Thread Mark Wielaard
We want to test the program against the just build libelf.so not the system installed one. So add an RPATH to ../libelf. * libdw/Makefile.am (CHECK_DEF_FLAGS): Add -Wl,-rpath,../libelf. https://sourceware.org/bugzilla/show_bug.cgi?id=32929 Signed-off-by: Mark Wielaard --- libdw

Re: [PATCH] libdw: Fix eu_search_tree TOCTOU bugs

2025-05-02 Thread Mark Wielaard
Hi Aaron, On Tue, 2025-04-15 at 17:04 -0400, Aaron Merey wrote: > eu_tfind is used to facilitate lazy loading throughout libdw. > If a result is not found via eu_tfind, work is done to load > the result and cache it in an eu_search_tree. > > Some calls to eu_tfind allow for TOCTOU bugs. Multiple

Re: [PATCH 5/5] doc: Add elf_kind.3

2025-05-01 Thread Mark Wielaard
Hi Aaron, On Tue, 2025-04-01 at 00:05 -0400, Aaron Merey wrote: > diff --git a/doc/elf_kind.3 b/doc/elf_kind.3 > new file mode 100644 > index ..3caa2724 > --- /dev/null > +++ b/doc/elf_kind.3 > @@ -0,0 +1,71 @@ > +.TH ELF_KIND 3 2025-03-31 "Libelf" "Libelf Programmer's Manual" > + > +.SH N

Re: [PATCH 4/5] doc: Add elf_hash.3

2025-05-01 Thread Mark Wielaard
Hi Aaron, On Tue, 2025-04-01 at 00:05 -0400, Aaron Merey wrote: > diff --git a/doc/elf_hash.3 b/doc/elf_hash.3 > new file mode 100644 > index ..6082c8c8 > --- /dev/null > +++ b/doc/elf_hash.3 > @@ -0,0 +1,49 @@ > +.TH ELF_HASH 3 2025-03-31 "Libelf" "Libelf Programmer's Manual" > + > +.SH N

Re: [PATCH 3/5] doc: Add elf_getbase.3

2025-05-01 Thread Mark Wielaard
Hi Aaron, On Tue, 2025-04-01 at 00:05 -0400, Aaron Merey wrote: > diff --git a/doc/elf_getbase.3 b/doc/elf_getbase.3 > new file mode 100644 > index ..1934e1ac > --- /dev/null > +++ b/doc/elf_getbase.3 > @@ -0,0 +1,55 @@ > +.TH ELF_GETBASE 3 2025-03-31 "Libelf" "Libelf Programmer's Manual"

Re: [PATCH 2/5] doc: Add elf_fill.3

2025-05-01 Thread Mark Wielaard
Hi Aaron, On Tue, 2025-04-01 at 00:05 -0400, Aaron Merey wrote: > diff --git a/doc/elf_fill.3 b/doc/elf_fill.3 > new file mode 100644 > index ..9448b064 > --- /dev/null > +++ b/doc/elf_fill.3 > @@ -0,0 +1,53 @@ > +.TH ELF_FILL 3 2025-03-31 "Libelf" "Libelf Programmer's Manual" > + > +.SH N

Re: [PATCH 1/5] doc: Add elf_end.3

2025-04-30 Thread Mark Wielaard
Hi Aaron, On Tue, 2025-04-01 at 00:04 -0400, Aaron Merey wrote: > Signed-off-by: Aaron Merey > --- > doc/Makefile.am | 3 ++- > doc/elf_end.3 | 71 + > 2 files changed, 73 insertions(+), 1 deletion(-) > create mode 100644 doc/elf_end.3 > > dif

Re: [PATCH] src: fix DEREF_OF_NULL.RET.STAT in unstrip.c

2025-04-29 Thread Mark Wielaard
Hi Anton, On Thu, Feb 27, 2025 at 10:28:20PM +0100, Mark Wielaard wrote: > > diff --git a/src/unstrip.c b/src/unstrip.c > > index d70053de..35c04700 100644 > > --- a/src/unstrip.c > > +++ b/src/unstrip.c > > @@ -1974,6 +1974,9 @@ more sections in stripped file tha

Re: [PATCH] src: fix DEREF_OF_NULL.RET.STAT in readelf.c in

2025-04-29 Thread Mark Wielaard
Hi Anton, On Thu, Feb 27, 2025 at 10:02:19PM +0100, Mark Wielaard wrote: > On Thu, Feb 13, 2025 at 07:52:00PM +0300, Anton Moryakov wrote: > > Static analyzer reported: > > Return value of a function 'gelf_getehdr' is dereferenced at readelf.c:12443 > > witho

Re: [PATCH] scr: fix DEREF_OF_NULL.RET.STAT in ar.c

2025-04-29 Thread Mark Wielaard
Hi Anton, On Thu, Feb 27, 2025 at 06:12:36PM +0100, Mark Wielaard wrote: > The subject isn't super helpful unless you know the specific > terminology of the statuc analyzer you are using. It would be better to > say something like: > > ar: check whether elf_getarhdr retur

Sourceware infrastructure updates for Q1 2025

2025-04-22 Thread Mark Wielaard
Sourceware infrastructure community updates for Q1 2025 Sourceware has provided the infrastructure for core toolchain and developer tools projects for more than 25 years. https://sourceware.org/sourceware-25-roadmap.html Over the last couple of years, Sourceware has transformed from a purely volu

scraperbot protection - Patchwork and Bunsen behind Anubis

2025-04-21 Thread Mark Wielaard
Hi hackers, TLDR; When using https://patchwork.sourceware.org or Bunsen https://builder.sourceware.org/testruns/ you might now have to enable javascript. This should not impact any scripts, just browsers (or bots pretending to be browsers). If it does cause trouble, please let us know. If this wor

Re: [PATCH] src/readelf.c: Access symbol and version data only if available

2025-04-15 Thread Mark Wielaard
Hi Aaron, Hi Constantine, On Thu, 2025-04-10 at 10:52 -0400, Aaron Merey wrote: > handle_dynamic_symtab can attempt to read symbol and version data from > file offset 0 if the associated DT_ tags aren't found. > > Fix this by only reading symbol and version data when non-zero file > offsets have

Re: [PATCH] libdw: Add Nim language and dwarf_srclang tests

2025-04-08 Thread Mark Wielaard
Hi Aaron, On Tue, Apr 08, 2025 at 01:34:28PM -0400, Aaron Merey wrote: > LGTM. The optional main function approach opens up a lot of > possibilities for testing static functions throughout all elfutils > libraries. I hope to use the same mechanism to write some fuzzing wrappers so you don't have

Re: [PATCH] Avoid double-including config.h

2025-04-06 Thread Mark Wielaard
Hi Dmitry, On Fri, Apr 04, 2025 at 04:07:26PM +0300, Dmitry V. Levin wrote: > On Fri, Apr 04, 2025 at 01:55:48PM +0200, Mark Wielaard wrote: > > So to be (pedantically) correct should we include the attached? > > Yes, this should be fine, along with > > --- a/lib/crc32.

Re: [PATCH 1/3] Add some supporting framework for C11-style atomics.

2025-04-06 Thread Mark Wielaard
Hi Dmitry, On Fri, Apr 04, 2025 at 04:04:21PM +0300, Dmitry V. Levin wrote: > On Fri, Apr 04, 2025 at 01:38:01PM +0200, Mark Wielaard wrote: > > But maybe we should just use AC_CHECK_HEADERS([stdatomic.h]) and drop > > the AC_COMPILE_IFELSE trick? > > Sure. And if we want

Re: [PATCH 1/1] debuginfod: add --http-addr option

2025-04-05 Thread Mark Wielaard
Hi Michael, On Thu, 2025-03-13 at 12:05 +0100, Michael Trapp wrote: > Use MHD_OPTION_SOCK_ADDR to bind the http listen socket to a single address. > The address can be any IPv4 or IPv6 address configured on the system: > --http-addr=127.0.0.1 > --http-addr=::1 > --http-addr='ANY_ACTIVE

Re: [PATCH 1/3] Add some supporting framework for C11-style atomics.

2025-04-04 Thread Mark Wielaard
Hi Dmitry, On Thu, 2025-04-03 at 19:09 +0300, Dmitry V. Levin wrote: > On Thu, Aug 29, 2019 at 03:16:12PM +0200, Mark Wielaard wrote: > > From: Jonathon Anderson > > > > Uses the stdatomic.h provided by FreeBSD when GCC doesn't (ie. GCC < 4.9) > > &

Re: ☠ Buildbot (Sourceware): elfutils - failed test (failure) (main)

2025-04-04 Thread Mark Wielaard
Hi, On Fri, 2025-04-04 at 12:39 +, buil...@sourceware.org wrote: > A new failure has been detected on builder elfutils-debian-armhf while > building elfutils. > > Full details are available at: > https://builder.sourceware.org/buildbot/#/builders/6/builds/403 > > Build state: failed tes

Re: [PATCH] Avoid double-including config.h

2025-04-04 Thread Mark Wielaard
> of including config.h twice for all files that include both > and "system.h". So to be (pedantically) correct should we include the attached? Thanks, Mark From f14c00adb24bf15059821ca972e5d20a58b893fa Mon Sep 17 00:00:00 2001 From: Mark Wielaard Date: Fri, 4 Apr 2025 13:50:04 +02

Re: [PATCH v2] Add 'Key to Flags' to eu-readelf output [bz 29571]

2025-04-04 Thread Mark Wielaard
Hi Samuel, On Thu, 2025-04-03 at 17:24 +1000, Samuel Zeter wrote: > When printing section headers, also include a key to what each flag > is at the end of the section header output. > > Signed-off-by: Samuel Zeter Thanks, looks good. Committed with a slightly tweaked commit message: commit ef1

[PATCH] libdw: Add Nim language and dwarf_srclang tests

2025-04-02 Thread Mark Wielaard
CHECK. (main): Likewise. Signed-off-by: Mark Wielaard --- libdw/Makefile.am | 11 libdw/dwarf.h | 2 + libdw/dwarf_default_lower_bound.c | 2 + libdw/dwarf_srclang.c | 87 ++- 4 files changed, 101 insertions(

Re: [PATCH] debuginfod: add --listen-address option

2025-03-28 Thread Mark Wielaard
Hi Michael, On Thu, 2025-03-27 at 17:06 +0100, Michael Trapp wrote: > Use MHD_OPTION_SOCK_ADDR to bind the http listen socket to a single address. > The address should be an IPv4 or IPv6 address configured on the system: > --listen-address=127.0.0.1 > --listen-address=::1 > --listen-ad

Re: Sourceware Survey 2025

2025-03-28 Thread Mark Wielaard
On Fri, Mar 14, 2025 at 01:40:42AM +0100, Mark Wielaard wrote: > The Sourceware Project Leadership Committee would like to know who our > users are, which hosted projects they feel part of, what services they > rely on and what the priorities should be for new initiatives. &

Re: [PATCH] debuginfod: add --listen-address option

2025-03-27 Thread Mark Wielaard
Hi Michael, On Thu, Mar 27, 2025 at 04:43:49PM +0100, Michael Trapp wrote: > Use MHD_OPTION_SOCK_ADDR to bind the http listen socket to a single address. > The address should be an IPv4 or IPv6 address configured on the system: > --listen-address=127.0.0.1 > --listen-address=::1 > --li

Re: [COMMITTED] libdw/libdw_findcu.c: Fix TOCTOU race condition in __libdw_findcu

2025-03-27 Thread Mark Wielaard
Hi Aaron, On Thu, Mar 27, 2025 at 12:07:18AM -0400, Aaron Merey wrote: > Ensure that dwarf_lock is held before accessing next_tu_offset and > next_cu_offset. > > This fixes a TOCTOU bug in __libdw_findcu that causes NULL to be > incorrectly returned. Could you explain what the issue is in a few

[COMMITTED] tests/thread-safety-subr.sh: Change if [[ ]] to if [ ]

2025-03-26 Thread Mark Wielaard
Using [[ is a bashism. We can just use [ since this is a simple comparision. * tests/thread-safety-subr.sh: Use if [ instead of if [[. Signed-off-by: Mark Wielaard --- tests/thread-safety-subr.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/thread-safety

Re: [PATCH 1/1] debuginfod: add --http-addr option

2025-03-26 Thread Mark Wielaard
Hi Michael, On Thu, Mar 20, 2025 at 02:58:34PM +, Trapp, Michael wrote: > > Am 19.03.2025 um 13:35 schrieb Mark Wielaard : > > The code itself does look ok, although I think it could be simplified a > > little if we go for something like --listen-local only (assuming th

  1   2   3   4   5   6   7   8   9   10   >