[PATCH 7/7 v3] doc: Add elf_compress.3 and elf_compress_gnu.3

2025-07-14 Thread Aaron Merey
Signed-off-by: Aaron Merey --- v3: Use the libelf.h comment for elf_compress/elf_compress_gnu as the DESCRIPTION. Do not include ELFCOMPRESS_LOOS, ELFCOMPRESS_LOPROC, etc. as valid compression algorithm types. Mention that OS and arch-specific algorithm types aren't supported. doc/Makefi

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

2025-07-14 Thread Aaron Merey
Signed-off-by: Aaron Merey --- v3: Clarify that future operations might fail after ELF_C_FDDONE unless ELF_C_FDREAD is used first. doc/Makefile.am | 1 + doc/elf_cntl.3 | 70 + 2 files changed, 71 insertions(+) create mode 100644 doc/elf_cntl

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

2025-07-14 Thread Aaron Merey
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.  */ > > +  while ((subelf = elf_begin (fd, cmd, elf)) != NULL) > > +    { > > +    

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

2025-07-14 Thread Aaron Merey
Signed-off-by: Aaron Merey --- v3: Remove mention of elf_rand and elf_next invalidating Elf_Arhdr. Change thread safety attribute to MT-safe. doc/Makefile.am| 1 + doc/elf_getarhdr.3 | 78 ++ 2 files changed, 79 insertions(+) create mode 100644

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

2025-07-14 Thread Aaron Merey
error in elf_getaroff. Replace ELF_C_NULL with -1 as elf_getaroff's error return value. Signed-off-by: Aaron Merey --- libelf/elf_getaroff.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libelf/elf_getaroff.c b/libelf/elf_getaroff.c index 5c102ad6..5737b350 100644

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

2025-07-14 Thread Aaron Merey
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). doc/Makefile.am| 1 + doc/elf_getaroff.3 | 58 ++ 2 files changed, 59 inser

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

2025-07-14 Thread Aaron Merey
f its Elf_Arhdr from the archive descriptor. Also update tests/arextract.c with verification that each Elf_Arhdr is distinct and remains valid after calls to elf_next that would have previously invalidated the Elf_Arhdr. Signed-off-by: Aaron Merey --- libelf/elf_begin.c| 5 +++- libelf/elf_cl

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

2025-06-30 Thread Aaron Merey
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 doc/elf_getshdrnum.3 create mode 100644 doc/elf_getshnum.3 diff --git a/doc

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

2025-06-30 Thread Aaron Merey
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/Makefile.am b/doc/Makefile.am index dc4a8b18..f7446872 100644 --- a/doc

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

2025-06-30 Thread Aaron Merey
Signed-off-by: Aaron Merey --- doc/Makefile.am | 1 + doc/elf_rawfile.3 | 71 +++ 2 files changed, 72 insertions(+) create mode 100644 doc/elf_rawfile.3 diff --git a/doc/Makefile.am b/doc/Makefile.am index 7d5a3eef..50ab63ec 100644 --- a/doc

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

2025-06-30 Thread Aaron Merey
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 --git a/doc/Makefile.am b/doc/Makefile.am index 374e5d49..7d5a3eef 100644 --- a/doc

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

2025-06-30 Thread Aaron Merey
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 --git a/doc/Makefile.am b/doc/Makefile.am index 98712576..97aac570 100644 --- a/doc

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

2025-06-30 Thread Aaron Merey
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 --git a/doc/Makefile.am b/doc/Makefile.am index 022906bb..9ef2b60d 100644 --- a/doc

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

2025-06-30 Thread Aaron Merey
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 --git a/doc/Makefile.am b/doc/Makefile.am index 8afda0bd..d3fd9a49 100644 --- a/doc

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

2025-06-30 Thread Aaron Merey
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_gnu_hash.3 diff --git a/doc/Makefile.am b/doc/Makefile.am index 129c612d..98712576

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

2025-06-30 Thread Aaron Merey
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 diff --git a/doc/Makefile.am b/doc/Makefile.am index 3b63dc38..8afda0bd

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

