[COMMITTED] elfutils.spec.in: Add gelf man pages to %{_mandir}

2025-09-16 Thread Aaron Merey
Signed-off-by: Aaron Merey --- config/elfutils.spec.in | 1 + 1 file changed, 1 insertion(+) diff --git a/config/elfutils.spec.in b/config/elfutils.spec.in index 8259e032..1edaef59 100644 --- a/config/elfutils.spec.in +++ b/config/elfutils.spec.in @@ -326,6 +326,7 @@ fi %{_mandir}/man3/elf_*.3

[PATCH 2/4 v3] doc: Add elf_memory.3

2025-09-14 Thread Aaron Merey
Signed-off-by: Aaron Merey --- v3: Mention that the underlying memory image should be writable since libelf may attempt to modify it. Remove some implementation details. doc/Makefile.am | 1 + doc/elf_memory.3 | 85 2 files changed, 86

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

2025-09-14 Thread Aaron Merey
Signed-off-by: Aaron Merey --- doc/Makefile.am| 1 + doc/gelf_getehdr.3 | 62 ++ 2 files changed, 63 insertions(+) create mode 100644 doc/gelf_getehdr.3 diff --git a/doc/Makefile.am b/doc/Makefile.am index 1230480e..3c22f0aa 100644 --- a/doc

[PATCH 1/4 v3] doc: Add elf_flag*.3

2025-09-14 Thread Aaron Merey
Signed-off-by: Aaron Merey --- v3 changes: Fix unbalanced " in SYNOPSIS. Reword ELF_F_LAYOUT description and mention that phdr offset changes will prevent automatic changes to shdr offset changes during elf_update. Mention that ELF_F_PERMISSIVE is an elfutils extention. doc/Makefi

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

2025-09-14 Thread Aaron Merey
Signed-off-by: Aaron Merey --- doc/Makefile.am | 1 + doc/gelf_getclass.3 | 63 + 2 files changed, 64 insertions(+) create mode 100644 doc/gelf_getclass.3 diff --git a/doc/Makefile.am b/doc/Makefile.am index 96d35d20..1230480e 100644 --- a/doc

Re: [PATCH 1/3] elf_getarhdr.c: Return correct header for archive within an archive

2025-09-09 Thread Aaron Merey
Hi Mark, On Tue, Sep 9, 2025 at 10:24 AM Mark Wielaard wrote: > > Hi Aaron, > > On Sun, 2025-09-07 at 22:17 -0400, Aaron Merey wrote: > > If elf_getarhdr is called on a descriptor that refers to an archive that > > is itself a member of an outer archive, it may return

Re: [PATCH 2/3] elf_begin.c: Use relative offset in archive size check

2025-09-09 Thread Aaron Merey
Hi Mark, On Mon, Sep 8, 2025 at 6:04 PM Mark Wielaard wrote: > > Hi Aaron, > > On Sun, Sep 07, 2025 at 10:17:28PM -0400, Aaron Merey wrote: > > Before creating an elf descriptor for an archive member, dup_elf > > verifies that the size of an archive is large enough t

[PATCH 3/3] readelf.c: Close dwfl if dwfl_report_offline fails

2025-09-07 Thread Aaron Merey
Within create_dwfl, if dwfl_begin is successful but dwfl_report_offline fails, the dwfl * pointer being reported is reset to NULL without calling dwfl_end, causing a memory leak. Update create_dwfl to call dwfl_end in this case, preventing the leak. Signed-off-by: Aaron Merey --- src/readelf.c

[PATCH 2/3] elf_begin.c: Use relative offset in archive size check

2025-09-07 Thread Aaron Merey
nd ar_rawname if the size check fails. Signed-off-by: Aaron Merey --- libelf/elf_begin.c | 20 +++- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/libelf/elf_begin.c b/libelf/elf_begin.c index 823a4324..037a4234 100644 --- a/libelf/elf_begin.c +++ b/libelf/elf_beg

Re: [PATCH] libelf: Check ELF parent size can contain ar member

