https://sourceware.org/bugzilla/show_bug.cgi?id=33433
Mark Wielaard changed:
What|Removed |Added
Status|NEW |RESOLVED
Resolution
" datastructures.
> +.SH ATTRIBUTES
> +.TS
> +allbox;
> +lbx lb lb
> +l l l.
> +InterfaceAttribute Value
> +T{
> +.na
> +.nh
> +.BR gelf_getehdr ()
> +T} Thread safety MT-Safe
> +.TE
> +
> +.SH REPORTING BUGS
> +Report bugs to or
> https://sourceware.org/bugzilla/.
OK.
Thanks,
Mark
inary with kind
> +.BR ELF_K_ELF ,
> +then
> +.B ELFCLASSNONE
> +is returned.
OK.
> +.SH SEE ALSO
> +.BR elf_kind (3),
> +.BR libelf (3),
> +.BR elf (5)
OK.
> +.SH ATTRIBUTES
> +.TS
> +allbox;
> +lbx lb lb
> +l l l.
> +InterfaceAttribute Value
> +T{
> +.na
> +.nh
> +.BR gelf_getclass ()
> +T} Thread safety MT-unsafe race
> +.TE
> +
> +.SH REPORTING BUGS
> +Report bugs to or
> https://sourceware.org/bugzilla/.
Looks good.
Thanks,
Mark
-by: Mark Wielaard
---
libelf/elf32_updatenull.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/libelf/elf32_updatenull.c b/libelf/elf32_updatenull.c
index 3594e8bad6c0..74c27fdaa7b5 100644
--- a/libelf/elf32_updatenull.c
+++ b/libelf/elf32_updatenull.c
@@ -135,7 +135,8
trievable by
> +.BR elf_errmsg (3).
OK.
> +.SH SEE ALSO
> +.BR elf_begin (3),
> +.BR elf_errmsg (3),
> +.BR libelf (3),
> +.BR elf (5)
OK.
> +.SH ATTRIBUTES
> +.TS
> +allbox;
> +lbx lb lb
> +l l l.
> +Interface Attribute Value
> +T{
> +.na
> +.nh
> +.BR elf_memory ()
> +T} Thread safety MT-Safe
> +.TE
> +
> +.SH REPORTING BUGS
> +Report bugs to or
> https://sourceware.org/bugzilla/.
> +
OK.
Thanks,
Mark
t; +.BR elf (5)
OK.
> +.SH ATTRIBUTES
> +.TS
> +allbox;
> +lbx lb lb
> +l l l.
> +InterfaceAttribute Value
> +T{
> +.na
> +.nh
> +.BR elf_flagelf
> (),\~elf_flagehdr(),\~elf_flagphdr(),\~elf_flagscn(),\~elf_flagshdr(),\~elf_flagdata()
> +T} Thread safety MT-Unsafe race
> +.TE
> +
> +.SH REPORTING BUGS
> +Report bugs to or
> https://sourceware.org/bugzilla/.
OK.
> diff --git a/doc/elf_flagphdr.3 b/doc/elf_flagphdr.3
> new file mode 100644
> index ..ee84d431
> --- /dev/null
> +++ b/doc/elf_flagphdr.3
> @@ -0,0 +1 @@
> +.so man3/elf_flagelf.3
> diff --git a/doc/elf_flagscn.3 b/doc/elf_flagscn.3
> new file mode 100644
> index ..ee84d431
> --- /dev/null
> +++ b/doc/elf_flagscn.3
> @@ -0,0 +1 @@
> +.so man3/elf_flagelf.3
> diff --git a/doc/elf_flagshdr.3 b/doc/elf_flagshdr.3
> new file mode 100644
> index ..ee84d431
> --- /dev/null
> +++ b/doc/elf_flagshdr.3
> @@ -0,0 +1 @@
> +.so man3/elf_flagelf.3
OK.
Thanks,
Mark
)
> +/* Out of memory. */
> +return NULL;
OK, swap these calls.
> + result = read_file (fildes, ref->state.ar.offset + sizeof (struct ar_hdr),
> + MIN (max_size - hdr_size - offset, ar_size), cmd, ref);
Right, here we use ar.offset instead of offset (plus the hdr_size) to
set the new Elf member start_offset, which is correct. The MIN
calculation is also now correct (using offset).
>if (result != NULL)
> {
Thanks,
Mark
also take a peek at the Debian workaround for dealing with
arches that don't support perf?
https://salsa.debian.org/toolchain-team/elfutils/-/commit/2cd08fdcfcaf15d6a2b7b085faedadfc94a4729c
I am not sure just listing all the arches that don't support perf is
really the way to go. But maybe it is the best there is?
Cheers,
Mark
inated
> named raw_name used in the elf_ar_hdr. */
> + Elf_Arhdr ar_ar_hdr; /* Archive header of this archive. Used when
> +an archive is a member of an archive. */
> } ar;
>} state;
>
Might want to check placement of this field with pahole. It now comes
after a 17 element array which means there is at least a small gap for
alignment.
Cheers,
Mark
dwfl);
> dwfl = NULL;
> }
>else
This looks obviously correct to me.
Thanks,
Mark
R elf_getarsym (3),
> +.BR elf_next (3),
> +.BR libelf (3),
> +.BR elf (5)
OK.
> +.SH ATTRIBUTES
> +.TS
> +allbox;
> +lbx lb lb
> +l l l.
> +InterfaceAttribute Value
> +T{
> +.na
> +.nh
> +.BR elf_rand ()
> +T} Thread safety MT-Safe
> +.TE
> +
> +.SH REPORTING BUGS
> +Report bugs to or
> https://sourceware.org/bugzilla/.
OK.
Thanks,
Mark
Assignee: unassigned at sourceware dot org
Reporter: mark at klomp dot org
CC: elfutils-devel at sourceware dot org
Target Milestone: ---
There are various unlock/rwlock patterns in the code where a read lock has been
taken, a condition is detected that needs
Hi Evgeny,
On Sat, Sep 06, 2025 at 05:18:57PM +0300, Evgeny wrote:
> On Sat, 6 Sept 2025 at 13:50, Mark Wielaard wrote:
> > This, plus Aaron's fix for libdw_open_elf, should resolve the ossfuzz
> > issues.
>
> I can confirm that this patch (combined with the patch
call read_file if the
offset isn't past the end and with a maximum_size not too large.
Signed-off-by: Mark Wielaard
---
This, plus Aaron's fix for libdw_open_elf, should resolve the ossfuzz
issues.
libelf/elf_begin.c | 13 ++---
1 file changed, 10 insertions(+), 3 d
; if (unlikely (subelf == NULL))
> error = DWFL_E_LIBELF;
> else
As far as I can see/test this fixes the 440144412 and 440209728
ossfuzz cases.
Thanks,
Mark
ng the copy). And after the copy is made
and passed to another thread nobody else has a reference to that new
Dwarf_Die except the receiving thread.
Cheers,
Mark
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:
> > > __libdw_dieabbrev uses the abbrev_lock rwlock to synchronize access to the
> > > Dwa
t64_t offset, size_t
> size, Elf_Type type)
>chunk->data.d.d_version = EV_CURRENT;
>chunk->offset = offset;
>
> - rwlock_unlock (elf->lock);
> - rwlock_wrlock (elf->lock);
> -
>*found = chunk;
>result = &chunk->data.d;
>
OK. The actual unlock is done at the end.
Thanks,
Mark
elf_errno. If
> +.I elf
> +is NULL, then NULL is returned without setting elf_errno.
OK.
> +.SH SEE ALSO
> +.BR elf32_getshdr (3),
> +.BR elf64_getshdr (3),
> +.BR elf_getdata (3),
> +.BR elf_newdata (3),
> +.BR elf_update (3),
> +.BR libelf (3),
> +.BR elf (5)
OK.
> +.SH ATTRIBUTES
> +.TS
> +allbox;
> +lbx lb lb
> +l l l.
> +InterfaceAttribute Value
> +T{
> +.na
> +.nh
> +.BR elf_newscn ()
> +T} Thread safety MT-Safe
> +.TE
> +
> +.SH REPORTING BUGS
> +Report bugs to or
> https://sourceware.org/bugzilla/.
OK.
Thanks,
Mark
b-ELF descriptor: %s\\n",
> + elf_errmsg (-1));
> + exit (1);
> +}
> + }
> +
> + elf_end (elf);
> + close (fd);
> +.fi
OK. Really nice example.
> +.SH SEE ALSO
> +.BR elf_begin (3),
> +.BR elf_rand (3),
> +.BR libelf (3),
> +.BR elf (5)
OK.
> +.SH ATTRIBUTES
> +.TS
> +allbox;
> +lbx lb lb
> +l l l.
> +InterfaceAttribute Value
> +T{
> +.na
> +.nh
> +.BR elf_next ()
> +T} Thread safety MT-Safe
> +.TE
> +
> +.SH REPORTING BUGS
> +Report bugs to or
> https://sourceware.org/bugzilla/.
OK.
Thanks,
Mark
on. On failure, NULL
> +is returned and elf_errno is set.
OK.
> +.SH SEE ALSO
> +.BR elf_getdata (3),
> +.BR elf_getscn (3),
> +.BR elf_compress (3),
> +.BR libelf (3),
> +.BR elf (5)
OK.
> +.SH ATTRIBUTES
> +.TS
> +allbox;
> +lbx lb lb
> +l l l.
> +InterfaceAttribute Value
> +T{
> +.na
> +.nh
> +.BR elf_rawdata ()
> +T} Thread safety MT-Safe
> +.TE
> +
> +.SH REPORTING BUGS
> +Report bugs to or
> https://sourceware.org/bugzilla/.
OK.
Thanks,
Mark
scn
> +is NULL, then NULL is returned and elf_errno is not set.
> +
> +The caller is responsible for configuring the return value (see DESCRIPTION
> +for default field values).
OK.
> +.SH SEE ALSO
> +.BR elf_getdata (3),
> +.BR elf_newscn (3),
> +.BR elf_update (3),
> +.BR libelf (3),
> +.BR elf (5)
OK.
> +.SH ATTRIBUTES
> +.TS
> +allbox;
> +lbx lb lb
> +l l l.
> +InterfaceAttribute Value
> +T{
> +.na
> +.nh
> +.BR elf_newdata ()
> +T} Thread safety MT-Safe
> +.TE
> +
> +.SH REPORTING BUGS
> +Report bugs to or
> https://sourceware.org/bugzilla/.
OK.
Thanks,
Mark
ety MT-Safe
> .TE
>
> .SH REPORTING BUGS
> Report bugs to or
> https://sourceware.org/bugzilla/.
OK.
> +.SH HISTORY
> +.B elf_gnu_hash
> +first appeared in elfutils 0.122. This function is a elfutils libelf
> extension and
> +may not be available in other libelf implementations.
OK.
Thanks,
Mark
Hi Aaron,
On Mon, Aug 04, 2025 at 11:24:37PM -0400, Aaron Merey wrote:
> 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
Hi Aaron,
On Mon, Aug 04, 2025 at 11:24:36PM -0400, Aaron Merey wrote:
> 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_getsh
Hi Serhei,
On Wed, 2025-09-03 at 10:14 -0400, Serhei Makarov wrote:
> Initial response from what I know, pending being actually sure about the
> answers.
>
> On Wed, Sep 3, 2025, at 9:51 AM, Mark Wielaard wrote:
> > Could you explain again why we have the first set of arg
(3),
> +.BR elf64_getphdr (3),
> +.BR libelf (3),
> +.BR elf (5)
OK.
> +.SH ATTRIBUTES
> +.TS
> +allbox;
> +lbx lb lb
> +l l l.
> +InterfaceAttribute Value
> +T{
> +.na
> +.nh
> +.BR elf_getphdrnum ()
> +T} Thread safety MT-Safe
> +.TE
> +
> +.SH REPORTING BUGS
> +Report bugs to or
> https://sourceware.org/bugzilla/.
OK.
Thanks,
Mark
Hi Aaron,
On Mon, 2025-08-04 at 23:24 -0400, Aaron Merey wrote:
> 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(+
Mon, Jul 7, 2025 at 1:26 PM Mark Wielaard wrote:
> >
> > Nice overview of ELF data types. But might there be a better place for
> > this? I would assume elf_data, but that man page is currently very bare
> > bones.
>
> When I update the bare bones man pages incl
Hi Aaron,
On Mon, 2025-08-04 at 23:24 -0400, Aaron Merey wrote:
> 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 ch
the archive or ELF file contained in
> +.IR image .
> +
> +On failure, it returns NULL and sets an error code retrievable by
> +.BR elf_errmsg (3).
OK.
> +
> +.SH SEE ALSO
> +.BR elf_begin (3),
> +.BR elf_errmsg (3),
> +.BR libelf (3),
> +.BR elf (5)
> +
> +.SH ATTRIBUTES
> +.TS
> +allbox;
> +lbx lb lb
> +l l l.
> +Interface Attribute Value
> +T{
> +.na
> +.nh
> +.BR elf_memory ()
> +T} Thread safety MT-Safe
> +.TE
> +
> +.SH REPORTING BUGS
> +Report bugs to or
> https://sourceware.org/bugzilla/.
> +
OK.
Thanks,
Mark
nce? It is a fairly
small struct so passing a copy instead of a reference shouldn't be a
very high overhead. Or maybe we should say that you should pass the
Dwarf and Dwarf_Die.addr to another thread and reconstruct it using
dwarf_die_addr_die? That would simplify things a bit on the
implementation side I think. But might make parallel algorithm using
libdw more awkward?
Thanks,
Mark
me arches have gaps in the DWARF
register numbers and so might have > 100 nregs.
Should the regmapping maybe be stored or set with the Dwfl or
Dwflst_Process_Tracker once?
Cheers,
Mark
> diff --git a/libdwfl_stacktrace/libdwfl_stacktrace.h
> b/libdwfl_stacktrace/libdw\
> fl_stacktra
re...@gmail.com added comment #2:
>
> redacted
Could you please remove the elfutils-devel mailinglist.
These messages are really not very useful.
Thanks,
Mark
style definition for older standards
So just always use (void) instead of () for an empty argument list.
* src/elfclassify.c (check_checks): Define as check_checks (void).
(check_ar_members): Define as check_ar_members (void).
Signed-off-by: Mark Wielaard
---
src/elfclassify.c | 4 ++
Hi Aaron,
On Thu, Aug 28, 2025 at 08:25:52PM -0400, Aaron Merey wrote:
> 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.
&g
-section and
--debug-only).
* tests/run-elfclassify.sh: Add various --has-debug-sections
tests.
Signed-off-by: Mark Wielaard
---
src/elfclassify.c| 25 +
tests/run-elfclassify.sh | 25 +
2 files changed, 50 insertions
.
Signed-off-by: Mark Wielaard
---
src/elfclassify.c| 236 ---
tests/run-elfclassify.sh | 27 +
2 files changed, 198 insertions(+), 65 deletions(-)
diff --git a/src/elfclassify.c b/src/elfclassify.c
index 25fe9a652ea4..311530d74dd8 100644
--- a/src
7;s a false positive since
> current_path is reassigned before the sprintf call but the code can be
> adjusted to avoid this error.
That is odd. Which gcc version is this with and which configure
options? Locally (GCC 15.2.1) seems fine. It clearly is a false
positive indeed. I'll try to work around it by using some local
temporary.
Thanks,
Mark
be needed.)
Is anybody working on that? I like the ar --map idea, but have some
design questions. Just refusing to handle really large ar files seems
too simplistic, you still have a performance problem with packages
that just have losts of smaller archives.
Cheers,
Mark
https://sourceware.org/bugzilla/show_bug.cgi?id=33329
Mark Wielaard changed:
What|Removed |Added
CC||mark at klomp dot org
--- Comment #1
insertions(+), 65 deletions(-)
diff --git a/src/elfclassify.c b/src/elfclassify.c
index 25fe9a652ea4..779b065beb4b 100644
--- a/src/elfclassify.c
+++ b/src/elfclassify.c
@@ -1,5 +1,6 @@
/* Classification of ELF files.
Copyright (C) 2019 Red Hat, Inc.
+ Copyright (C) 2025 Mark J. Wielaard
Hi,
On Thu, Aug 21, 2025 at 01:14:38AM -0700, buganizer-sys...@google.com wrote:
> Replying to this email means your email address will be shared with the
> team that works on this product.
> https://issues.oss-fuzz.com/issues/440144412
This (and the similar emails sent recently) isn't really eno
f you
change the compression of the release tar balls (change the
AM_INIT_AUTOMAKE option in configure.ac) you also need to change the
release scripts like config/upload-release.sh
And you still need bzip2 for the tests. The testsuite contains more
than 300 .bz2 files.
Cheers,
Mark
https://sourceware.org/bugzilla/show_bug.cgi?id=32232
--- Comment #4 from Mark Wielaard ---
(In reply to Khem Raj from comment #3)
> With 0.193 and LLD 21.x, this the failing list
>
> {'elfutils': ['run-strip-strmerge.sh',
> 'run-elflint-sel
ying that each Elf_Arhdr has a unique
> ar_name and ar_rawname.
>
> On Tue, Jul 15, 2025 at 12:19 PM Mark Wielaard wrote:
> > > + /* Per-descriptor copy of the structure returned by 'elf_getarhdr'. */
> > > + Elf_Arhdr elf_ar_hdr;
> > > +
> &g
this repository has been identified as harmful in any
> way; this is just a drive-by change.
Yes, looks good. Did a quick make distcheck to make sure there was
nothing depending on the executable bits. And nothing did.
Pushed,
Mark
importer that wants to put
products with digital elements on the EU market, then you are
responsible for cybersecurity throughout your product's life cycle.
Please see https://sourceware.org/cyber-security-faq.html#eu-cra for
some recommendations around the EU CRA.
Cheers,
Mark
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
t; these buffers.
>
> Signed-off-by: Aaron Merey
> ---
> v5: no changes.
Still looks good.
Thanks,
Mark
d with
> readelf when USE_LOCKS is defined.
> * src/threadlib.c: New file. Manages job creation, concurrent
> execution and output handling.
> * src/threadlib.h: New file. Declares functions add_job and
> run_jobs.
>
> Signed-off-by: Aaron Merey
> ---
> v5: No changes.
Still looks good.
Thanks,
Mark
donate hardware or services then contact us at spon...@sourceware.org
Sourceware PLC,
Frank Ch. Eigler, Ian Kelling, Ian Lance Taylor, Tom Tromey,
Jon Turney, Mark J. Wielaard and Elena Zannoni
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
etarhdr: Replace per-archive Elf_Arhdr
storage with per-member storage" completely does that (yet).
But lets go with this documentation because that is the goal.
Cheers,
Mark
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
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.
https://sourceware.org/bugzilla/show_bug.cgi?id=33150
--- Comment #2 from Mark Wielaard ---
Note that the warning: "could not find '.gnu_debugaltlink' file for ..." has
recently (commit 7b80401da Handle DWARF 5 separate debug sections) been changed
to "could not find
; + printf ("Error while freeing subELF descriptor: %s\n",
> + elf_errmsg (-1));
> + exit (1);
> + }
> +
> + hdr_list = cur->next;
> + free (cur);
> + }
> +
> + /* Close the archive descriptor. */
> + if (elf_end (elf) != 0)
> {
> printf ("Freeing ELF descriptors failed: %s", elf_errmsg (-1));
> exit (1);
>
> @@ -144,12 +202,6 @@ Failed to get base address for the archive element:
> %s\n",
>
>/* Get next archive element. */
>cmd = elf_next (subelf);
> - if (elf_end (subelf) != 0)
> - {
> - printf ("error while freeing sub-ELF descriptor: %s\n",
> - elf_errmsg (-1));
> - exit (1);
> - }
> }
>
>/* When we reach this point we haven't found the given file in the
Nice test.
Cheers,
Mark
u-ar assumes -1 indicates an error and other libelf implementations
> use -1 to indicate an error in elf_getaroff.
>
> Replace ELF_C_NULL with -1 as elf_getaroff's error return value.
I agree this makes sense given elf_getaroff returns an offset.
Thanks,
Mark
in the string table if successful.
> +Returns
> +.B NULL
> +on error.
> +
> +.SH SEE ALSO
> +.BR elf (3),
> +.BR elf_getscn (3),
> +.BR libelf (3),
> +.BR elf (5)
Maybe add elf32/64_getshdr and gelf_getsym as examples of sh_name
(.shstrtab) or st_name (.strtab) getting name strings?
> +
> +.SH ATTRIBUTES
> +.TS
> +allbox;
> +lbx lb lb
> +l l l.
> +InterfaceAttribute Value
> +T{
> +.na
> +.nh
> +.BR elf_strptr ()
> +T} Thread safety MT-Safe
> +.TE
> +
> +.SH REPORTING BUGS
> +Report bugs to or
> https://sourceware.org/bugzilla/.
OK.
Thanks,
Mark
t; +T} Thread safety MT-Safe
> +.TE
> +
> +.SH REPORTING BUGS
> +Report bugs to or
> https://sourceware.org/bugzilla/.
> +
> +.SH HISTORY
> +.B elf_scnshndx
> +first appeared in elfutils 0.132. This function is a elfutils libelf
> extension and
> +may not be available in other libelf implementations.
OK.
Thanks,
Mark
> +.I *ptr
> +(if non-NULL) is set to 0.
OK.
> +.SH SEE ALSO
> +.BR libelf (3),
> +.BR elf (5)
> +
> +.SH ATTRIBUTES
> +.TS
> +allbox;
> +lbx lb lb
> +l l l.
> +InterfaceAttribute Value
> +T{
> +.na
> +.nh
> +.BR elf_rawfile ()
> +T} Thread safety MT-Safe
> +.TE
> +
> +.SH REPORTING BUGS
> +Report bugs to or
> https://sourceware.org/bugzilla/.
OK.
Thanks,
Mark
ing the raw contents of the section. On failure,
> +.B NULL
> +is returned.
OK.
> +.SH SEE ALSO
> +.BR elf_getdata (3),
> +.BR elf_getscn (3),
> +.BR elf_compress (3),
> +.BR libelf (3),
> +.BR elf (5)
> +
> +.SH ATTRIBUTES
> +.TS
> +allbox;
> +lbx lb lb
> +l l l.
> +InterfaceAttribute Value
> +T{
> +.na
> +.nh
> +.BR elf_rawdata ()
> +T} Thread safety MT-Safe
> +.TE
> +
> +.SH REPORTING BUGS
> +Report bugs to or
> https://sourceware.org/bugzilla/.
OK.
Thanks,
Mark
lf_next (3),
> +.BR libelf (3),
> +.BR elf (5)
Add elf_getarsym.
> +.SH ATTRIBUTES
> +.TS
> +allbox;
> +lbx lb lb
> +l l l.
> +InterfaceAttribute Value
> +T{
> +.na
> +.nh
> +.BR elf_rand ()
> +T} Thread safety MT-Safe
> +.TE
> +
> +.SH REPORTING BUGS
> +Report bugs to or
> https://sourceware.org/bugzilla/.
OK.
Thanks,
Mark
> +.SH ATTRIBUTES
> +.TS
> +allbox;
> +lbx lb lb
> +l l l.
> +InterfaceAttribute Value
> +T{
> +.na
> +.nh
> +.BR elf_nextscn ()
> +T} Thread safety MT-Safe
> +.TE
> +
> +.SH REPORTING BUGS
> +Report bugs to or
> https://sourceware.org/bugzilla/.
OK.
Thanks,
Mark
L, failure is returned and elf_errno
is not (re)set.
> +
> +.SH SEE ALSO
> +.BR elf_getshdr (3),
elf32_getshdr
elf64_getshdr
> +.BR elf_getdata (3),
> +.BR elf_newdata (3),
> +.BR elf_update (3),
> +.BR libelf (3),
> +.BR elf (5)
OK.
> +.SH ATTRIBUTES
> +.TS
> +allbox;
> +lbx lb lb
> +l l l.
> +InterfaceAttribute Value
> +T{
> +.na
> +.nh
> +.BR elf_newscn ()
> +T} Thread safety MT-Safe
> +.TE
> +
> +.SH REPORTING BUGS
> +Report bugs to or
> https://sourceware.org/bugzilla/.
OK.
Thanks,
Mark
wscn (3),
> +.BR elf_update (3),
> +.BR libelf (3),
> +.BR elf (5)
OK.
> +.SH ATTRIBUTES
> +.TS
> +allbox;
> +lbx lb lb
> +l l l.
> +InterfaceAttribute Value
> +T{
> +.na
> +.nh
> +.BR elf_newdata ()
> +T} Thread safety MT-Safe
> +.TE
> +
> +.SH REPORTING BUGS
> +Report bugs to or
> https://sourceware.org/bugzilla/.
OK. Some of the lines are very wide though.
Thanks,
Mark
32 bits of the return value are used.
OK.
> @@ -43,9 +52,14 @@ Interface Attribute Value
> T{
> .na
> .nh
> -.BR elf_hash ()
> +.BR elf_hash (),\~elf_gnu_hash ()
> T} Thread safety MT-Safe
> .TE
>
> .SH REPORTING BUGS
> Report bugs to or
> https://sourceware.org/bugzilla/.
> +
> +.SH HISTORY
> +.B elf_gnu_hash
> +first appeared in elfutils 0.122. This function is a elfutils libelf
> extension and
> +may not be available in other libelf implementations.
OK.
Thanks,
Mark
GETSHDRSTRNDX 3 2025-06-30 "Libelf" "Libelf Programmer's Manual"
> +
> +.SH NAME
> +elf_getshdrstrndx, elf_getshstrndx \- retrieve the section header string
> table index
> +.SH SYNOPSIS
> +.nf
> +#include
> +
> +.B int elf_getshdrstrndx("Elf
uot;Libelf Programmer's Manual"
> +
> +.SH NAME
> +elf_getshdrnum, elf_getshnum \- retrieve the number of section headers in an
> ELF file
> +.SH SYNOPSIS
> +.nf
> +#include
> +
> +.B int elf_getshdrnum("Elf *elf", "size_t *dst");
> +.
f
> +is NULL.
OK.
> +.SH SEE ALSO
> +.BR libelf (3),
> +.BR elf (5)
elf32_getphdr/elf64_getphdr?
> +.SH ATTRIBUTES
> +.TS
> +allbox;
> +lbx lb lb
> +l l l.
> +InterfaceAttribute Value
> +T{
> +.na
> +.nh
> +.BR elf_getphdrnum ()
> +T} Thread safety MT-Safe
> +.TE
> +
> +.SH REPORTING BUGS
> +Report bugs to or
> https://sourceware.org/bugzilla/.
OK.
Cheers,
Mark
index part confused me.
> +.SH SEE ALSO
> +.BR libelf (3),
> +.BR elf (5)
OK.
> +.SH ATTRIBUTES
> +.TS
> +allbox;
> +lbx lb lb
> +l l l.
> +InterfaceAttribute Value
> +T{
> +.na
> +.nh
> +.BR elf_getident ()
> +T} Thread safety MT-Safe
> +.TE
> +
> +.SH REPORTING BUGS
> +Report bugs to or
> https://sourceware.org/bugzilla/.
OK.
Thanks,
Mark
t;lock. Checks whether it can find an
existing Elf_Data_Chunk. If yes, it returns that one. Which seems fine.
But if not it inserts the dummy chunk without actually data,
allocates/creates the data, drops the rdlock (!), takes a write lock
and overwrites the dummy chunk with the real data, drops the lock again
and returns the data.
What if at (!) another call gets the read lock first before the current
thread can (re)take the write lock? That other thread could find the
existing dummy key already in the cache and return the dummy data?
> +.SH REPORTING BUGS
> +Report bugs to or
> https://sourceware.org/bugzilla/.
> +
> +.SH HISTORY
> +.B elf_getdata_rawchunk
> +first appeared in elfutils 0.130. This function is a elfutils libelf
> extension and
> +may not be available in other libelf implementations.
Yes.
Thanks,
Mark
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 |
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
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
f_compress ()
> +and
> +.BR elf_compress_gnu ()
> +modify the contents of a section in an ELF descriptor by compressing or
> +decompressing the section data and adjusting the section header. These
> changes
> +take effect when the ELF descriptor is written with
> +.BR elf_upda
errmsg (3),
> +.BR elf (5)
> +
> +.SH ATTRIBUTES
> +.TS
> +allbox;
> +lbx lb lb
> +l l l.
> +Interface Attribute Value
> +T{
> +.na
> +.nh
> +.BR elf_cntl ()
> +T} Thread safety MT-Safe
> +.TE
> +
> +.SH REPORTING BUGS
> +Report bugs to or
> https://sourceware.org/bugzilla/.
Looks good,
Mark
en print_debug_unit has:
const bool silent = !(print_debug_sections & section_info) && !debug_types;
And even when silent it then does various notice_listptr calls.
Confusing :)
I wonder if it still makes sense to have this extra notice_listptr
pass inside print_debug_unit and whether we shouldn't just have a
dedicated pass for it that then can run before the printing of any
other debug section (if needed).
But yes, I see now. That is for later.
Getting back to the actual change:
> /* To store the name used in compare_listptr */
> -static const char *sort_listptr_name;
> +_Thread_local const char *sort_listptr_name;
Should it still be static?
Should we maybe include and use thread_local instead?
I read over the whole patch and don't have any other comments. Looks
good.
Thanks,
Mark
gt;
> Yes exit will terminate the whole program in this case.
OK. Then we should make sure that they output their warning/error
message to stderr and not their current stream (because that will be
lost). I think that happens automatically when using error() to exit.
Cheers,
Mark
> + fputs (__("\nFile name table:\n"), out);
>if (version > 4)
> {
> struct encpair { uint16_t desc; uint16_t form; };
> struct encpair enc[256];
>
> - fprintf (out, _(" ["));
> + fprintf (out, " [");
> if ((size_t) (lineendp - linep) < 1)
> goto invalid_data;
> unsigned char file_name_format_count = *linep++;
Likewise.
> @@ -9528,11 +9602,11 @@ print_debug_line_section (Dwfl_Module *dwflmod, Ebl
> *ebl, GElf_Ehdr *ehdr,
>
>if (linep == lineendp)
> {
> - fputs (_("\nNo line number statements.\n"), out);
> + fputs (__("\nNo line number statements.\n"), out);
> continue;
> }
>
> - fputs (_("\nLine number statements:\n"), out);
> + fputs (__("\nLine number statements:\n"), out);
>Dwarf_Word address = 0;
>unsigned int op_index = 0;
>size_t line = 1;
> @@ -9581,15 +9655,25 @@ print_debug_line_section (Dwfl_Module *dwflmod, Ebl
> *ebl, GElf_Ehdr *ehdr,
> line += line_increment;
> advance_pc ((opcode - opcode_base) / line_range);
>
> - fprintf (out, _(" special opcode %u: address+%u = "),
> + IGNORE_FMT_NONLITERAL_BEGIN
> + fprintf (out, __(" special opcode %u: address+%u = "),
> opcode, op_addr_advance);
> + IGNORE_FMT_NONLITERAL_END
> print_dwarf_addr (dwflmod, 0, address, address, out);
> if (op_index > 0)
> - fprintf (out, _(", op_index = %u, line%+d = %zu\n"),
> - op_index, line_increment, line);
> + {
> + IGNORE_FMT_NONLITERAL_BEGIN
> + fprintf (out, __(", op_index = %u, line%+d = %zu\n"),
> +op_index, line_increment, line);
> + IGNORE_FMT_NONLITERAL_END
> + }
> else
> - fprintf (out, _(", line%+d = %zu\n"),
> - line_increment, line);
> + {
> + IGNORE_FMT_NONLITERAL_BEGIN
> + fprintf (out, __(", line%+d = %zu\n"),
> +line_increment, line);
> + IGNORE_FMT_NONLITERAL_END
> + }
> }
"line" can probably be translated, but "op_index" is how it is called
in the spec.
Similar comments for the rest of the patch.
I really don't like the macros and the __ very much.
If at all possible I would just do this with explicit
static char *frob_str = _("frob"); strings.
Cheers,
Mark
me (so those can
be parallelized too). The attrcb_args callback support already seems
ready for that.
But that is all for some future.
Cheers,
Mark
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>
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
and return -1 on error.
> +.SH SEE ALSO
> +.BR elf_begin (3),
> +.BR elf_next (3),
> +.BR elf_rand (3),
> +.BR libelf (3),
> +.BR elf (5)
> +
> +.SH ATTRIBUTES
> +.TS
> +allbox;
> +lbx lb lb
> +l l l.
> +InterfaceAttribute Value
> +T{
> +.na
> +.nh
> +.BR elf_getaroff ()
> +T} Thread safety MT-Safe
> +.TE
> +
> +.SH REPORTING BUGS
> +Report bugs to or
> https://sourceware.org/bugzilla/.
> +
> +.SH HISTORY
> +.B elf_getaroff
> +first appeared in elfutils 0.114. This elfutils libelf function may not be
> +found in other libelf implementations.
Looks good otherwise.
Thanks,
Mark
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.
https://sourceware.org/bugzilla/show_bug.cgi?id=33103
--- Comment #6 from Mark Wielaard ---
Note that a followup commit was necessary to fix building one testcase that
broke make check:
commit 65d383a7e653524388ff2ea382be3eac1d04061f (HEAD -> main)
Author: Mark Wielaard
Date: Thu Jun 26
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
https://sourceware.org/bugzilla/show_bug.cgi?id=33103
Mark Wielaard changed:
What|Removed |Added
Status|UNCONFIRMED |RESOLVED
Resolution
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
https://sourceware.org/bugzilla/show_bug.cgi?id=33103
--- Comment #3 from Mark Wielaard ---
I don't understand why this is only a problem with srcdir == builddir.
But maybe we can extend the original solution to use -iquote for srcdir. And
only have -I for lib and the top builddir (for )?
https://sourceware.org/bugzilla/show_bug.cgi?id=33103
Mark Wielaard changed:
What|Removed |Added
CC||mark at klomp dot org
--- Comment #1
https://sourceware.org/bugzilla/show_bug.cgi?id=33099
Mark Wielaard changed:
What|Removed |Added
Status|ASSIGNED|RESOLVED
Resolution
(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
https://sourceware.org/bugzilla/show_bug.cgi?id=33099
Mark Wielaard changed:
What|Removed |Added
Status|NEW |ASSIGNED
--- Comment #4 from Mark
https://sourceware.org/bugzilla/show_bug.cgi?id=33099
Mark Wielaard changed:
What|Removed |Added
CC||mark at klomp dot org
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
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
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
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 \
>
1 - 100 of 1386 matches
Mail list logo