2025-06-30 Thread Aaron Merey
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/doc/Makefile.am b/doc/Makefile.am index 50ab63ec..dc4a8b18 100644 --- a/doc

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

2025-06-30 Thread Aaron Merey
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 --git a/doc/Makefile.am b/doc/Makefile.am index d3fd9a49..5c1cd51e 100644 --- a/doc

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

2025-06-30 Thread Aaron Merey
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 --git a/doc/Makefile.am b/doc/Makefile.am index 3ed04cd7..e5b12133 100644 --- a/doc

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

2025-06-30 Thread Aaron Merey
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/doc/Makefile.am b/doc/Makefile.am index 9ef2b60d..374e5d49 100644 --- a/doc

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

2025-06-30 Thread Aaron Merey
Signed-off-by: Aaron Merey --- doc/Makefile.am | 2 ++ doc/elf_getshdrstrndx.3 | 80 + doc/elf_getshstrndx.3 | 1 + 3 files changed, 83 insertions(+) create mode 100644 doc/elf_getshdrstrndx.3 create mode 100644 doc/elf_getshstrndx.3 diff

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

2025-06-30 Thread Aaron Merey
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 --git a/doc/Makefile.am b/doc/Makefile.am index 97aac570..022906bb 100644 --- a/doc

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

2025-06-30 Thread Aaron Merey
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 | 1 + doc/elf_flagscn.3 | 1 + doc/elf_flagshdr.3 | 1 + 7 files changed, 156

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

2025-06-29 Thread Aaron Merey
. * src/threadlib.h: New file. Declares functions add_job and run_jobs. Signed-off-by: Aaron Merey --- v3: Document that add_job cannot be called during run_jobs. Add noinst_HEADERS and EXTRA_libtreahd_a_DEPENDENCIES to src/Makefile.am Replace a printf call with fwrite. Add a

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

2025-06-29 Thread Aaron Merey
IGNORE_FMT_NONLITERAL_* are mostly used within hotpath loops where caching makes a signficant difference. Runtime improvements of up to 13% faster have been observed with this patch applied. Signed-off-by: Aaron Merey --- src/readelf.c | 222 ++ 1 file

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

2025-06-29 Thread Aaron Merey
enabled. Signed-off-by: Aaron Merey --- v4: allow num_thread jobs instead of num_thread - 1 heap alloc job_data Use max_threads instead of max_threads - 1 for determining the maximum number of jobs running concurrently. Improve error output when the argument to -C is invalid. Allocate the job_data

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

2025-06-23 Thread Aaron Merey
Hi Mark, On Sun, Jun 22, 2025 at 10:19 AM Mark Wielaard wrote: > > dwfl_module_getsym returns the name of a symbol as found in the > corresponding (symbol) string section. Make sure all names are > correctly zero terminated by making sure the last valid index in a > section/segment Elf_Data conta

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

2025-06-23 Thread Aaron Merey
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 . > > +If > > +.I elf > > +is NULL or is not

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

2025-06-23 Thread Aaron Merey
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. doc/Makefile.am| 1 + doc/elf_getarhdr.3 | 80 ++ 2 files changed, 81

[PATCH] libdwP.h: Remove abbrev_lock

2025-06-22 Thread Aaron Merey
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 and requires no locking. Signed-off-by: Aaron Merey --- libdw

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

2025-06-22 Thread Aaron Merey
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. doc/Makefile.am | 1 + doc/elf_next.3 | 120 2 files changed, 121

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

2025-06-22 Thread Aaron Merey
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/Makefile.am b/doc/Makefile.am index d0ec20da..de0106bb 100644 --- a/doc

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

2025-06-22 Thread Aaron Merey
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 100644 doc/elf_compress.3 create mode 100644 doc/elf_compress_gnu.3 diff --git

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

2025-06-22 Thread Aaron Merey
Signed-off-by: Aaron Merey --- v2: Clarify that narsyms can be NULL and that the end of the archive symbol table contains a special NULL entry. doc/Makefile.am| 1 + doc/elf_getarsym.3 | 99 ++ 2 files changed, 100 insertions(+) create mode

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

