Re: [PATCH] readelf: Fix division by zero in handle a relocation sections

2024-04-02 Thread Mark Wielaard
Hi Maks, On Sat, 2024-03-30 at 00:23 +0300, Maks Mishin wrote: > Variable 'sh_entsize', whose possible value set allows a zero value > by calling function 'gelf_fsize', is used as a denominator > in calculation of 'nentries' variable. > > Found by RASU JSC. Sorry, but I am going to stop reviewin

Re: [PATCH] libdw: dwarf_getsrcfiles should not imply dwarf_getsrclines

2024-04-02 Thread Mark Wielaard
Hi Aaron, On Thu, 2024-03-28 at 21:12 -0400, Aaron Merey wrote: > dwarf_getsrcfiles causes line data to be read in addition to file data. > This is wasteful for programs which only need file or directory names. > Debuginfod server is one such example. > > Fix this by moving the srcfile handling i

Re: [PATCH] segment: Fix dangling pointer

2024-04-03 Thread Mark Wielaard
r `old`. OK, but that doesn't really make sense. old isn't a dangling pointer. It is a local pointer that is freed before returning from the function. What do you try to accomplish by assigning it the value NULL? What real issue are you trying to fix? Thanks, Mark > пт, 29 мар. 2024

Re: [PATCH] segment: Fix memory leak in insert()

2024-04-03 Thread Mark Wielaard
On Tue, Apr 02, 2024 at 11:32:50PM +0300, Maks Mishin wrote: > Dynamic memory, referenced by 'naddr', is allocated at segment.c:66 > by calling function 'realloc' and lost at segment.c:92. It isn't lost, it is assigned to dwfl->lookup_addr at segment.c:77 > > Found by RASU JSC. > > Signed-off-b

Re: [PATCH v2 2/2] Hexagon: implement machine flag check