2025-09-07 Thread Aaron Merey
Hi Evgeny, On Sun, Sep 7, 2025 at 11:31 AM Evgeny wrote: > On Sun, 7 Sept 2025 at 00:58, Mark Wielaard wrote: > > > I can confirm that this patch (combined with the patch where > > > libdw_open_elf > > > is fixed) addresses several issues reported by OSS-Fuzz. As far as I can > > > see > > > s

[PATCH 1/3] elf_getarhdr.c: Return correct header for archive within an archive

2025-09-07 Thread Aaron Merey
ors associated with a parent archive and elf_end will free ar_ar_hdr.ar_name and ar_ar_hdr.ar_rawname. Siged-off-by: Aaron Merey --- This series addresses the following bugs: https://issues.oss-fuzz.com/issues/440209723 https://issues.oss-fuzz.com/issues/440177309 There is at least one other bug in

[PATCH] libdw_open_elf: Avoid invalid free

2025-09-07 Thread Aaron Merey
_elf calls elf_end on the descriptor of the invalid ELF file. Signed-off-by: Aaron Merey --- libdwfl/open.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libdwfl/open.c b/libdwfl/open.c index 43b29fa9..03e66dfa 100644 --- a/libdwfl/open.c +++ b/libdwfl/open.c @@ -153,6 +153,7 @@ libdw_open_elf (i

Re: [PATCH] libdw_open_elf: Avoid invalid free

2025-09-06 Thread Aaron Merey
On Fri, Sep 5, 2025 at 6:24 PM Mark Wielaard wrote: > > Hi Aaron, > > On Fri, Sep 05, 2025 at 03:41:53PM -0400, Aaron Merey wrote: > > If libdw_open_elf detects an invalid ELF file, it may attempt to > > temporarily treat it as an ELF archive in order to check if ther

Re: [PATCH v2] __libdw_dieabbrev: Replace rwlock with __atomic builtins

2025-09-05 Thread Aaron Merey
Hi Mark, On Fri, Sep 5, 2025 at 10:49 AM Mark Wielaard wrote: > > Hi Aaron, > > On Thu, 2025-09-04 at 14:10 -0400, Aaron Merey wrote: > > On Thu, Sep 4, 2025 at 10:40 AM Mark Wielaard wrote: > > > On Mon, 2025-09-01 at 20:31 -0400, Aaron Merey wrote: > &g

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

2025-09-04 Thread Aaron Merey
Hi Mark, On Thu, Sep 4, 2025 at 1:12 PM Mark Wielaard wrote: > > Hi Aaron, > > On Mon, 2025-08-04 at 23:24 -0400, Aaron Merey wrote: > > Signed-off-by: Aaron Merey > > --- > > v2: Remove mention of implementation details. Mention that conversion > > to

[PATCH] elf_getdata_rawchunk.c: Fix dummy chunk insertion race condition

2025-09-04 Thread Aaron Merey
chunk. Before the wrlock is held, other threads could incorrectly acquire the dummy chunk as if it were a real chunk. Fix this by holding a wrlock throughout elf_getdata_rawchunk. Signed-off-by: Aaron Merey --- libelf/elf_getdata_rawchunk.c | 13 ++--- 1 file changed, 6 insertions(+), 7

Re: [PATCH v2] __libdw_dieabbrev: Replace rwlock with __atomic builtins

2025-09-04 Thread Aaron Merey
Hi Mark, On Thu, Sep 4, 2025 at 10:40 AM Mark Wielaard wrote: > > Hi Aaron, > > On Mon, 2025-09-01 at 20:31 -0400, Aaron Merey wrote: > > __libdw_dieabbrev uses the abbrev_lock rwlock to synchronize access to the > > Dwarf_Die abbrev field as well as its lazy loading.

Re: [RFC] updated api for libdwfl_stacktrace

2025-09-03 Thread Aaron Merey
Hi Serhei, On Wed, Aug 20, 2025 at 6:12 PM Serhei Makarov wrote: > > Hello, > > I've been concerned to get libdwfl_stacktrace out of the weird 'experimental' > limbo we put it in for the last elfutils release. To do that, we need to > stabilize the API. > > My full prototype of a more mature AP

Re: [PATCH v2] __libdw_dieabbrev: Replace rwlock with __atomic builtins

2025-09-03 Thread Aaron Merey
Here is some additional data showing how the performance scales on larger binaries. I used the exact same set up as I described in the previous email, only replacing the 64M stap binary with firefox's 1G libxul.so.debug: $ hyperfine --runs 5 -i --warmup 2 'eu-readelf -C1 -N -w libxul.so.debug' th

[PATCH v2] __libdw_dieabbrev: Replace rwlock with __atomic builtins

2025-09-01 Thread Aaron Merey
ock. * libdw_findcu.c (__libdw_intern_next_unit): Change type of abbrev_lock from rwlock to mutex. Signed-off-by: Aaron Merey --- v1: https://patchwork.sourceware.org/project/elfutils/patch/2025062306.869936-1-ame...@redhat.com/ v1 replaced lazy loading of Dwarf_Die.abbrev w

Re: [PATCH 1/2] elfclassify: Add --any-ar-member option to classify archive member

2025-08-28 Thread Aaron Merey
Hi Mark, On Thu, Aug 28, 2025 at 12:44 PM Mark Wielaard wrote: > > To determine whether an ELF archive contains a member of a particular > type add a new input option to eu-elfclassify --any-ar-member. > eu-elfclassify will match if a given file is an ELF archive and the > classification options

Re: [RFC] elfclassify: Add --ar-member option to classify archive member

2025-08-28 Thread Aaron Merey
Hi Mark, On Thu, Aug 28, 2025 at 4:22 AM Mark Wielaard wrote: > > > > ‘__builtin___sprintf_chk’ argument 5 overlaps destination object > > ‘current_path’ [-Werror=restrict] > > [...] > > elfclassify.c: In function ‘check_ar_members’: > > elfclassify.c:47:14: note: destination object referenced by

Re: [RFC] elfclassify: Add --ar-member option to classify archive member

2025-08-27 Thread Aaron Merey
On Tue, Aug 26, 2025 at 6:46 PM Frank Ch. Eigler wrote: > > RFC: Is the option name --ar-member clear? Do we also want a variant > > (--all-ar-members) that checks whether all members match? Do we want > > this to work recursively? Should it print the member names that match > > instead of the arc

Re: [PATCH v2] elf_getarhdr: Replace per-archive Elf_Arhdr storage with per-member storage

2025-08-20 Thread Aaron Merey
Hi Mark, On Tue, Aug 19, 2025 at 1:24 PM Mark Wielaard wrote: > > + /* Allocate copies of ar_name and ar_rawname. */ > > + size_t name_len = strlen (ar_name) + 1; > > + char *name_copy = malloc (MAX (name_len, 16)); > > There is actually a strnlen that does that (MAX) in one step. MAX is use

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

2025-08-12 Thread Aaron Merey
est (failure) > Revision: 36602dbd840532b9ca6d31c1612bf1d539241e7a > Worker: debian-armhf > Build Reason: (unknown) > Blamelist: Aaron Merey > > Steps: > > - 0: worker_preparation ( success ) > > - 1: set package name ( success ) > > - 2: git checkout ( success ) >

[COMMITTED] Makefile.am: Add errors to lcov ignore list

2025-08-12 Thread Aaron Merey
uot; to the --ignore-errors list so that make coverage exits without error. Signed-off-by: Aaron Merey --- Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.am b/Makefile.am index 76e98f60..fa6fda34 100644 --- a/Makefile.am +++ b/Makefile.am @@ -70

[COMMITTED] readelf.c: Declare num_jobs as ssize_t instead of size_t

2025-08-12 Thread Aaron Merey
Use of ssize_t prevents gcc error -Werror=sign-compare when comparing num_jobs to ndebug_sections. Signed-off-by: Aaron Merey --- src/readelf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/readelf.c b/src/readelf.c index bb451518..6b886c59 100644 --- a/src/readelf.c

Re: [PATCH 1/2] debuginfod-client.c: Skip negative cache entry for cancelled downloads

2025-08-11 Thread Aaron Merey
On Sun, Aug 10, 2025 at 8:27 PM Aaron Merey wrote: > > The debuginfod client cache uses empty files to indicate that a download > was unsuccessful and should not be attempted again. > > Commit 5527216460c61 skips the creation of empty files when a downloaded > is cancelled

Re: [PATCH 2/2] debuginfod-find.c: Avoid leaving temp files in the cache

2025-08-11 Thread Aaron Merey
On Sun, Aug 10, 2025 at 8:27 PM Aaron Merey wrote: > > Add a SIGINT handler to debuginfod-find so that ctrl-c during > a download causes clean up to occur instead of immediately killing > the process and possibly leaving temp files in the client cache. > > This change requires

[PATCH 2/2] debuginfod-find.c: Avoid leaving temp files in the cache

2025-08-10 Thread Aaron Merey
DEBUGINFOD_PROGRESS=1 set. https://sourceware.org/bugzilla/show_bug.cgi?id=33163 Signed-off-by: Aaron Merey --- debuginfod/debuginfod-find.c | 30 ++-- tests/run-debuginfod-artifact-running.sh | 4 ++-- 2 files changed, 30 insertions(+), 4 deletions(-) diff --git a

[PATCH 1/2] debuginfod-client.c: Skip negative cache entry for cancelled downloads

2025-08-10 Thread Aaron Merey
beginning of debuginfod_find_metadata to avoid previous cancellations affecting the current metadata query. Signed-off-by: Aaron Merey --- debuginfod/debuginfod-client.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/debuginfod/debuginfod-client.c b/debuginfod/debuginfod-client.c in

[PATCH v2] elf_getarhdr: Replace per-archive Elf_Arhdr storage with per-member storage

2025-08-10 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 --- v2: Add new static function copy_arh

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

2025-08-06 Thread Aaron Merey
Hi Mark, On Tue, Aug 5, 2025 at 7:29 PM Mark Wielaard wrote: > > On Mon, Aug 04, 2025 at 11:20:54PM -0400, Aaron Merey wrote: > > Implement concurrent execution of print_debug_* functions during handling > > of -w, --debug-dump using libthread.a. > > > > A new `

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

2025-08-04 Thread Aaron Merey
Signed-off-by: Aaron Merey --- v2: mark elf_getshnum as obsolete in SYNOPSIS. Describe extended section headers breifly. Clarify that elf can be NULL, dst cannot be NULL. Mention reason for elf_getshnum deprication and introduction of elf_getshdrnum in HISTORY. doc/Makefile.am | 2 + doc

[PATCH 01/13 v2] doc: Add elf_memory.3

2025-08-04 Thread Aaron Merey
Signed-off-by: Aaron Merey --- v2: replace "open memory buffer" with "open file descriptor". Clarify behavior when image is NULL as well as the minimum size of the image. doc/Makefile.am | 1 + doc/elf_memory.3 | 85

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

2025-08-04 Thread Aaron Merey
enabled. Signed-off-by: Aaron Merey --- v5: use 1 as a minimum default number of threads instead of 2. Restore static qualifier for sort_listptr_name On Wed, Jul 2, 2025 at 5:21 PM Mark Wielaard wrote: > > > > +  unsigned fn = 0; > > > > +#ifdef HAVE_GETRLIMIT > > >

[PATCH 13/13 v4] doc: Add elf_next.3

2025-08-04 Thread Aaron Merey
Signed-off-by: Aaron Merey --- v4: Minor rewording in DESCRIPTION and code comment in EXAMPLES doc/Makefile.am | 1 + doc/elf_next.3 | 120 2 files changed, 121 insertions(+) create mode 100644 doc/elf_next.3 diff --git a/doc/Makefile.am b

[PATCH 09/13 v2] doc: Add elf_newdata.3

2025-08-04 Thread Aaron Merey
Signed-off-by: Aaron Merey --- v2: Describe default field values of Elf_Data returned by elf_newdata. Minor rewording changes doc/Makefile.am | 1 + doc/elf_newdata.3 | 92 +++ 2 files changed, 93 insertions(+) create mode 100644 doc/elf_newdata.3

[PATCH 08/13 v2] doc: Add elf_gnu_hash.3

2025-08-04 Thread Aaron Merey
Signed-off-by: Aaron Merey --- v2: Minor rewording in description and synopsis doc/Makefile.am| 1 + doc/elf_gnu_hash.3 | 1 + doc/elf_hash.3 | 19 --- 3 files changed, 18 insertions(+), 3 deletions(-) create mode 100644 doc/elf_gnu_hash.3 diff --git a/doc

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

2025-08-04 Thread Aaron Merey
Signed-off-by: Aaron Merey --- v2: Mark elf_getshstrndx as deprecated in SYNOPSIS. Add note to HISTORY about reason for introducing elf_getshdrndx. Explain how to use with elf_strptr and Elf{32,64}_getshdr. doc/Makefile.am | 2 + doc/elf_getshdrstrndx.3 | 102

[PATCH 10/13 v2] doc: Add elf_newscn.3

2025-08-04 Thread Aaron Merey
Signed-off-by: Aaron Merey --- v2: fix function declaration in SYNOPSIS. Clarify that the null section is added automatically if absent and never returned. Remove comment about requiring ELF_C_WRITE or ELF_C_RDWR. doc/Makefile.am | 1 + doc/elf_newscn.3 | 88

[PATCH 05/13 v2] doc: Add elf_getphdrnum.3

2025-08-04 Thread Aaron Merey
Signed-off-by: Aaron Merey --- v2: Clarify that return value will not exceed bounds of elf32_getphdr/elf64_getphdr array when used as an index. doc/Makefile.am | 1 + doc/elf_getphdrnum.3 | 81 2 files changed, 82 insertions(+) create mode

[PATCH 04/13 v2] doc: Add elf_getident.3

2025-08-04 Thread Aaron Merey
Signed-off-by: Aaron Merey --- v2: some minor rewording. mention EI_* macros by name. doc/Makefile.am| 1 + doc/elf_getident.3 | 95 ++ 2 files changed, 96 insertions(+) create mode 100644 doc/elf_getident.3 diff --git a/doc/Makefile.am b/doc

[PATCH 11/13 v2] doc: Add elf_rand.3

2025-08-04 Thread Aaron Merey
Signed-off-by: Aaron Merey --- v2: Some rewording. Also remove comment about elf_rand affecting subsequent calls to elf_next. I will post a patch that prevents this behavior. doc/Makefile.am | 1 + doc/elf_rand.3 | 71 + 2 files changed, 72

[PATCH 12/13 v2] doc: Add elf_rawdata.3

2025-08-04 Thread Aaron Merey
Signed-off-by: Aaron Merey --- v2: Some rewording. Describe differences between elf_rawdata and elf_getdata. Also mention that the returned Elf_Data is owned by libelf and should not be manually freed. doc/Makefile.am | 1 + doc/elf_rawdata.3 | 100

[PATCH 03/13 v2] doc: Add elf_getdata_rawchunk.3

2025-08-04 Thread Aaron Merey
Signed-off-by: Aaron Merey --- v2: Remove mention of implementation details. Mention that conversion to native byte order and direct access alignment resembles elf_getdata. Mention elf_errmsg. On Mon, Jul 7, 2025 at 1:26 PM Mark Wielaard wrote: > > Nice overview of ELF data types. But

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

2025-08-04 Thread Aaron Merey
Signed-off-by: Aaron Merey --- v2: Mention that ELF_F_LAYOUT and ELF_F_PERMISSIVE are used with elf_flagelf only and mention which fields may be manually modified. Clarify when an error code is set. Explain exactly which check ELF_F_PERMISSIVE disables during elf_update. doc/Makefile.am

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

2025-08-04 Thread Aaron Merey
. * src/threadlib.h: New file. Declares functions add_job and run_jobs. Signed-off-by: Aaron Merey --- v5: No changes. src/Makefile.am | 16 +++ src/threadlib.c | 275 src/threadlib.h | 36 +++ 3 files changed, 327 insertions

[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

  1   2   3   4   5   >