2025-06-09 Thread Aaron Merey
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 --git a/doc/Makefile.am b/doc/Makefile.am index 6451ffab..aae29ebc 100644 --- a/doc

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

2025-06-09 Thread Aaron Merey
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 --git a/doc/Makefile.am b/doc/Makefile.am index aae29ebc..d0ec20da 100644 --- a/doc

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

2025-06-09 Thread Aaron Merey
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/doc/Makefile.am b/doc/Makefile.am index fbfebfe0..6451ffab 100644 --- a/doc

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

2025-06-09 Thread Aaron Merey
Signed-off-by: Aaron Merey --- doc/Makefile.am | 1 + doc/elf_next.3 | 66 + 2 files changed, 67 insertions(+) create mode 100644 doc/elf_next.3 diff --git a/doc/Makefile.am b/doc/Makefile.am index 1ced7858..fbfebfe0 100644 --- a/doc

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

2025-06-06 Thread Aaron Merey
On Fri, Jun 6, 2025 at 8:49 AM Mark Wielaard wrote: > > 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/pro

[PATCH v2] doc: Update elf_begin.3

2025-06-05 Thread Aaron Merey
Signed-off-by: Aaron Merey --- v2: Address Mark's suggestions https://patchwork.sourceware.org/project/elfutils/patch/20250603012245.411580-1-ame...@redhat.com/ doc/elf_begin.3 | 118 ++-- 1 file changed, 93 insertions(+), 25 deletions(-) diff

[PATCH] doc: Update elf_begin.3

2025-06-02 Thread Aaron Merey
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..cddd181f 100644 --- a/doc/elf_begin.3 +++ b/doc/elf_begin.3 @@ -1,37 +1,91

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

2025-06-02 Thread Aaron Merey
On Mon, Jun 2, 2025 at 5:29 PM wrote: > > A new failure has been detected on builder elfutils-debian-amd64 while > building elfutils. > > Full details are available at: > https://builder.sourceware.org/buildbot/#/builders/52/builds/518 > > Build state: failed test (failure) > Revision: 06f052

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

2025-06-02 Thread Aaron Merey
Hi Mark, On Sat, May 31, 2025 at 6:17 PM Mark Wielaard wrote: > > __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_f

Re: [PATCH v3] libdwfl: resolve all paths relative to sysroot

2025-06-02 Thread Aaron Merey
On Mon, Jun 2, 2025 at 8:47 AM Michal Sekletar wrote: > > Whenever possible, resolve all symlinks as if the sysroot path were a > chroot environment. This prevents potential interactions with files from > the host filesystem. > > Signed-off-by: Michal Sekletar > --- > configure.ac

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

2025-05-30 Thread Aaron Merey
Hi Anna, On Thu, May 29, 2025 at 11:43 PM A. Wilcox wrote: > > Unfortunately, the only reference I am aware of for GNU attributes is > the GCC compiler source itself; these constants are defined in > gcc/config/rs6000/rs6000.cc in rs6000_elf_file_end. LGTM, I've pushed this patch. Thanks, Aaron

[PATCH v3] libdw: Fix eu_search_tree TOCTOU bugs

2025-05-29 Thread Aaron Merey
eclare new mutex. libdw_findcu.c (__libdw_intern_next_unit): Initialize intern_lock. (__libdw_findcu): Adjust locking so that the first eu_tfind can be done without extra lock overhead. Signed-off-by: Aaron Merey v3: Implement _nolock functions as inline functions a

Re: [PATCH v2] libdwfl: resolve all paths relative to sysroot

2025-05-28 Thread Aaron Merey
Hi Michal, On Wed, May 28, 2025 at 8:30 AM Michal Sekletar wrote: > > I finally got back to this patchset but I am wondering how to address your > nitpick. Difference is that in one case $sysroot/usr/bin/bash is an actual > binary and in another case it is a symlink. Hence it can't be both at t

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

2025-05-27 Thread Aaron Merey
* function pointers and args to schedule_job. Also call run_jobs if thread safety is enabled. Signed-off-by: Aaron Merey --- v3: Replace assert before run_jobs with a conditional. src/readelf.c | 153 -- 1 file changed, 149

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