2024-04-04 Thread Mark Wielaard
Hi, On Tue, 2024-04-02 at 21:38 +, Brian Cain wrote: > > diff --git a/backends/hexagon_symbol.c b/backends/hexagon_symbol.c > > index b341243e..1e681e9f 100644 > > --- a/backends/hexagon_symbol.c > > +++ b/backends/hexagon_symbol.c > > @@ -56,3 +56,11 @@ hexagon_reloc_simple_type (Ebl *ebl __a

Re: [PATCH v2 1/2] Add support for Hexagon

2024-04-04 Thread Mark Wielaard
Hi Matheus, On Tue, 2024-04-02 at 16:55 -0300, Matheus Tavares Bernardino wrote: > This implements initial support for the Hexagon architecture. The > Hexagon ABI spec can be seen at > https://lists.llvm.org/pipermail/llvm-dev/attachments/20190916/21516a52/attachment-0001.pdf > > A hello_hexagon.

Re: [PATCH v2 2/2] Hexagon: implement machine flag check

2024-04-04 Thread Mark Wielaard
Hi Brian, On Thu, 2024-04-04 at 16:31 +, Brian Cain wrote: > > > ... implies a new EF_HEXAGON_TINY 0x8000 definition BTW. > > > > You obviously know this architecture better than me. But is the TINY > > flag (bit 15) appropriate for all machines? It looks like it can only > > be set on V67 an

Re: [PATCH v3] Hexagon: implement machine flag check

2024-04-04 Thread Mark Wielaard
Hi Matheus, On Thu, Apr 04, 2024 at 02:19:40PM -0300, Matheus Tavares Bernardino wrote: > This fixes the "invalid machine flag" error from eu-elflint when passing > hexagon binaries. > > * backends/hexagon_init.c (hexagon_init): Hook > machine_flag_check > * backends/hexag

Re: [PATCH v3 5/6] stack: Fix stack unwind failure on mips

2024-04-05 Thread Mark Wielaard
Hi Ying, On Tue, Mar 05, 2024 at 05:51:21PM +0800, Ying Huang wrote: > From: Ying Huang > > Add abi_cfi, set_initial_registers_tid, unwind on mips. Sorry for reviewing out of order. But this one looked easy enough. The new abi_cfi, unwind and set_initial_registers_tid implementations looks corr

Re: [PATCH v3 6/6] backends: Add register_info, return_value_location, core_note function on mips

2024-04-05 Thread Mark Wielaard
Hi, On Tue, Mar 05, 2024 at 05:51:22PM +0800, Ying Huang wrote: > From: Ying Huang > > Signed-off-by: Ying Huang > --- > backends/Makefile.am | 3 +- > backends/mips_corenote.c | 85 + > backends/mips_init.c | 3 + > backends/mips_regs.c | 135 +

Re: [PATCH v3] Hexagon: implement machine flag check

2024-04-05 Thread Mark Wielaard
Hi Matheus, On Thu, 2024-04-04 at 16:56 -0300, Matheus Tavares Bernardino wrote: > BTW, just out of curiosity, since the last incident with xz's backdoor > (which apparently involved malicious code disguised as a test binary), > has the elfutils community already considered using something like >

Re: [PATCH] strip: Add check for elf_begin() result

2024-04-05 Thread Mark Wielaard
Hi Maks, On Fri, Apr 05, 2024 at 09:53:03PM +0300, Maks Mishin wrote: > Return value of a function 'elf_begin' is dereferenced at strip.c:1166 > without checking for NULL, but it is usually checked for this function. Please stop sending these "patches" till you actually understand the code. In t

Re: Elfutils Code of Conduct

2024-04-07 Thread Mark Wielaard
t; applies when an individual is officially representing the community > in public spaces. Examples of representing our community include acting > as an appointed representative at an online or offline event. > > ## Enforcement > > Instances of abusive, harassing, or otherwise una

Re: [rfc] [patch] PR28204: debuginfod ima signature verification

2024-04-09 Thread Mark Wielaard
Hi Frank, On Wed, 2024-04-03 at 17:04 -0400, Frank Ch. Eigler wrote: > The following raw diff reworks this long-blocked patch to overcome > these three objections last fall: > > - to drop "permissive" mode We discussed a bit on irc about "wording". But I think it isn't really how it is worded, b

Re: [PATCH] libdw: dwarf_getsrcfiles should not imply dwarf_getsrclines

2024-04-10 Thread Mark Wielaard
Hi Aaron, On Tue, 2024-04-09 at 23:45 -0400, Aaron Merey wrote: > dwarf_getsrcfiles causes line data to be read in addition to file data. > This is wasteful for programs which only need file or directory names. > Debuginfod server is one such example. > > Fix this by moving the srcfile reading in

Re: [PATCH] libdw: dwarf_getsrcfiles should not imply dwarf_getsrclines

2024-04-11 Thread Mark Wielaard
Hi Aaron, On Wed, Apr 10, 2024 at 04:43:53PM -0400, Aaron Merey wrote: > > > - /* Pass the file data structure to the caller. */ > > > - if (filesp != NULL) > > > -*filesp = files; > > > + const char **newdirs = (void *) &newfiles->info[nnewfiles]; > > > + const char **prevdirs =

Re: [rfc] [patch] PR28204: debuginfod ima signature verification

2024-04-11 Thread Mark Wielaard
Hi Frank, On Wed, Apr 10, 2024 at 05:01:36PM -0400, Frank Ch. Eigler wrote: > > > - to drop "permissive" mode > > > > We discussed a bit on irc about "wording". But I think it isn't really > > how it is worded, but that there is just different features. What is > > called "enforcing" is an authen

[PATCH] ar: Replace one alloca use by xmalloc

2024-04-30 Thread Mark Wielaard
. Signed-off-by: Mark Wielaard --- src/ar.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/ar.c b/src/ar.c index e6d6d58f2b3b..fcb8bfb90a9f 100644 --- a/src/ar.c +++ b/src/ar.c @@ -41,6 +41,7 @@ #include #include +#include "libeu.h" #include "arlib.h&

[PATCH] readelf: Fix printing of DW_FORM_strx and DW_MACRO parsing

2024-05-04 Thread Mark Wielaard
efore calling print_form_data. * tests/testfileclangmacro.bz2: New testfile. * tests/Makefile.am (EXTRA_DIST): Add testfileclangmacro.bz2. * tests/run-readelf-macro.sh: Add testfileclangmacro output. Signed-off-by: Mark Wielaard --- src/readelf.c| 13 +-

Re: [PATCH] ar: Replace one alloca use by xmalloc

2024-05-12 Thread Mark Wielaard
Hi Aaron, On Fri, May 10, 2024 at 05:16:06PM -0400, Aaron Merey wrote: > On Tue, Apr 30, 2024 at 10:39 AM Mark Wielaard wrote: > > > > This alloca use is inside a lexical block and is used to replace one > > element of argv. Use a function local variable, xmalloc and fr

Re: [PATCH] readelf: Fix printing of DW_FORM_strx and DW_MACRO parsing

2024-05-14 Thread Mark Wielaard
Hi, On Sun, 2024-05-05 at 00:15 +0200, Mark Wielaard wrote: > print_form_data didn't take the offset_len (4 or 8 bytes) into account > causing the wrong entry to be read from .debug_str_offsets. > print_debug_macro_section did sanity checking before calling > print_form_data,

Re: [rfc] [patch] PR28204: debuginfod ima signature verification

2024-05-14 Thread Mark Wielaard
Hi Aaron, On Thu, 2024-05-09 at 13:56 -0400, Aaron Merey wrote: > I know there's already been a lot of discussion re. ima:permissive and > I'm weighing in rather late, but FWIW I do support including it. > Currently individual ELF sections cannot be downloaded when > ima:enforcing is active. With

Re: [PATCH] Fix 'make coverage' when used with lcov version 2.0+

2024-05-14 Thread Mark Wielaard
Hi, I think things worked out in the end, so that is good. Personally I didn't think Dmitry's request to take his review into account was exaggerating. But that might be because I know him and am happy with his suggestions in general. If the tone of some request was interpreted as "not collegial

Re: [PATCH] readelf: add pretty printing for FDO Dlopen Metadata note

2024-05-14 Thread Mark Wielaard
Hi Luca, On Fri, May 10, 2024 at 10:58:02PM +0100, luca.bocca...@gmail.com wrote: > Note that the webpage in the comment is not published yet, > it will be next week when the next systemd RC is tagged. > The document can be viewed right now on github at: > https://github.com/systemd/systemd/blob/m

Re: [PATCH] readelf: add pretty printing for FDO Dlopen Metadata note

2024-05-31 Thread Mark Wielaard
Hi Luca, On Thu, 2024-05-30 at 11:45 +0100, Luca Boccassi wrote: > On Tue, 14 May 2024 at 22:18, Mark Wielaard wrote: > > Not a fan of json, feels very un-ELF. But it is what it is. The patch > > looks OK. Could you let us know when the elf.h change is accepted in > > glibc

[PATCH 1/2] libelf: Sync elf.h from glibc

2024-05-31 Thread Mark Wielaard
* libelf/elf.h: Adds AT_HWCAP{3,4}, NT_FDO_DLOPEN_METADATA and R_LARCH_TLS_DESC{32,64}. Signed-off-by: Mark Wielaard --- libelf/elf.h | 12 +++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/libelf/elf.h b/libelf/elf.h index f2206e5c065d..081742a9c38c

[PATCH 2/2] readelf: add pretty printing for FDO Dlopen Metadata note

2024-05-31 Thread Mark Wielaard
From: Luca Boccassi The node ID and the string format are now fixed, even if the content of the string might change, it will still be a string. * libebl/eblobjnote.c (ebl_object_note): Handle both type being NT_FDO_PACKAGING_METADATA or NT_FDO_DLOPEN_METADATA when name is "FDO".

Re: elfutils DWARF problem was: Re: Problem with BTF generation on mips64el

2024-06-11 Thread Mark Wielaard
Hi, Adding elfutils-devel to CC to keep everyone up to date on the state of the patches. On Mon, 2024-06-10 at 23:36 -0700, Tony Ambardar wrote: > On Mon, Jun 03, 2024 at 08:47:24PM -0700, Tony Ambardar wrote: > > On Mon, Jun 03, 2024 at 09:18:33PM +0200, Mark Wielaard wrote: > >

Re: make dist considered harmful: odd gotcha with building elfutils rpms

2024-06-11 Thread Mark Wielaard
Hi Frank, On Tue, 2024-06-11 at 10:30 -0400, Frank Ch. Eigler wrote: > While trying to get a reliable fedora-copr build of the git/master > snapshot of elfutils, I ran into a problem that took me too long to > figure out. I was running "make rpm" from an elfutils build tree, > which involves runn

[PATCH] doc: Always distribute all man pages

2024-06-11 Thread Mark Wielaard
dist targets shouldn't depend on configure conditionals. * doc/Makefile.am: Remove DEBUGINFOD and LIBDEBUGINFOD from dist targets. Add comments about which man pages go into which section. Signed-off-by: Mark Wielaard --- doc/Makefile.am | 33 +++

Re: make dist considered harmful: odd gotcha with building elfutils rpms

2024-06-12 Thread Mark Wielaard
Hi Frank, On Tue, Jun 11, 2024 at 12:58:46PM -0400, Frank Ch. Eigler wrote: > > > But I think the root cause is more the continued reliance > > > on "make dist", made necessary by the exclusion of generated autoconf* > > > materiel in the source tree. > > > > I really don't think putting genera

Re: [PATCH] doc: Always distribute all man pages

2024-06-16 Thread Mark Wielaard
Hi, On Tue, Jun 11, 2024 at 06:48:49PM +0200, Mark Wielaard wrote: > dist targets shouldn't depend on configure conditionals. > > * doc/Makefile.am: Remove DEBUGINFOD and LIBDEBUGINFOD from > dist targets. Add comments about which man pages go into which > sect

Re: ☝ Buildbot (Sourceware): elfutils - worker cannot substantiate (main)

2024-06-16 Thread Mark Wielaard
/281 > > Build state: worker cannot substantiate > Revision: (unknown) > Worker: bb1-1 > Build Reason: (unknown) > Blamelist: Mark Wielaard Turns out current fedora rawhide is uninstallable because of a partial python transition. I have disabled the rawhide container builders for now. Cheers, Mark

Re: [PATCH] Add man pages for some libelf functions

2024-06-21 Thread Mark Wielaard
Hi Aaron, On Thu, 2024-06-13 at 16:01 -0400, Aaron Merey wrote: > I've attached a patch that adds man pages for a few libelf functions. > These man pages were originally generated using ChatGPT (model > GPT-4o). I edited each man page by hand to help ensure brevity and > accuracy. > > Parts of th

[PATCH 1/4] libdwfl: Make sure mapped is always set in unzip

2024-06-22 Thread Mark Wielaard
always called with *_whole being NULL. * libdwfl/gzip.c (unzip): Set mapped = state.input_buffer when *whole is not NULL. Signed-off-by: Mark Wielaard --- libdwfl/gzip.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libdwfl/gzip.c b/libdwfl/gzip.c index 002afc4e916b

[PATCH 2/4] libelf: elf32_getshdr might leak section header when out of memory

2024-06-22 Thread Mark Wielaard
Found by GCC -fanalyzer. When allocating the notcvt buffer fails we leak the shdr. goto free_and_out on malloc failure. * libelf/elf32_getshdr.c (load_shdr_wrlock): goto free_and_out on second malloc failure. Signed-off-by: Mark Wielaard --- libelf/elf32_getshdr.c

[PATCH 3/4] debuginfod-client: Don't leak id/version with duplicate os-release entries

2024-06-22 Thread Mark Wielaard
): Check whether id or version is already set before resetting them. Signed-off-by: Mark Wielaard --- debuginfod/debuginfod-client.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debuginfod/debuginfod-client.c b/debuginfod/debuginfod-client.c index 95f2a92b701c

