[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/Makefile.am

[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.3

[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) > > +    { > > +      /* Process subelf here */ > > +

[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
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 indicates an error and other libelf implementations use -1 to indicate an e

[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 insertions(+) crea

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

2025-07-14 Thread Aaron Merey
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_next and elf_rand can invalidate an archive member's reference to its own E