2025-05-22 Thread Aaron Merey
* function pointers and args to schedule_job. Also call run_jobs if thread safety is enabled. Signed-off-by: Aaron Merey --- v2: Replace max_worker_threads with max_threads for clarity. Avoid creating threads when max_threads is set to 1. src/readelf.c | 152

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

2025-05-22 Thread Aaron Merey
. * src/threadlib.h: New file. Declares functions add_job and run_jobs. Signed-off-by: Aaron Merey --- v2: Remove unnecessary thread_LDADD variable in src/Makefile.am. Minor comment rewordings. src/Makefile.am | 16 +++ src/threadlib.c | 252

[PATCH v2] libdw: Fix eu_search_tree TOCTOU bugs

2025-05-19 Thread Aaron Merey
eclare new mutex. libdw_findcu.c (__libdw_intern_next_unit): Initialize intern_lock. (__libdw_findcu): Adjust locking so that the first eu_tfind can be done without extra lock overhead. Signed-off-by: Aaron Merey --- v2: _nolock variants of eu_t* functions have bee

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

2025-05-19 Thread Aaron Merey
gi?id=32864 Suggested-by: Constantine Bytensky Signed-off-by: Aaron Merey --- v2: Verify that verneed_data and verdef_data sizes are sufficient. src/readelf.c | 96 +-- 1 file changed, 63 insertions(+), 33 deletions(-) diff --git a/src/readel

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

2025-05-14 Thread Aaron Merey
On Wed, May 14, 2025 at 10:16 AM Mark Wielaard wrote: > > 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 Wie

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

2025-05-14 Thread Aaron Merey
On Thu, May 8, 2025 at 6:28 PM 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 location, and

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

2025-05-12 Thread Aaron Merey
Signed-off-by: Aaron Merey --- v2: Mention use with SHT_HASH and clarify that only the lower 32 bits of the return value are used. doc/Makefile.am | 1 + doc/elf_hash.3 | 51 + 2 files changed, 52 insertions(+) create mode 100644 doc/elf_hash

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

2025-05-12 Thread Aaron Merey
Signed-off-by: Aaron Merey --- v2: Mention fill value only applies to new gaps and set Thread Safety atrribute to 'MT-Unsafe race' doc/Makefile.am | 1 + doc/elf_fill.3 | 53 + 2 files changed, 54 insertions(+) create mode 100644 do

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

2025-05-12 Thread Aaron Merey
Signed-off-by: Aaron Merey 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), > > +.BR elf (5) > > elf.5 doesn't describe the ar format,

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

2025-05-12 Thread Aaron Merey
Signed-off-by: Aaron Merey --- v2: mention that base offset returned is always 0 for non ELF_K_AR kinds. Also mention elf_getaroff and elf_rawelf. doc/Makefile.am | 1 + doc/elf_getbase.3 | 59 +++ 2 files changed, 60 insertions(+) create mode

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

2025-05-12 Thread Aaron Merey
Signed-off-by: Aaron Merey --- v2: Mention elf arg may be NULL. 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. The above seems a technically correct description of > ELF de

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

2025-05-12 Thread Aaron Merey
Signed-off-by: Aaron Merey --- doc/Makefile.am | 50 - 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/doc/Makefile.am b/doc/Makefile.am index c95369e9..b75711ca 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -27,37 +27,37

Re: [PATCH] PR32930 backends/: guard asm/perf_regs.h include

2025-05-06 Thread Aaron Merey
Hi Serhei, On Mon, May 5, 2025 at 12:26 PM Serhei Makarov wrote: > > asm/perf_regs.h is an arch-specific linux include, not present on > architectures like hppa and m68k that lack perf_events support. > > Only one place we need to fix; others already guard the include by > architecture, or use ar

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

2025-05-05 Thread Aaron Merey
gi?id=32864 Suggested-by: Constantine Bytensky Signed-off-by: Aaron Merey --- v2 changes: Added checks for unset addrs and missing symbol version data. src/readelf.c | 82 ++- 1 file changed, 49 insertions(+), 33 deletions(-) diff --git a/src/read