[PATCH 4/4] ar, ranlib: Don't double close file descriptors

2024-06-22 Thread Mark Wielaard
to -1. (do_oper_delete): Likewise. (do_oper_insert): Likewise. * src/ranlib.c (handle_file): Likewise. Signed-off-by: Mark Wielaard --- src/ar.c | 12 ++-- src/ranlib.c | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/ar.c b/src/ar.c

Re: [PATCH 1/4] libdwfl: Make sure mapped is always set in unzip

2024-06-25 Thread Mark Wielaard
Hi, On Sun, Jun 23, 2024 at 01:50:10AM +0200, Mark Wielaard wrote: > Found by GCC14 -Wanalyzer-null-argument. Aaron took a quick look on irc and said all 4 patches looked reasonable. So I pushed them all to main now. Cheers, Mark

Re: [PATCH] Add man pages for some libelf functions

2024-06-28 Thread Mark Wielaard
Hi Aaron, On Wed, 2024-06-26 at 20:22 -0400, Aaron Merey wrote: > > > > In general I wonder how useful the description text generated by > > chatgtp is. It looks very generic and I am a little worried it seems to > > happily generate "descriptions" for none-exiting libelf functions. > > > > > Th

Re: [PATCH] Fix deref-of-null in handle_file_note()

2024-07-02 Thread Mark Wielaard
Hi Maks, On Mon, Jul 01, 2024 at 10:47:05PM +0300, Maks Mishin wrote: > After having been assigned to a NULL value at > dwfl_segment_report_module.c:200, > pointer 'retval' is dereferenced at dwfl_segment_report_module.c:208 by > calling function 'strcmp'. > > Found by RASU JSC. > [...] >

