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

[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

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 > > g

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: >

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

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.

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, which

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

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

2024-05-04 Thread Mark Wielaard
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 +- tests

[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&

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

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 *) >info[nnewfiles]; > > > + const char **prevdirs = (void *)

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

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,

Re: Elfutils Code of Conduct

2024-04-07 Thread Mark Wielaard
dual 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 unacceptable behavior may &g

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

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 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 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

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 > *

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

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

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

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

Re: [PATCH] segment: Fix dangling pointer

2024-04-03 Thread Mark Wielaard
ut 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 г. в 00:04,

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

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

Re: [PATCH] tests, config: Add more .gitignore files

2024-04-01 Thread Mark Wielaard
On Fri, Mar 29, 2024 at 12:43:08AM +0100, Mark Wielaard wrote: > Some new tests and one configure file weren't in .gitignore. Also > we made a copy of libelf.h in tests/ which should be an symlink. > > * config/.gitignore: Add profile.fish. > * tests/

Re: [PATCH v3 1/6] Support Mips architecture

2024-03-28 Thread Mark Wielaard
Hi Ying, On Tue, Mar 05, 2024 at 05:51:17PM +0800, Ying Huang wrote: > From: Ying Huang > > Signed-off-by: Ying Huang > --- > backends/Makefile.am| 6 +- > backends/mips_init.c| 52 > backends/mips_reloc.def | 93 +++ > backends/mips_symbol.c | 63 + >

[PATCH] tests, config: Add more .gitignore files

2024-03-28 Thread Mark Wielaard
/Makefile.am (libelf.h): Make symlink instead of copy. Signed-off-by: Mark Wielaard --- config/.gitignore | 1 + tests/.gitignore | 3 +++ tests/Makefile.am | 2 +- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/config/.gitignore b/config/.gitignore index 8cd8ccdbf3c1..b7897159babf

Re: [PATCH] nm: Fix descriptor leak

2024-03-28 Thread Mark Wielaard
Hi, On Thu, Mar 28, 2024 at 11:49:58PM +0300, Maks Mishin wrote: > The descriptor 'dwfl_fd' is created at nm.c:1278 by calling > function 'dup' and lost at nm.c:1593. Sorry, I don't follow, the code at nm.c:1278 says: /* Duplicate an fd for dwfl_report_offline to swallow. */

Re: [PATCH] segment: Fix dangling pointer

2024-03-28 Thread Mark Wielaard
Hi Maks, On Thu, Mar 28, 2024 at 11:29:22PM +0300, Maks Mishin wrote: > Pointer 'lookup_module' which is a field of the structure 'Dwfl' > freed at segment.c:88 is not overwritten, but it is usually overwritten > after free. But the very next statement is a return true; so old isn't in scope

Re: [PATCH 0/2] Add initial support for Hexagon

2024-03-28 Thread Mark Wielaard
Hi Matheus, On Thu, Mar 21, 2024 at 06:09:08PM -0300, Matheus Tavares Bernardino wrote: > The patches were inspired by > https://sourceware.org/cgit/elfutils/commit?id=13a4d1279c5b7847049ca3045d04f2705c45ce31 > > Related to: >

[COMMITTED] tests: Use bash for run-debuginfod-client-profile.sh

2024-03-27 Thread Mark Wielaard
The test uses set -o pipefail which is a bashism and so the test fails on systems where /bin/sh isn't bash. * tests/run-debuginfod-client-profile.sh: Use bash. Signed-off-by: Mark Wielaard --- tests/run-debuginfod-client-profile.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion

Re: [PATCH] config/profile.fish.in: Prevent bracketed variables and unmatched wildcard errors

2024-03-27 Thread Mark Wielaard
Hi Aaron, Adding Freso to the CC since he is the original author of the fish support. On Tue, Mar 26, 2024 at 07:52:49PM -0400, Aaron Merey wrote: > Fish does not support bracketed variables in scripts. Remove brackets > from the variable ${prefix} in profile.fish before installation to >

Re: [PATCH] config: Make sure profile.sh succeeds with set -e and set -o pipefail

2024-03-27 Thread Mark Wielaard
Hi Dmitry, On Wed, Mar 27, 2024 at 12:59:13AM +0200, Dmitry V. Levin wrote: > On Tue, Mar 26, 2024 at 09:49:48PM +0100, Mark Wielaard wrote: > > profile.sh might fail with set -o pipefail because: > > > > cat /dev/null "${prefix}/etc/debuginfod"/*.urls 2>/dev

[PATCH] config: Make sure profile.sh succeeds with set -e and set -o pipefail

2024-03-26 Thread Mark Wielaard
n "" at end of pipe. * tests/run-debuginfod-client-profile.sh: New test. * tests/Makefile.am (TESTS): Add run-debuginfod-client-profile.sh. (EXTRA_DIST): Likewise. https://sourceware.org/bugzilla/show_bug.cgi?id=31562 Signed-off-by: Mark Wielaard --- config/

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

2024-03-24 Thread Mark Wielaard
*** [Makefile:981: rpmbuild] Error 1 Aha, we forgot to add it to the debuginfod-client package. That is what the attached patch does. Which I just pushed. Cheers, Mark>From 8f3818574a6abe1fbab1682698b2cef146522148 Mon Sep 17 00:00:00 2001 From: Mark Wielaard Date: Sun, 24 Mar 2024 18:46:02 +0100 Subject:

Re: [PATCH] Getter and setter for Dwfl's offline_next_address

2024-03-24 Thread Mark Wielaard
Hi Martin, On Sun, Mar 24, 2024 at 11:11:21AM -0300, Martin Rodriguez Reboredo wrote: > On 3/20/24 19:52, Mark Wielaard wrote: > >Could you show an example of when/where you need it and what address > >you set it to? > > For example, this test program reports the name

Re: [PATCH v2] config: Add profile script for fish shell

2024-03-24 Thread Mark Wielaard
Hi Freso, On Fri, Mar 22, 2024 at 06:21:04PM +0100, Frederik “Freso” S. Olesen wrote: > Add support for setting $DEBUGINFOD_URLS automatically in the fish shell > similar to the profile scripts for POSIX and csh shells. > > Makefile is set to install this into fish’s $XDG_DATA_DIRS vendor >

Re: [PATCH] config: Add profile script for fish shell

2024-03-21 Thread Mark Wielaard
sen > + > + * profile.fish.in: Set $DEBUGINFOD_URLS in fish shells. > + * Makefile.am: Include profile.fish in install and uninstall targets. Since we have been putting the ChangeLog entry into the commit message it doesn't need to also go into the actual Changelog file. > 2023-02-21

Re: [PATCH] riscv: Partial implementation of flatten_aggregate

2024-03-20 Thread Mark Wielaard
Hi Palmer, On Wed, Mar 20, 2024 at 01:17:14PM -0700, Palmer Dabbelt wrote: > >+flatten_aggregate_arg (Dwarf_Die *typedie, > >+ Dwarf_Word size, > >+ Dwarf_Die *arg0, > >+ Dwarf_Die *arg1) > > { > >- /* ??? */ > >+ int tag0, tag1; > >+

Re: [PATCH] Getter and setter for Dwfl's offline_next_address

2024-03-20 Thread Mark Wielaard
Hi Martin, On Wed, Mar 06, 2024 at 04:22:49PM -0300, Martin Rodriguez Reboredo wrote: > Added new functions dwfl_get_offline_next_address and > dwfl_set_offline_next_address which will get plus set said field from > the Dwfl struct. This is a requirement for listing functions from their >

Re: [PATCH] riscv: Partial implementation of flatten_aggregate

2024-03-20 Thread Mark Wielaard
Hi Aaron, On Wed, Mar 20, 2024 at 02:14:18PM -0400, Aaron Merey wrote: > On Wed, Mar 20, 2024 at 11:03 AM Mark Wielaard wrote: > > > > dwfl_module_return_value_location would fail on riscv for functions > > which return a (small) struct. This patch implements t

[PATCH] riscv: Partial implementation of flatten_aggregate

2024-03-20 Thread Mark Wielaard
-native.sh: New test. * tests/run-funcretval-struct.sh: Likewise. https://sourceware.org/bugzilla/show_bug.cgi?id=31142 Signed-off-by: Mark Wielaard --- backends/riscv_retval.c| 123 ++--- tests/Makefile.am | 7 ++ tests

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

2024-03-11 Thread Mark Wielaard
On Mon, Mar 11, 2024 at 07:05:53AM -0700, Khem Raj wrote: > On Mon, Mar 11, 2024 at 4:23 AM Mark Wielaard wrote: > > > - 5: make check ( failure ) > > > Logs: > > > - stdio: > > > https://builder.sourceware.org/buildbot/#/bui

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

2024-03-11 Thread Mark Wielaard
Hi Khem, On Mon, 2024-03-11 at 02:33 +, buil...@sourceware.org wrote: > A new failure has been detected on builder elfutils-snapshots-coverage while > building elfutils. > > Full details are available at: > https://builder.sourceware.org/buildbot/#/builders/250/builds/105 > > Build

Re: [PATCH] Setter for Dwfl's offline_next_address

2024-03-02 Thread Mark Wielaard
Hi Martin, On Sat, Mar 02, 2024 at 07:43:38PM -0300, Martin Rodriguez Reboredo wrote: > On 3/2/24 17:47, Mark Wielaard wrote: > >On Fri, Mar 01, 2024 at 05:04:05PM -0300, Martin Rodriguez Reboredo wrote: > >>Added a new function dwfl_set_offline_next_addres which will set s

Re: [PATCH] Setter for Dwfl's offline_next_address

2024-03-02 Thread Mark Wielaard
Hi Martin, On Fri, Mar 01, 2024 at 05:04:05PM -0300, Martin Rodriguez Reboredo wrote: > Added a new function dwfl_set_offline_next_addres which will set said > field from the Dwfl struct. This is a requirement for listing functions > from their addresses when using libdwfl offline, otherwise

[COMMITTED] GPG-KEY: Add key for Aaron Merey

2024-03-01 Thread Mark Wielaard
Signed-off-by: Mark Wielaard --- GPG-KEY | 34 ++ 1 file changed, 34 insertions(+) diff --git a/GPG-KEY b/GPG-KEY index 671373e6..dca558b7 100644 --- a/GPG-KEY +++ b/GPG-KEY @@ -112,3 +112,37 @@ AwhaG1W+Y3LDe7S19M0cUzftEUeq3Jd89hoijC72tdba+BRfW0ncfvEcsk9QifSU

Re: [PATCH v3 4/4] libdw: Handle overflowed DW_SECT_INFO offsets in DWARF package file indexes

2024-03-01 Thread Mark Wielaard
Hi, On Fri, 2024-03-01 at 15:59 +0100, Mark Wielaard wrote: > This looks correct, but gcc noticed a path to use tu_offset (and > tu_index) if they weren't initialized or NULL: > > In file included from /home/mark/src/elfutils/libdw/libdwP.h:684, > from > /home

Re: [PATCH v3 4/4] libdw: Handle overflowed DW_SECT_INFO offsets in DWARF package file indexes

2024-03-01 Thread Mark Wielaard
Hi Omar, On Mon, 2024-02-26 at 11:32 -0800, Omar Sandoval wrote: > Meta uses DWARF package files for our large, statically-linked C++ > applications. Some of our largest applications have more than 4GB in > .debug_info.dwo, but the section offsets in .debug_cu_index and > .debug_tu_index are 32

Re: [PATCH v3 3/4] libdw: Apply DWARF package file section offsets where appropriate

2024-02-29 Thread Mark Wielaard
Hi Omar, On Mon, Feb 26, 2024 at 11:32:50AM -0800, Omar Sandoval wrote: > The final piece of DWARF package file support is that offsets have to be > interpreted relative to the section offset from the package index. > .debug_abbrev.dwo is already covered, so sprinkle around calls to >

Re: [PATCH v3 2/4] libdw: Refactor dwarf_next_lines and fix skipped CU

2024-02-29 Thread Mark Wielaard
Hi Omar, On Mon, Feb 26, 2024 at 11:32:49AM -0800, Omar Sandoval wrote: > dwarf_next_lines has two loops over CUs: one from the CU after the given > CU to the end, and one from the first CU up to _but not including_ the > given CU. This means that the given CU is never checked. > > This is

Re: [PATCH v3 1/4] libdw: Handle split DWARF in dwarf_decl_file

2024-02-29 Thread Mark Wielaard
Hi Omar, On Mon, Feb 26, 2024 at 11:32:48AM -0800, Omar Sandoval wrote: > Calling dwarf_decl_file on a split DWARF DIE fails this assertion: > > dwarf_decl_file.c:72: dwarf_decl_file: Assertion `cu->files != NULL && > cu->files != (void *) -1l' failed. > > This is because dwarf_decl_file

Re: [PATCH v2] Add __libdw_getdieranges

2024-02-29 Thread Mark Wielaard
Hi Aaron, On Tue, Feb 27, 2024 at 08:11:39PM -0500, Aaron Merey wrote: > __libdw_getdieranges builds an aranges list by iterating over each > CU and recording each address range. > > This function is an alternative to dwarf_getaranges. dwarf_getaranges > attempts to read address ranges from

Re: [PATCH] readelf: Use unsigned loop variables in handle_verneed and handle_verdef

2024-02-27 Thread Mark Wielaard
On Wed, 2024-02-21 at 22:19 +0100, Mark Wielaard wrote: > Prevent signed underflow by changing loop variables to unsigned and > doing count checks before decrementing. This isn't really a bug, but > prevents UB detected by ubsan on fuzzed input. The bad (fuzzed) input > data does

Re: [PATCH] libebl: ebl_object_note print 32bit annobin address ranges correctly

2024-02-27 Thread Mark Wielaard
Hi, On Wed, 2024-02-21 at 21:59 +0100, Mark Wielaard wrote: > Annobin address ranges were always printed as if they were 64bit wide > because addr_size was set to twice the size. This was done because the > note description size should contain two addresses. Fix this by setting > the

Re: [PATCH] Add __libdw_getdieranges

2024-02-27 Thread Mark Wielaard
Hi Aaron, On Mon, 2024-02-26 at 10:40 -0500, Aaron Merey wrote: > __libdw_getdieranges builds an aranges list by iterating over CUs and > recording each address range. > > __libdw_getdieranges provides an alternative to relying on .debug_aranges > for address ranges, since this section might be

Sourceware infrastructure updates for Q1 2024

2024-02-27 Thread Mark Wielaard
Sourceware infrastructure community updates for Q1 2024 A summary of news about Sourceware, the Free Software hosting project for core toolchain and developer tools, from the last 3 months. - Sourceware now has an official donation page - StarFive VisionFive-2 RISC-V boards for

Re: [PATCH v2 3/4] libdw: Apply DWARF package file section offsets where appropriate

2024-02-24 Thread Mark Wielaard
Hi Omar, On Thu, Feb 22, 2024 at 05:03:44PM -0800, Omar Sandoval wrote: > On Thu, Feb 22, 2024 at 04:53:19PM -0800, Omar Sandoval wrote: > > On Fri, Feb 16, 2024 at 04:00:47PM +0100, Mark Wielaard wrote: > > > Don't we also need to handle DW_SECT_LINE in

Re: [PATCH v2 3/4] libdw: Apply DWARF package file section offsets where appropriate

2024-02-24 Thread Mark Wielaard
Hi Omar, On Thu, Feb 22, 2024 at 04:53:19PM -0800, Omar Sandoval wrote: > On Fri, Feb 16, 2024 at 04:00:47PM +0100, Mark Wielaard wrote: > > The code and tests look good. run-varlocs.sh seems good, which seems to > > confirm DW_SECT_LOCLISTS is handled correctly (but why

Re: [PATCH 0/2] Update LoongArch relocations for psABI v2.30

2024-02-24 Thread Mark Wielaard
Hi, On Fri, Feb 23, 2024 at 12:47:26PM +0800, Xi Ruoyao wrote: > LoongArch psABI v2.30 has introduced 17 new reloc types for TLS > descriptor, TLS LE relaxation, and medium code model function call. Add > them to elfutils. > > Tested on loongarch64-linux-gnu with Binutils-2.42 and GCC 14

Re: [PATCH] libdw: Update dwarf_cu_dwp_section_info documentation

2024-02-22 Thread Mark Wielaard
Hi Omar, On Thu, Feb 22, 2024 at 09:54:29AM -0800, Omar Sandoval wrote: > On Fri, Feb 16, 2024 at 02:34:18PM +0100, Mark Wielaard wrote: > > Update the documentation of dwarf_cu_dwp_section_info to make clear > > that the function only returns an error if the DWARF package file da

[PATCH] readelf: Use unsigned loop variables in handle_verneed and handle_verdef

2024-02-21 Thread Mark Wielaard
, cnt2. (handle_verdef): Likewise. Signed-off-by: Mark Wielaard --- src/readelf.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/readelf.c b/src/readelf.c index 802f8ede..0e931184 100644 --- a/src/readelf.c +++ b/src/readelf.c @@ -3159,7 +3159,7

[PATCH] libebl: ebl_object_note print 32bit annobin address ranges correctly

2024-02-21 Thread Mark Wielaard
that. * libebl/eblobjnote.c (ebl_object_note): Set addr_size to one ELF_T_ADDR. Check descsz equals two times addr_size. Signed-off-by: Mark Wielaard --- libebl/eblobjnote.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libebl/eblobjnote.c b/libebl/eblobjnote.c

Re: [PATCH v2] dwarf_getaranges: Build aranges list from CUs instead of .debug_aranges

2024-02-20 Thread Mark Wielaard
Hi Aaron, We already discussed on irc, but just for the record. On Mon, Feb 19, 2024 at 11:20:13PM -0500, Aaron Merey wrote: > On Tue, Feb 13, 2024 at 8:28 AM Mark Wielaard wrote: > > > > > This patch's method of building the aranges list is slower than simply > >

Re: [PATCH v2 3/4] libdw: Apply DWARF package file section offsets where appropriate

2024-02-16 Thread Mark Wielaard
Hi Omar, On Wed, 2023-12-06 at 01:22 -0800, Omar Sandoval wrote: > The final piece of DWARF package file support is that offsets have to be > interpreted relative to the section offset from the package index. > .debug_abbrev.dwo is already covered, so sprinkle around calls to >

[PATCH] libdw: Update dwarf_cu_dwp_section_info documentation

2024-02-16 Thread Mark Wielaard
. It also makes sure the documentation is < 76 chars wide. * libdw/libdw.h (dwarf_cu_dwp_section_info): Update docs. Signed-off-by: Mark Wielaard --- libdw/libdw.h | 42 +++--- 1 file changed, 23 insertions(+), 19 deletions(-) diff --git a/li

Re: [PATCH v2 2/4] libdw: Try .dwp file in __libdw_find_split_unit()

2024-02-15 Thread Mark Wielaard
Hi Omar, On Wed, Dec 06, 2023 at 01:22:17AM -0800, Omar Sandoval wrote: > Try opening the file in the location suggested by the standard (the > skeleton file name + ".dwp") and looking up the unit in the package > index. The rest is similar to .dwo files, with slightly different > cleanup since

Re: [PATCH v2 1/4] libdw: Parse DWARF package file index sections

2024-02-15 Thread Mark Wielaard
Hi Omar, On Wed, 2023-12-06 at 01:22 -0800, Omar Sandoval wrote: > The .debug_cu_index and .debug_tu_index sections in DWARF package files > are basically hash tables mapping a unit's 8 byte signature to an offset > and size in each section used by that unit [1]. Add support for parsing > and

Re: [PATCH v2] dwarf_getaranges: Build aranges list from CUs instead of .debug_aranges

2024-02-13 Thread Mark Wielaard
Hi Aaron, On Mon, 2023-12-11 at 18:18 -0500, Aaron Merey wrote: > No longer use .debug_aranges to build the aranges list since it could be > absent or incomplete. > > Instead build the aranges list by iterating over each CU and recording > each address range. > >

Re: [PATCH] Handle DW_AT_decl_file 0

2024-02-12 Thread Mark Wielaard
Hi Aaron, On Mon, Feb 12, 2024 at 01:16:30PM -0500, Aaron Merey wrote: > On Mon, Feb 12, 2024 at 12:31 PM Mark Wielaard wrote: > > >(void) INTUSE(dwarf_getsrclines) ( (cu), , ); > > > - assert (cu->lines != NULL); > > > } > > > &g

Re: [PATCH] Handle DW_AT_decl_file 0

2024-02-12 Thread Mark Wielaard
Hi Aaron, On Fri, 2024-02-09 at 21:52 -0500, Aaron Merey wrote: > Modify dwarf_decl_file to support DW_AT_decl_file with value 0. > > Because of inconsistencies in the DWARF 5 spec, it is ambiguous whether > DW_AT_decl_file value 0 is a valid .debug_line file table index for the > main source

Re: [PATCH v2 1/5] strip: Adapt src/strip -o -f on mips

2024-02-09 Thread Mark Wielaard
Hi Ying, Sorry I keep postponing this. I don't have access to a mips64le box, the cfarm only has 64bit big endian mips machines. But the part I am struggling with is the relocation data conversion needed in the mips64le case. On Fri, Nov 03, 2023 at 01:18:12PM +0100, Mark Wielaard wrote

Re: [PATCH] unstrip: Call adjust_relocs no more than once per section.

2024-02-06 Thread Mark Wielaard
Hi Aaron, On Mon, 2024-02-05 at 18:11 -0500, Aaron Merey wrote: > During symtab merging, adjust_relocs might be called multiple times on > some SHT_REL/SHT_RELA sections. In these cases it is possible for a > relocation's symbol index to be correctly mapped from X to Y during the > first call to

Re: [PATCH] PR 30991: srcfiles tarball feature

2024-02-06 Thread Mark Wielaard
a common symptom for dwz-compressed debug files, > > - // where the altdebug file cannot be resolved. > >if (verbose > 3) > > obatched(clog) << "skipping cu=" << cuname << " due to empty > > comp_dir"

[COMMITTED] srcfiles: Fix --enable-gcov (BUILD_STATIC) build

2024-02-06 Thread Mark Wielaard
-coverage and provides fresh coverage reports again at https://snapshots.sourceware.org/elfutils/coverage/latest/ * Makefile.am (BUILD_STATIC): Provide libdebuginfod.a Signed-off-by: Mark Wielaard --- src/Makefile.am | 11 --- 1 file changed, 8 insertions(+), 3 deletions(-) diff

[PATCH] libelf: Treat elf_memory as if using ELF_C_READ_MMAP

2024-02-01 Thread Mark Wielaard
__libelf_read_mmaped_file with ELF_C_READ_MMAP. * tests/elfgetzdata.c (main): Add new "mem" option. * tests/run-elfgetzdata.sh: Also run all tests with new "mem" option. https://sourceware.org/bugzilla/show_bug.cgi?id=31225 Reported-by: Derek Bruening Signed-o

Re: [PATCH] libdwfl: Add some extra space to buffer to read kernel image header

2024-01-30 Thread Mark Wielaard
Hi, On Sun, 2024-01-21 at 20:54 +0100, Mark Wielaard wrote: > GCC 14 notices we play some tricks with the array into which we try > to read the kernel image header. > > image-header.c: In function ‘__libdw_image_header’: > image-header.c:77:18: error: array subscript -496 is outsi

[PATCH] libdwfl: Add some extra space to buffer to read kernel image header

2024-01-21 Thread Mark Wielaard
does waste 496 bytes on the stack at the front of the buffer that is never used. * libdwfl/image-header.c (__libdw_image_header): Add H_START to header_buffer size and return Signed-off-by: Mark Wielaard --- libdwfl/image-header.c | 8 1 file changed, 4 insertions(+), 4 dele

Re: Porting pahole from dwarf_next_unit() to dwarf_get_units()

2024-01-14 Thread Mark Wielaard
Hi Dimitri, Sorry, this arrived before my vacation and then the new year happened. On Tue, Dec 05, 2023 at 01:03:01PM +, Dimitri John Ledkov wrote: > Currently pahole warns and does nothing upon hitting > DW_TAG_skeleton_unit as implemented at >

Re: Noop round trip through elf_update() causes segfaults

2023-12-30 Thread Mark Wielaard
Hi Daniel, On Wed, Dec 27, 2023 at 08:40:09PM -0600, Daniel Xu wrote: > I was working on code that adds an ELF section containing custom > metadata to ELF binaries when I started getting odd segfaults > in the added-to binary. > > I've managed to create a minimal reproducer with a couple

Re: [PATCH 1/2] libdw: Use INTUSE with dwarf_get_units

2023-12-21 Thread Mark Wielaard
Hi Aaron, On Wed, Dec 06, 2023 at 08:35:03PM -0500, Aaron Merey wrote: > Add INTDECL for dwarf_get_units and call dwarf_get_units with INTUSE. This is obviously OK. Although it is a bit of a micro-optimization. Thanks, Mark

Re: [PATCH] tests: fix build against upcoming `gcc-14` (`-Werror=calloc-transposed-args`)

2023-12-21 Thread Mark Wielaard
Hi Sergei, On Thu, 2023-12-21 at 09:23 +, Sergei Trofimovich wrote: > `gcc-14` added a new `-Wcalloc-transposed-args` warning recently. It > detected minor infelicity in `calloc()` API usage in `elfutils`: > > elfstrmerge.c: In function 'main': > elfstrmerge.c:450:32: error: >

Re: [PATCH] Add helper function for basename

2023-12-20 Thread Mark Wielaard
sts/varlocs.c: Likewise. * debuginfod/debuginfod.cxx: Move include system.h to the end. (register_file_name): Rename basename to filename. Signed-off-by: Khem Raj Signed-off-by: Mark Wielaard BTW. There is a musl tracking bug: https://sourceware.org/bugzilla/show_bug.

Re: [PATCH] tests: Don't redirect output to /dev/null in run-native-test.sh

2023-12-18 Thread Mark Wielaard
On Tue, 2023-12-12 at 10:49 +0100, Mark Wielaard wrote: > By redirecting all output to /dev/null in run-native-test.sh the > run-native-test.sh.log file will be empty on failures. This makes > it hard to figure out what went wrong. > > * tests/run-native-test.sh: Remove /dev

Re: [PATCH] Add helper function for basename

2023-12-14 Thread Mark Wielaard
Hi Khem, On Thu, Dec 14, 2023 at 10:15:00AM -0800, Khem Raj wrote: > Overall, this looks a good improvement on top of my patch so good to go. > I will also try it in my local distro builds and see how it goes. Thanks. I didn't actually test it against musl. So if you could and report whether or

Re: [PATCH] Add helper function for basename

2023-12-14 Thread Mark Wielaard
h. (dwarf_tag_string): Use xbasename. * tests/varlocs.c: Likewise. * debuginfod/debuginfod.cxx: Move include system.h to the end. (register_file_name): Rename basename to filename. Signed-off-by: Khem Raj Signed-off-by: Mark Wielaard --- debuginfod/debuginfod.cxx| 22 ++

Re: [PATCH] Add helper function for basename

2023-12-13 Thread Mark Wielaard
On Wed, Dec 13, 2023 at 08:29:01AM -0800, Khem Raj wrote: > On Wed, Dec 13, 2023 at 7:10 AM Mark Wielaard wrote: > > > > Hi Khem, > > > > On Tue, 2023-12-12 at 09:16 -0800, Khem Raj wrote: > > > On Tue, Dec 12, 2023 at 5:18 AM Mark Wielaard wrote: > > &

Re: [PATCH] Add helper function for basename

2023-12-13 Thread Mark Wielaard
Hi Khem, On Tue, 2023-12-12 at 09:16 -0800, Khem Raj wrote: > On Tue, Dec 12, 2023 at 5:18 AM Mark Wielaard wrote: > > On Sun, 2023-12-10 at 12:20 -0800, Khem Raj wrote: > > > musl does not provide GNU version of basename and lately have removed > > > the defini

Re: [PATCH] Add helper function for basename

2023-12-12 Thread Mark Wielaard
Hi Khem, On Sun, 2023-12-10 at 12:20 -0800, Khem Raj wrote: > musl does not provide GNU version of basename and lately have removed > the definiton from string.h [1] which exposes this problem. It can be > made to work by providing a local implementation of basename which > implements the GNU

[PATCH] tests: Don't redirect output to /dev/null in run-native-test.sh

2023-12-12 Thread Mark Wielaard
By redirecting all output to /dev/null in run-native-test.sh the run-native-test.sh.log file will be empty on failures. This makes it hard to figure out what went wrong. * tests/run-native-test.sh: Remove /dev/null redirects. Signed-off-by: Mark Wielaard --- tests/run-native-test.sh

Sourceware infrastructure updates for Q4 2023

2023-11-28 Thread Mark Wielaard
Sourceware infrastructure community updates for Q4 2023 - 6 months with the Software Freedom Conservancy - Sourceware @ Fosdem - OSUOSL provides extra larger arm64 and x86_64 buildbot servers - No more From rewriting for patches mailinglists = 6 months with the Software Freedom Conservancy

Re: [PATCH] libelf: check decompressed ZSTD size

2023-11-23 Thread Mark Wielaard
Hi Aleksei, On Thu, Nov 23, 2023 at 03:31:47PM +, Aleksei Vetrov wrote: > Decompression functions like __libelf_decompress_zlib check that > decompressed data has the same size as it was declared in the header > (size_out argument). The same check is now added to > __libelf_decompress_zstd to

Re: [PATCH v2 2/2] tests: Add test for duplicate entries in archive

2023-11-21 Thread Mark Wielaard
Hi Aleksei, On Mon, 2023-11-20 at 17:44 +, Aleksei Vetrov wrote: > Test dwfl-report-offline-memory against an archive that contains > non-relocatable ELFs with the same name and contents. > > * tests/test-ar-duplicates.a.bz2: New test file. > *

Re: [PATCH v2 1/2] libdwfl: handle duplicate ELFs when reporting archives

2023-11-21 Thread Mark Wielaard
Hi Aleksei, On Mon, 2023-11-20 at 17:44 +, Aleksei Vetrov wrote: > When archive is processed in process_archive (libdwfl/offline.c), it > creates an Elf object for each archive member. Then in > process_archive_member it calls process_file to create a Dwfl_Module > through

Re: [PATCH v2] libdwfl: Correctly handle corefile non-contiguous segments

2023-11-21 Thread Mark Wielaard
Hi Aaron, On Fri, 2023-11-17 at 21:48 -0500, Aaron Merey wrote: > v1: https://sourceware.org/pipermail/elfutils-devel/2023q4/006644.html > > v2 changes: > > The size of the uncompressed testcore-noncontig has been reduced from > 736M to 54K. Uncompressed it is 580K. Still a bit large, but much

Re: [PATCH] readelf: Don't print average number of tests when no tests are done

2023-11-20 Thread Mark Wielaard
Hi, On Wed, 2023-11-15 at 17:41 +0100, Mark Wielaard wrote: > If the symbol hash table only contains lenght zero chains, no lookup > tests need to be done and eu-readelf -I would print out bogus numbers > for the number of tests that were successful/unsuccessful. > > e.g. for an

Re: [PATCH] tests: Restructure run-debuginfod-response-headers.sh

2023-11-19 Thread Mark Wielaard
Hi, On Sun, Nov 19, 2023 at 03:11:28PM +0100, Mark Wielaard wrote: > run-debuginfod-response-headers.sh does occassionally fail because > it might scan an rpm more than once. Try to fix this by making sure > all files that debuginfod is supposed to scan are ready before the > s

  1   2   3   4   5   6   7   8   9   10   >