elfutils 0.193 released

2025-04-25 Thread Aaron Merey
: Improved handling of corrupt ELF data. --section-headers output now includes a "Key to Flags" explaining section flag meanings. * GIT SHORTLOG * Aaron Merey (22): configure.ac: Fix ENABLE_IMA_VERIFICATION conditional tests/.gitignore: Add newzdata strip: Ignore --reloc

Re: [PATCH v6 01/12] libebl [1/12]: api for perf register handling, start with x86_64

2025-04-25 Thread Aaron Merey
On Fri, Apr 25, 2025 at 10:56 AM Serhei Makarov wrote: > > Changes for v6: > > - Minor fixes as requested. > > Changes for v2: > > - Merged commit 11 into commit 1 (both sample_base_addr/sample_pc and > set_initial_registers_sample make sense to introduce in the same > commit). > > - Added i38

Re: [PATCH v5 06/12] libdwfl_stacktrace [6/12]: Elf* caching via dwflst_process_tracker

2025-04-25 Thread Aaron Merey
On Fri, Apr 25, 2025 at 9:56 AM Serhei Makarov wrote: > > > > On Fri, Apr 25, 2025, at 1:57 AM, Aaron Merey wrote: > > Also if you haven't done so already, please run any manual tests under > > valgrind memcheck (and helgrind if you are able to test this with

Re: [PATCH v5 12/12] eu-stacktrace [12/12]: use dwflst_perf_sample_getframes

2025-04-24 Thread Aaron Merey
On Thu, Apr 24, 2025 at 5:52 PM Serhei Makarov wrote: > > Changes for v4: > > - Separate out libdwfl_stacktrace, as requested. > > Changes for v3: > > - Fix initialization of elf in sysprof_init_dwfl > (previously triggered -Wmaybe-uninitialized). > > * * * > > Remove the code from src/stacktrac

Re: [PATCH v5 11/12] libdwfl_stacktrace [11/12]: add dwflst_perf_sample_getframes

2025-04-24 Thread Aaron Merey
On Thu, Apr 24, 2025 at 5:53 PM Serhei Makarov wrote: > > Changes for v4: > > - Separate out libdwfl_stacktrace, as requested. > > Changes for v3: > > - use const void *stack, not void *, to allow users > to pass a const stack sample > > Changes for v2: > > - use renamed __libdwfl_set_initial_re

Re: [PATCH v5 10/12] eu-stacktrace [10/12]: use dwflst_tracker_find_pid

2025-04-24 Thread Aaron Merey
On Thu, Apr 24, 2025 at 5:49 PM Serhei Makarov wrote: > > Changes for v4: > > - Separate out libdwfl_stacktrace, as requested. > > * * * > > Initial minimal change to ensure dwflst_tracker_find_pid is > tested. For now, we keep the additional dwfltab implementation in > stacktrace.c, since it's be

Re: [PATCH v5 09/12] libdwfl_stacktrace [9/12]: add dwflst_tracker_find_pid

2025-04-24 Thread Aaron Merey
On Thu, Apr 24, 2025 at 5:49 PM Serhei Makarov wrote: > > Changes for v4: > > - Separate out libdwfl_stacktrace, as requested. > > Changes for v2: > > - Add locking for dwfltab. > > * * * > > New function that retrieves the Dwfl for a particular PID, or, > if the Dwfl is absent, creates it via a p

Re: [PATCH v5 08/12] libdwfl_stacktrace [8/12]: Dwfl* caching via Dwflst_Process_Tracker

2025-04-24 Thread Aaron Merey
On Thu, Apr 24, 2025 at 5:52 PM Serhei Makarov wrote: > > Changes for v4: > > - Separate out libdwfl_stacktrace, as requested. > > Changes for v3: > > - Handle dwfl->process == NULL case in __libdwfl_remove_dwfl_from_tracker. > > * * * > > The Dwflst_Process_Tracker also includes a dynamicsizehash

Re: [PATCH v5 07/12] eu-stacktrace [7/12]: use Dwflst_Process_Tracker for Elf * caching