Re: [PATCH] size: Fix deref-of-null in handle_ar() function

2024-07-02 Thread Mark Wielaard
Hi, On Mon, Jul 01, 2024 at 09:54:46PM +0100, Sam James wrote: > Maks Mishin writes: > > > Pointer, returned from function 'elf_getarhdr' at size.c:362, > > may be NULL and is dereferenced at size.c:367. > > > > Your other patch has "Found by RASU JSC." but the rest don't. Are they > all found

Re: [PATCH] unstrip: Fix deref-of-null in copy_elided_sections()

2024-07-02 Thread Mark Wielaard
On Mon, Jul 01, 2024 at 11:53:13PM +0300, Maks Mishin wrote: > Pointer `symstrdata` is dereferenced at unstrip.c:1977 without checking for > NULL. If there has to be a NULL check then it needs to be when symstrdata is assigned a value from elf_getdata. Cheers, Mark

Re: [PATCH] readelf: Fix memory leak in print_hash_info()

2024-07-02 Thread Mark Wielaard
Hi Maks, On Tue, Jul 02, 2024 at 12:05:34AM +0300, Maks Mishin wrote: > Signed-off-by: Maks Mishin > --- > src/readelf.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/src/readelf.c b/src/readelf.c > index c945b371..48035264 100644 > --- a/src/readelf.c > +++ b/src/readelf.c > @@ -359

Re: [PATCH] sparc_attrs: Fix string overflow

2024-07-02 Thread Mark Wielaard
Hi Maks, On Tue, Jul 02, 2024 at 12:33:06AM +0300, Maks Mishin wrote: > A string is copied into the buffer 's' of size 577 without checking its > length first at sparc_attrs.c:95. I don't really like having runtime asserts in the library code. The buffer really should be big enough as the commen

patchwork cleanup

2024-07-03 Thread Mark Wielaard
Hi, I cleaned up our patchwork list of patches needing reviews or updates: https://patchwork.sourceware.org/project/elfutils/list/ We are a little behind on some reviews. Please do take a peek if any of your patches are missing (of so please do resubmit them to this mailinglist), or if there are

Re: [PATCH] libdwfl: Make dwfl_report_offline_memory work with ELF_C_READ_MMAP

2024-07-12 Thread Mark Wielaard
Hi Aleksei, On Thu, 2024-07-11 at 20:35 +, Aleksei Vetrov wrote: > elf_memory open mode recently changed from ELF_C_READ to > ELF_C_READ_MMAP. That was this commit: commit cc44ac6740797a23cd0af0cb22bd828d569224b8 Author: Mark Wielaard Date: Thu Feb 1 14:56:18 2024 +0100 libelf:

Re: [PATCH] backends: allocate enough stace for null terminator

2024-07-17 Thread Mark Wielaard
Hi Sergei, On Mon, 2024-07-15 at 22:23 +0100, Sergei Trofimovich wrote: > `gcc-15` added a new warning in https://gcc.gnu.org/PR115185: > > i386_regs.c:88:11: error: initializer-string for array of 'char' is too > long [-Werror=unterminated-string-initialization] >88 | "ax"

Re: [PATCH v2] backends: allocate enough stace for null terminator

2024-07-18 Thread Mark Wielaard
Hi Sergei, On Wed, 2024-07-17 at 23:03 +0100, Sergei Trofimovich wrote: > `gcc-15` added a new warning in https://gcc.gnu.org/PR115185: > > i386_regs.c:88:11: error: initializer-string for array of 'char' is too > long [-Werror=unterminated-string-initialization] >88 | "ax"

Re: [PATCH 1/9 v2] libelf: Fix deadlock in __libelf_readall

2024-07-18 Thread Mark Wielaard
On Wed, 2024-07-17 at 18:34 -0400, Aaron Merey wrote: > From: Heather McIntyre > > Apply locking during __libelf_readall. > > Signed-off-by: Heather S. McIntyre > Signed-off-by: Aaron Merey > Signed-off-by: Mark Wielaard > > --- > v2 changes: > >

Re: [PATCH 2/9 v2] libelf: Fix deadlock in elf_cntl

2024-07-18 Thread Mark Wielaard
Hi, On Wed, 2024-07-17 at 18:34 -0400, Aaron Merey wrote: > From: Heather McIntyre > > * libelf/elf_cntl.c (elf_cntl): Move rwlock_wrlock, rwlock_unlock, > inside case switch statements. > > Signed-off-by: Heather S. McIntyre > Signed-off-by: Aaron Merey

Re: [PATCH 4/9 v2] libdw: make dwarf_getalt thread-safe

2024-07-18 Thread Mark Wielaard
Hi, On Wed, Jul 17, 2024 at 06:34:03PM -0400, Aaron Merey wrote: > From: Heather McIntyre > > * libdw/dwarf_getalt.c (dwarf_getalt): Add locking. > > Signed-off-by: Heather S. McIntyre > Signed-off-by: Aaron Merey > Signed-off-by: Mark Wielaard > > v2 c

Re: [PATCH 5/9 v2] libdwP.h: Add locking to __libdw_dieabbrev,