2025-04-24 Thread Aaron Merey
On Thu, Apr 24, 2025 at 5:50 PM Serhei Makarov wrote: > > Changes for v4: > > - Separate out libdwfl_stacktrace, as requested. > > * * * > > * src/Makefile.am (AM_CPPFLAGS): Include headers from > ../libdwfl_stacktrace. > * src/stacktrace.c (tracker): New global variable. > (sample_callbacks):

Re: [PATCH v5 06/12] libdwfl_stacktrace [6/12]: Elf* caching via dwflst_process_tracker

2025-04-24 Thread Aaron Merey
On Thu, Apr 24, 2025 at 5:52 PM Serhei Makarov wrote: > > Changes for v5: > > - Bugfixes in dwflst_tracker_find_elf.c. > > Changes for v4: > > - Separate out libdwfl_stacktrace, as requested. > > - dwfl_module_getdwarf.c now uses the dwflst_tracker_cache_elf() > interface instead of editing the

Re: [PATCH v5 05/12] libdwfl_stacktrace [5/12]: introduce Dwflst_Process_Tracker

2025-04-24 Thread Aaron Merey
On Thu, Apr 24, 2025 at 5:48 PM Serhei Makarov wrote: > > Changes for v4: > > - Separate out libdwfl_stacktrace, as requested. > > * * * > > New data structure to coordinate caching Elf data among multiple Dwfl > structs attached to different processes. Meant to reduce the overhead > for profilers

Re: [PATCH v5 04/12] libdwfl_stacktrace [4/12]: intro library, add dwflst_perf_sample_preferred_regs_mask

2025-04-24 Thread Aaron Merey
On Thu, Apr 24, 2025 at 5:50 PM Serhei Makarov wrote: > > Changes for v5: > > - Separate ELFUTILS_0.193_EXPERIMENTAL namespace, mark library experimental. > > Changes for v4: > > - Separate out libdwfl_stacktrace, as requested. > > Changes for v2: > > - guard the linux/perf_events.h include proper

Re: [PATCH v5 03/12] libebl [3/12]: eu-stacktrace: use new register handling api

2025-04-24 Thread Aaron Merey
On Thu, Apr 24, 2025 at 5:48 PM Serhei Makarov wrote: > > Changes for v4: > > - Since __libdwfl_set_initial_registers_thread is now private to > libdwfl, the modified code in this patch has been disabled. > > * * * > > Dummy commit to show how the sample_set_initial_registers callback in > eu-st

Re: [PATCH v5 02/12] libdwfl [2/12]: expose setfunc callback for libdwflP+libebl clients

2025-04-24 Thread Aaron Merey
On Thu, Apr 24, 2025 at 5:48 PM Serhei Makarov wrote: > > Changes for v2: > > - No longer exposing this in public libdwfl.h api. > > * * * > > Renaming pid_set_initial_registers to > __libdwfl_set_initial_registers_thread and adding to libdwflP.h. > > This callback was private to one file, but now

Re: [PATCH v5 01/12] libebl [1/12]: api for perf register handling, start with x86_64

2025-04-24 Thread Aaron Merey
On Thu, Apr 24, 2025 at 5:49 PM Serhei Makarov wrote: > > Changes for v2: > > - Merged commit 11 into commit 1 (both sample_base_addr/sample_pc and > set_initial_registers_sample make sense to introduce in the same > commit). > > - Added i386 backend and factored out common code. > > * * * > >

Re: [PATCH 04/13] libdwfl [4/13]: add dwfl_perf_sample_preferred_regs_mask

2025-04-22 Thread Aaron Merey
On Tue, Apr 22, 2025 at 10:24 AM Serhei Makarov wrote: > > On Tue, Apr 22, 2025, at 10:17 AM, Aaron Merey wrote: > >> One question this raises re: the Dwfl_Process_Tracker structure and where > >> its implementation should be located. In the patches, the Dwfl struct >

Re: [PATCH 04/13] libdwfl [4/13]: add dwfl_perf_sample_preferred_regs_mask