2024-07-18 Thread Mark Wielaard
Hi, On Wed, Jul 17, 2024 at 06:34:04PM -0400, Aaron Merey wrote: > From: Heather McIntyre > > Signed-off-by: Heather S. McIntyre > Signed-off-by: Aaron Merey > Signed-off-by: Mark Wielaard > > --- > > v2 changes: > This replaces patch "libdw: Add l

Re: [PATCH 6/9 v2] libdw: Make libdw_find_split_unit thread-safe

2024-07-18 Thread Mark Wielaard
Hi, On Wed, Jul 17, 2024 at 06:34:05PM -0400, Aaron Merey wrote: > From: Heather McIntyre > > * (__libdw_find_split_unit): Add lock for cu->split. > > Signed-off-by: Heather S. McIntyre > Signed-off-by: Aaron Merey > Signed-off-by: Mark Wielaard > >

Re: [PATCH 7/9 v2] libdw: Make libdw_findcu thread-safe

2024-07-19 Thread Mark Wielaard
tyre > Signed-off-by: Aaron Merey > Signed-off-by: Mark Wielaard > > --- > v2 changes: > Use per-Dwarf_CU lock instead of a global lock. Are you sure this description and the ChangeLog entry are correct? This patch doesn't contain a change to use eu_tfind (there is already one

Re: [PATCH 3/9 v2] lib: Add eu_tsearch, eu_tfind, eu_tdelete and eu_tdestroy

2024-07-19 Thread Mark Wielaard
Move the rwlock_* macros out of eu-config.h and into a new header file > locks.h. This was done so that the rwlock_* macros can be included > in libdwP.h without having to also include the rest of eu-config.h. > > Signed-off-by: Heather S. McIntyre > Signed-off-by: Aaron Merey

Re: [PATCH] Add man pages for some libelf functions

2024-07-21 Thread Mark Wielaard
Hi Aaron, Some small comments below. On Thu, Jul 18, 2024 at 10:03:02PM -0400, Aaron Merey wrote: > Add man pages for elf32_offscn.3, elf64_offscn.3, elf_getscn.3 and > elf_ndxscn.3. > > Signed-off-by: Aaron Merey > --- > > Reposting this patch with the new man pages added to doc/Makefile.am.

Re: debuginfod support for split dwarf

2024-07-21 Thread Mark Wielaard
Hi Bogdan, On Sat, Jul 20, 2024 at 09:12:01PM -0400, Bogdan Ciobanu wrote: > Is there any way to serve debugging information stored in .dwo files from a > debuginfod server? For my use case, linking binaries from object files > containing debugging symbols exceeds memory capacity, so object files

Re: [PATCH 01/10 v3] libelf: Fix deadlock in __libelf_readall

2024-08-15 Thread Mark Wielaard
Hi Aaron, On Fri, 2024-08-02 at 19:38 -0400, Aaron Merey wrote: > From: Heather McIntyre > > Apply locking during __libelf_readall. > > Signed-off-by: Heather S. McIntyre > Signed-off-by: Aaron Merey > Signed-off-by: Mark Wielaard > > --- > v3 changes: > &

Re: [PATCH 02/10 v3] libelf: Fix deadlock in elf_cntl

2024-08-15 Thread Mark Wielaard
McIntyre > Signed-off-by: Aaron Merey > Signed-off-by: Mark Wielaard > > --- > v3 changes: > Remove unnecessary early return that would require locking to > check condition. The code looks good and clean now. Thanks, Mark

Re: [PATCH 03/10 v3] lib: Add eu_tsearch, eu_tfind, eu_tdelete and eu_tdestroy

2024-08-15 Thread Mark Wielaard
* elf_getdata_rawchunck.c: Ditto. > * libelfP.h (struct Elf): Replace void * rawchuncks memeber with > search_tree rawchunk_tree. Nice Changelog. (note the memeber typo) > Signed-off-by: Heather S. McIntyre > Signed-off-by: Aaron Merey > Signed-off-by: Mark Wielaard

Re: [PATCH 04/10 v3] libdw: Add rwlocks for Dwarf and Dwarf_CU

2024-08-16 Thread Mark Wielaard
Hi Aaron, On Fri, 2024-08-02 at 19:38 -0400, Aaron Merey wrote: > From: Heather McIntyre > > Add dwarf_lock for Dwarf as well as abbrev_lock for Dwarf_CU. > > * libdw/dwarf_begin_elf.c (dwarf_begin_elf): Init dwarf_lock. > * libdw/dwarf_end.c (cu_free): Free abbrev_lock. > (dw

Re: [PATCH 05/10 v3] libdw: make dwarf_getalt and dwarf_setalt thread-safe

2024-08-16 Thread Mark Wielaard
On Fri, 2024-08-02 at 19:38 -0400, Aaron Merey wrote: > From: Heather McIntyre > > * libdw/dwarf_getalt.c (dwarf_getalt): Add locking. > * libdw/dwarf_setalt.c (dwarf_setalt): Ditto. > > Signed-off-by: Heather S. McIntyre > Signed-off-by: Aaron Merey > Sign

Re: [PATCH 09/10 v3] tests: Add eu-search tests

2024-08-16 Thread Mark Wielaard
efined. > (eu_search_die_LDFLAGS): Likewise. > (eu_search_lines_LDFLAGS): Likewise. > (eu_search_macros_LDFLAGS): Likewise. > > Signed-off-by: Heather S. McIntyre > Signed-off-by: Aaron Merey > Signed-off-by: Mark Wielaard > > --- > No changes betwee

Re: [PATCH 07/10 v3] libdw: Make libdw_find_split_unit thread-safe

2024-08-16 Thread Mark Wielaard
cIntyre > Signed-off-by: Aaron Merey > Signed-off-by: Mark Wielaard > > --- > v3 changes: > Move Dwarf split_lock code from patch 3/9 v2 to this patch. > Assign return value before releasing lock. Looks good this way. Thanks, Mark > libdw/dwarf_end.c

Re: [PATCH 08/10 v3] libdw: Make libdw_findcu thread-safe

2024-08-16 Thread Mark Wielaard
Hi, On Fri, Aug 02, 2024 at 07:38:07PM -0400, Aaron Merey wrote: > From: Heather McIntyre > > * libdw/libdw_findcu.c (__libdw_findcu): Add locking. > > Signed-off-by: Heather S. McIntyre > Signed-off-by: Aaron Merey > Signed-off-by: Mark Wielaard > &

Re: [PATCH 06/10 v3] libdwP.h: Add locking to dwarf_formref_die and __libdw_dieabbrev

2024-08-16 Thread Mark Wielaard
igned-off-by: Heather S. McIntyre > Signed-off-by: Aaron Merey > Signed-off-by: Mark Wielaard > > v3 changes: > Move dwarf_setalt.c changes to patch 5/9 v3. > Set __libdw_dieabbrev result before releasing lock. > --- > libdw/dwarf_formref_die

Re: [PATCH 0/3] aarch64: add some core note types name

2024-08-16 Thread Mark Wielaard
Hi, On Wed, Aug 14, 2024 at 04:51:17PM +0800, Kuan-Ying Lee wrote: > Patch 1: > - Add MTE related regset in core note > Patch 2: > - Add PAC related regset in core note > Patch 3: > - Add some core note types name This look good. Thanks. For elf.h we try to keep it in sync with the glibc elf/

[COMMITTED] libelf: Sync elf.h from glibc

2024-08-16 Thread Mark Wielaard
* libelf/elf.h: Adds NT_ARM_{SSVE,ZA,ZT,FPRM} Signed-off-by: Mark Wielaard --- libelf/elf.h | 4 1 file changed, 4 insertions(+) diff --git a/libelf/elf.h b/libelf/elf.h index 081742a9c38c..33aea7f743b8 100644 --- a/libelf/elf.h +++ b/libelf/elf.h @@ -831,6 +831,10 @@ typedef

Re: [PATCH 1/3] aarch64: Add NT_ARM_TAGGED_ADDR_CTRL regset

2024-08-16 Thread Mark Wielaard
On Wed, Aug 14, 2024 at 04:51:18PM +0800, Kuan-Ying Lee wrote: > Add the NT_ARM_TAGGED_ADDR_CTRL regset for aarch64. > Recognize and print this new core itme. Thanks, found the description (The corresponding regset is 1 element of 8 bytes) here https://docs.kernel.org/arch/arm64/memory-tagging-ext

Re: [PATCH 2/3] aarch64: Add NT_ARM_PAC_* regset

2024-08-16 Thread Mark Wielaard
Hi, On Wed, Aug 14, 2024 at 04:51:19PM +0800, Kuan-Ying Lee wrote: > Add the NT_ARM_PAC_MASK and NT_ARM_PAC_ENABLED_KEYS for aarch64. > Recognize and print the new core item. For NT_ARM_PAC_MASK it looks like the user_pac_mask struct, so two 8 byte words. But for NT_ARM_PAC_ENABLED_KEYS I cannot

Re: [PATCH 3/3] aarch64: add some new core note types name

2024-08-16 Thread Mark Wielaard
Hi, On Wed, Aug 14, 2024 at 04:51:20PM +0800, Kuan-Ying Lee wrote: > Recognize names of some new core note types in ebl_core_note_type_name. Thanks. Pushed the eblcorenotetypename.c part. I pushed a glibc elf.h sync separately (commit 0abdd2e79). Cheers, Mark

Re: [PATCH 5/5] libdwfl, aarch64: Read PAC mask from core

2024-08-16 Thread Mark Wielaard
Hi Steve, On Fri, Jun 14, 2024 at 03:47:19PM +0100, Steve Capper wrote: > We need to read the PAC mask from a core file when debugging offline > as the information is still needed to demangle return addresses. > > This commit pulls out the NT_ARM_PAC_MASK info from the core and feeds > it through

Re: [PATCH 1/5] aarch64: Create definitions for AARCH64_RA_SIGN_STATE register

2024-08-20 Thread Mark Wielaard
On Fri, Jun 14, 2024 at 03:47:15PM +0100, Steve Capper wrote: > From: German Gomez > > This register will be used to indicate whether a return address is > mangled with a PAC or not, in accordance with the DWARF AARCH64 ABI [1]. > > [1] > https://github.com/ARM-software/abi-aa/blob/main/aadwarf

Re: [PATCH 2/5] libdw, aarch64: Implement DW_CFA_AARCH64_negate_ra_state CFI instruction

2024-08-20 Thread Mark Wielaard
Hi, On Fri, Jun 14, 2024 at 03:47:16PM +0100, Steve Capper wrote: > From: German Gomez > > Implement DW_CFA_AARCH64_negate_ra_state in accordance with the DWARF > AARCH64 ABI [1]. > > Followup commits will use the value of this register to remove the PAC > from return addresses. Looks correct.

Re: [PATCH 1/5] aarch64: Create definitions for AARCH64_RA_SIGN_STATE register

2024-08-20 Thread Mark Wielaard
Hi, Sorry, one more thing. On Fri, Jun 14, 2024 at 03:47:15PM +0100, Steve Capper wrote: > index 4be32de5..f6d26044 100644 > --- a/libdw/dwarf.h > +++ b/libdw/dwarf.h > @@ -1028,6 +1028,11 @@ enum > DW_EH_PE_indirect = 0x80 >}; > > +/* AARCH64 DWARF registers. */ > +enum > + { > +

Re: [PATCH 0/5] Enable PAC support in elfutils

2024-08-20 Thread Mark Wielaard
Hi Steve, On Fri, Jun 14, 2024 at 03:47:14PM +0100, Steve Capper wrote: > This series enables Pointer Authentication (PAC) support in elfutils. > > The first four patches were originally posted by German Gomez. I've > rebased to the latest elfutils and added an extra patch that was > required to

[PATCH] debuginfod: Make sure crypto and jsonc are also included in static link

2024-08-21 Thread Mark Wielaard
When doing a --enable-gcov build we link all binaries static. libdebuginfod.so now depends on crypto an jsonc. So also add those when linking against libdebuginfod.a debuginfod/Makefile.am (libdebuginfod): Add $(crypto_LIBS) $(jsonc_LIBS) when BUILD_STATIC. Signed-off-by: Mark

[PATCH] tests: When BUILD_STATIC always link against libeu

2024-08-21 Thread Mark Wielaard
libeu is a static library with internal helper functions normally included in all shared libraries. But when linking static (with --enable-gcov) we need to explicitly link it into the test binaries. * tests/Makefile.am (libelf): Add $(libeu) when BUILD_STATIC. Signed-off-by: Mark Wielaard

Re: [PATCH] debuginfod: Make sure crypto and jsonc are also included in static link

2024-08-21 Thread Mark Wielaard
Hi, On Wed, Aug 21, 2024 at 03:32:59PM +0200, Mark Wielaard wrote: > When doing a --enable-gcov build we link all binaries static. > libdebuginfod.so now depends on crypto an jsonc. So also add those > when linking against libdebuginfod.a > > debuginfod/Makefile.am (libd

Re: [PATCH] tests: When BUILD_STATIC always link against libeu

2024-08-21 Thread Mark Wielaard
Hi, On Wed, Aug 21, 2024 at 03:52:20PM +0200, Mark Wielaard wrote: > libeu is a static library with internal helper functions normally > included in all shared libraries. But when linking static (with > --enable-gcov) we need to explicitly link it into the test binaries. > >

Re: [PATCH 1/9] doc: Add elf32_checksum.3 and elf64_checksum.3

2024-08-27 Thread Mark Wielaard
Hi Aaron, On Wed, 2024-08-14 at 17:33 -0400, Aaron Merey wrote: > Signed-off-by: Aaron Merey > --- > doc/elf32_checksum.3 | 47 > doc/elf64_checksum.3 | 47 > 2 files changed, 94 insertions(+) > create mod

Re: [PATCH 2/9] doc: Add elf32_fsize.3 and elf64_fsize.3

2024-08-27 Thread Mark Wielaard
Hi Aaron, On Wed, 2024-08-14 at 17:33 -0400, Aaron Merey wrote: > Signed-off-by: Aaron Merey > --- > doc/elf32_fsize.3 | 59 +++ > doc/elf64_fsize.3 | 59 +++ > 2 files changed, 118 insertions(+) > create mo

Re: [PATCH 3/9] doc: Add elf32_getchdr.3 and elf64_getchdr.3

2024-08-27 Thread Mark Wielaard
Hi Aaron, On Wed, 2024-08-14 at 17:33 -0400, Aaron Merey wrote: > diff --git a/doc/elf32_getchdr.3 b/doc/elf32_getchdr.3 > new file mode 100644 > index ..902ae09c > --- /dev/null > +++ b/doc/elf32_getchdr.3 > @@ -0,0 +1,48 @@ > +.TH ELF32_GETCHDR 3 2024-08-14 "Libelf" "Libelf Programmer's

Re: [PATCH 4/9] doc: Add elf32_getphdr.3 and elf64_getphdr.3

2024-08-27 Thread Mark Wielaard
Hi Aaron, On Wed, Aug 14, 2024 at 05:33:16PM -0400, Aaron Merey wrote: > diff --git a/doc/elf32_getphdr.3 b/doc/elf32_getphdr.3 > new file mode 100644 > index ..7245f81b > --- /dev/null > +++ b/doc/elf32_getphdr.3 > @@ -0,0 +1,45 @@ > +.TH ELF32_GETPHDR 3 2024-08-14 "Libelf" "Libelf Progra

Re: [PATCH 5/9] doc: Add elf32_getshdr.3 and elf64_getshdr.3

2024-08-27 Thread Mark Wielaard
Hi Aaron, Meta. In this series I am only commenting on the elf32 variants, because the elf64 variants are really just identical. Would it make sense to combine these into one man page? e.g readv and writev are really the same: https://man7.org/linux/man-pages/man2/readv.2.html https://man7.org/li

Re: [PATCH 6/9] doc: Add elf32_newehdr.3 and elf64_newehdr.3

2024-08-28 Thread Mark Wielaard
Hi Aaron, On Wed, 2024-08-14 at 17:33 -0400, Aaron Merey wrote: > diff --git a/doc/elf32_newehdr.3 b/doc/elf32_newehdr.3 > new file mode 100644 > index ..95f8f16d > --- /dev/null > +++ b/doc/elf32_newehdr.3 > @@ -0,0 +1,53 @@ > +.TH ELF32_NEWEHDR 3 2024-08-14 "Libelf" "Libelf Programmer's

Re: [PATCH 7/9] doc: Add elf32_newphdr.3 and elf64_newphdr.3

2024-08-28 Thread Mark Wielaard
Hi Aaron, On Wed, 2024-08-14 at 17:33 -0400, Aaron Merey wrote: > diff --git a/doc/elf32_newphdr.3 b/doc/elf32_newphdr.3 > new file mode 100644 > index ..8f55566c > --- /dev/null > +++ b/doc/elf32_newphdr.3 > @@ -0,0 +1,62 @@ > +.TH ELF32_NEWPHDR 3 2024-08-14 "Libelf" "Libelf Programmer'

Re: [PATCH 8/9] doc: Add elf32_xlatetof.3 and elf64_xlatetof.3

2024-08-28 Thread Mark Wielaard
Hi Aaron, I would recommend combining these two with the next two from [PATCH 9/9] doc: Add elf32_xlatetom.3 and elf64_xlatetom.3. They essentially do the same things. On Wed, 2024-08-14 at 17:33 -0400, Aaron Merey wrote: > diff --git a/doc/elf32_xlatetof.3 b/doc/elf32_xlatetof.3 > new file mode

[PATCH] elf*_xlatetof: do not check ELF_T_NHDR[8] has integer number of records

2024-08-28 Thread Mark Wielaard
number of records in case of ELF_T_NHDR[8]. Signed-off-by: Mark Wielaard --- libelf/elf32_xlatetof.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libelf/elf32_xlatetof.c b/libelf/elf32_xlatetof.c index ab857409329a..ab3e609ee5d2 100644 --- a/libelf/elf32_xlatetof.c ++

[PATCH] libelf: Don't crash elf[32|64]_xlateto[fm] on bad arguments.

2024-08-28 Thread Mark Wielaard
Check that src and dest aren't NULL and that src->d_type < ELF_T_NUM. * elf32_xlatetof.c (elfw2(LIBELFBITS, xlatetof)): Check src, dest and src->d_type are valid. * elf32_xlatetom.c (elfw2(LIBELFBITS, xlatetom)): Likewise. Signed-off-by: Mark Wielaar

elf_memory again, readonly or readwrite...

2024-08-29 Thread Mark Wielaard
Hi, So we changed elf_memory so it pretends the in-memory Elf image is read with ELF_C_READ_MMAP. This helps when calling elf_memory on read-only memory which still wants to change some things about the Elf like uncompress some sections (which changes the section header). With ELF_C_READ_MMAP lib

Re: [PATCH v2 0/5] Enable PAC support in elfutils

2024-08-30 Thread Mark Wielaard
Hi Steve, On Mon, 2024-08-26 at 11:52 +0100, Steve Capper wrote: > Hello, > This series enables Pointer Authentication (PAC) support in elfutils. > > The first three patches were originally posted by German Gomez. I've > rewritten a new patch to extend the dwfl_thread_state_registers function > t

Re: [PATCH 2/3] aarch64: Add NT_ARM_PAC_* regset

2024-08-30 Thread Mark Wielaard
Hi Kuan-Ying, On Mon, 2024-08-19 at 17:43 +0800, Kuan-Ying Lee wrote: > On Sat, Aug 17, 2024 at 01:36:33AM +0200, Mark Wielaard wrote: > > On Wed, Aug 14, 2024 at 04:51:19PM +0800, Kuan-Ying Lee wrote: > > > Add the NT_ARM_PAC_MASK and NT_ARM_PAC_ENABLED_KEYS for aarch64. &

[COMMITTED] readelf: Fix printing of .gdb_index symbol table offset.

2024-09-06 Thread Mark Wielaard
table offsets that were the same as the address offset. Signed-off-by: Mark Wielaard --- src/readelf.c | 2 +- tests/run-readelf-gdb_index.sh | 8 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/readelf.c b/src/readelf.c index 48035264be13

[PATCH] readelf: Allow .gdb_index const table to be empty

2024-09-07 Thread Mark Wielaard
end. Signed-off-by: Mark Wielaard --- src/readelf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/readelf.c b/src/readelf.c index 8d96443daa83..21cacd7b6c06 100644 --- a/src/readelf.c +++ b/src/readelf.c @@ -11679,7 +11679,7 @@ print_gdb_index_section (Dwfl_Module *dwflmod

[PATCH] srcfiles: Fix compile with --disable-libdebuginfod

2024-09-09 Thread Mark Wielaard
ENABLE_LIBDEBUGINFOD after no_backup check. * tests/Makefile.am (TESTS): Only add run-srcfiles-self.sh if DEBUGINFOD and !DUMMY_LIBDEBUGINFOD. * tests/run-srcfiles.self.sh: Use local DEBUGINFOD_CACHE_PATH. https://sourceware.org/bugzilla/show_bug.cgi?id=32155 Signed-off-by: Mark Wielaard

Re: pkg-config not used in configure?

2024-09-10 Thread Mark Wielaard
Hi Paul, On Mon, Sep 09, 2024 at 06:21:16PM -0400, Paul Smith wrote: > On Mon, 2024-09-09 at 15:29 -0400, Paul Smith wrote: > > I'm trying to build the latest elfutils release 0.191.  The configure > > help says: > > > >   ZSTD_COMPRESS_CFLAGS > >   C compiler flags for ZSTD_COMPRESS,

Re: [PATCH] readelf: Allow .gdb_index const table to be empty

2024-09-10 Thread Mark Wielaard
Hi, On Sun, 2024-09-08 at 00:00 +0200, Mark Wielaard wrote: > The .gdb_index const table can be empty, if no symbol table entry > refers to a name or CU. Which technically means the symbol table is > empty or has only zero members. > > * src/readelf.c (print_gdb_index_

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

2024-09-10 Thread Mark Wielaard
gt; > Build state: failed test (failure) > Revision: 1ccbd384375d4c84aecc6dc382d372f5979a1f0c > Worker: fedora-ppc64le > Build Reason: (unknown) > Blamelist: Mark Wielaard > > [...] > > - 7: make check ( failure ) > Logs: > - stdio: > https://bu

<    1   2   3   4   5   6   7   8   9   10   >