2025-04-22 Thread Aaron Merey
On Tue, Apr 22, 2025 at 9:53 AM Serhei Makarov wrote: > On Tue, Apr 22, 2025, at 9:45 AM, Aaron Merey wrote: > > > > Let's move the process_tracker interface as well for additional > > flexibility to modify if needed. As for a name, I like > > libdwfl_stacktr

Re: [PATCH 04/13] libdwfl [4/13]: add dwfl_perf_sample_preferred_regs_mask

2025-04-22 Thread Aaron Merey
Hi Serhei, On Tue, Apr 22, 2025 at 9:27 AM Serhei Makarov wrote: > > On Mon, Apr 21, 2025, at 12:29 AM, Aaron Merey wrote:. > > > > I know we're close to the next release and I do want this work to be > > included. My proposal is to move the current API out of libdw

Re: [PATCH 04/13] libdwfl [4/13]: add dwfl_perf_sample_preferred_regs_mask

2025-04-20 Thread Aaron Merey
Hi Serhei, On Thu, Mar 20, 2025 at 9:24 AM Serhei Makarov wrote: > > On Wed, Mar 19, 2025, at 5:36 PM, Mark Wielaard wrote: > > > > On Sun, Mar 16, 2025 at 07:14:11PM -0400, Serhei Makarov wrote: > >> Since libebl is a private interface, subsequent patches in the series > >> introduce another api

[PATCH] libdw: Fix eu_search_tree TOCTOU bugs

2025-04-15 Thread Aaron Merey
f): Update macro_lock comment. (struct Dwarf_CU): Declare new mutex. libdw_findcu.c (__libdw_intern_next_unit): Initialize intern_lock. (__libdw_findcu): Adjust locking so that the first eu_tfind can be done without extra lock overhead. Signed-off-by: Aaron Merey

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

2025-04-10 Thread Aaron Merey
Hi Mark, On Wed, Apr 2, 2025 at 8:50 AM Mark Wielaard wrote: > > DW_LANG_Nim and DW_LNAME_Nim were added to the DWARF languages. > > While adding them, and the default lower bounds, I noticed DW_LANG_V > and DW_LANG_Algol68 where missing in srclang_to_language an internal > helper function. > > T

Re: [PATCH v2] libdwfl: resolve all paths relative to sysroot

2025-04-10 Thread Aaron Merey
Hi Michal, On Tue, Apr 1, 2025 at 2:56 PM Michal Sekletar wrote: > > Whenever possible, resolve all symlinks as if the sysroot path were a > chroot environment. This prevents potential interactions with files from > the host filesystem. > > Signed-off-by: Michal Sekletar > --- > configure.ac

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

2025-04-10 Thread Aaron Merey
ed-by: Constantine Bytensky Signed-off-by: Aaron Merey --- src/readelf.c | 50 +++--- 1 file changed, 31 insertions(+), 19 deletions(-) diff --git a/src/readelf.c b/src/readelf.c index 5b0e7b47..0452977f 100644 --- a/src/readelf.c +++ b/src/readelf.c @@ -30

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

2025-04-05 Thread Aaron Merey
Signed-off-by: Aaron Merey --- doc/Makefile.am | 3 ++- doc/elf_getbase.3 | 55 +++ 2 files changed, 57 insertions(+), 1 deletion(-) create mode 100644 doc/elf_getbase.3 diff --git a/doc/Makefile.am b/doc/Makefile.am index 0dec1fc7..56c56b7b

Preparing for the 0.193 release on Friday April 25

2025-04-01 Thread Aaron Merey
Hi everyone, We are planning to do the 0.193 release on Friday April 25. Since the 0.192 release last October there have been 66 commits. Among these are some important bug fixes and new features. If your patch is still under review [1] or you have other patches you'd like merged before the rel

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

2025-03-31 Thread Aaron Merey
Hi Frank, On Mon, Mar 31, 2025 at 6:29 PM Frank Ch. Eigler wrote: > > > Due to significant lock contention, running eu-readelf when configured > > with --enable-thread-safety causes a major performance degradation. > > Currently, concurrency may double the runtime of eu-readelf. > > > However I t

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

2025-03-31 Thread Aaron Merey
Signed-off-by: Aaron Merey --- doc/Makefile.am | 3 ++- doc/elf_hash.3 | 49 + 2 files changed, 51 insertions(+), 1 deletion(-) create mode 100644 doc/elf_hash.3 diff --git a/doc/Makefile.am b/doc/Makefile.am index 56c56b7b..260a3f09 100644

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

2025-03-31 Thread Aaron Merey
Signed-off-by: Aaron Merey --- doc/Makefile.am | 3 ++- doc/elf_kind.3 | 71 + 2 files changed, 73 insertions(+), 1 deletion(-) create mode 100644 doc/elf_kind.3 diff --git a/doc/Makefile.am b/doc/Makefile.am index 260a3f09..8028acb0 100644

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

2025-03-31 Thread Aaron Merey
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 diff --git a/doc/Makefile.am b/doc/Makefile.am index c95369e9..36f1855f 100644

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

2025-03-31 Thread Aaron Merey
Signed-off-by: Aaron Merey --- doc/Makefile.am | 3 ++- doc/elf_fill.3 | 53 + 2 files changed, 55 insertions(+), 1 deletion(-) create mode 100644 doc/elf_fill.3 diff --git a/doc/Makefile.am b/doc/Makefile.am index 36f1855f..0dec1fc7 100644

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

2025-03-29 Thread Aaron Merey
* function pointers and args to schedule_job. Also call run_jobs if thread safety is enabled. Signed-off-by: Aaron Merey --- Due to significant lock contention, running eu-readelf when configured with --enable-thread-safety causes a major performance degradation. Currently

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

2025-03-29 Thread Aaron Merey
. * src/threadlib.h: New file. Declares functions add_job and run_jobs. Signed-off-by: Aaron Merey --- src/Makefile.am | 17 src/threadlib.c | 253 src/threadlib.h | 34 +++ 3 files changed, 304 insertions(+) create mode

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

2025-03-27 Thread Aaron Merey
Hi Mark, On Thu, Mar 27, 2025 at 4:51 AM Mark Wielaard wrote: > > 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 TOCT

[COMMITTED] tests/.gitignore: Add dwarf_language_lower_bound, test-manyfuncs

2025-03-26 Thread Aaron Merey
Signed-off-by: Aaron Merey --- tests/.gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/.gitignore b/tests/.gitignore index f8869b40..6ae12adb 100644 --- a/tests/.gitignore +++ b/tests/.gitignore @@ -41,6 +41,7 @@ /dwarf_default_lower_bound /dwarfcfi

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

2025-03-26 Thread Aaron Merey
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. Signed-off-by: Aaron Merey --- libdw/libdw_findcu.c | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff

Re: [PATCH 3/4] libdw: Make dwarf_srclang forward compatible with DW_AT_language_name

2025-03-26 Thread Aaron Merey
Hi Mark, On Tue, Mar 11, 2025 at 6:00 AM Mark Wielaard wrote: > > For programs which use dwarf_srclang it might be useful to translate a > DW_LNAME (plus version) into a DW_LANG constant if there is no > DW_AT_language constant, but there is a DW_AT_language_name (and > DW_AT_language_version). >

Re: [PATCH 4/4] readelf: Add support for printing DW_AT_language_name DW_LNAMEs

2025-03-26 Thread Aaron Merey
Hi Mark, On Tue, Mar 11, 2025 at 6:01 AM Mark Wielaard wrote: > > Add a testfile using GCC 15 (experimental). > > * libdw/dwarf.h: Add DW_LNAME_lo_user and DW_LNAME_hi_user. > * src/readelf.c (dwarf_lname_string): New function. > (dwarf_lname_name): Likewise. >

Re: [PATCH 2/4] libdw: Add dwarf_language and dwarf_language_lower_bound functions.

2025-03-26 Thread Aaron Merey
Hi Mark, On Tue, Mar 11, 2025 at 5:59 AM Mark Wielaard wrote: > > dwarf_language returns a DW_LNAME constant for a CU Die. If the CU Die > has a DW_AT_language_name attribute dwarf_language will return it and > the DW_AT_language_version attribute value. Otherwise dwarf_language > will lookup the

  1   2   3   4   >