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

2023-11-03 Thread Mark Wielaard
Hi Ying, On Thu, 2023-11-02 at 14:55 +0800, Ying Huang wrote: > In mips64 little-endian, r_info consists of four byte fields(contains > three reloc types) and a 32-bit symbol index. In order to adapt > GELF_R_SYM and GELF_R_TYPE, need convert raw data to get correct symbol > index and type. This

Re: [PATCH v2 0/5] Add support for MIPS

2023-11-03 Thread Mark Wielaard
On Fri, 2023-11-03 at 12:56 +0100, Mark Wielaard wrote: > Hi Yimg, Sorry, typo, Ying. > On Thu, 2023-11-02 at 14:55 +0800, Ying Huang wrote: > > This is a series of modifications about MIPS. > > Support src/readelf, strip, elflint, objdump related tools. > > Than

[COMMITTED] The default branch is now 'main'

2023-11-03 Thread Mark Wielaard
merge with the ref 'refs/heads/master' from the remote, but no such ref was fetched. Make sure to rename your branch to main and set the new upstream: $ git branch -m master main $ git branch --unset-upstream $ git branch -u origin/main Signed-off-by: Mark Wielaard --- CONTRIBUTING

[PATCH] Prepare for 0.190

2023-11-03 Thread Mark Wielaard
Set version to 0.190 Update NEWS and elfutils.spec.in Regenerate po/*.po files. Signed-off-by: Mark Wielaard --- NEWS| 17 +- config/elfutils.spec.in | 15 +- configure.ac|2 +- po/de.po| 1482 +++--- po

elfutils 0.190 released

2023-11-03 Thread Mark Wielaard
ohn Gallagher (1): libdwfl: Fix memory leak in unzip() Luke Diamand (1): report_r_debug: handle `-z separate-code' and find more modules Mark Wielaard (27): Fix static build when zstd is enabled for libelf configure.ac contains Bashisms tests: skip '(null)' symname frame

Creating an elfutils release

2023-11-03 Thread Mark Wielaard
Although most things are automated there are a couple of manual steps. I thought I would write those down, so others can also create a release. - Pre-release, go over any pending patches or recently updated bugs making sure there isn't anything urgent (or note those as known issues in the rele

[COMMITTED] elfutils.spec: Add eu-srcfiles and add new make rpmbuild target

2023-11-03 Thread Mark Wielaard
The elfutils.spec was missing the new eu-srcfiles program. Add a new rpmbuild target to test a whole rpm build to catch such issues early. * config/elfutils.spec.in: Add eu-srcfiles to files. * Makefile.am (rpmbuild): New target. Signed-off-by: Mark Wielaard --- Makefile.am

[PATCH] libelf: Fix possible memory leak in elf_getdata_rawchunk

2023-11-08 Thread Mark Wielaard
unk.c (elf_getdata_rawchunk): Call free on the rawchunk if new buffer was allocated. Signed-off-by: Mark Wielaard --- libelf/elf_getdata_rawchunk.c | 5 + 1 file changed, 5 insertions(+) diff --git a/libelf/elf_getdata_rawchunk.c b/libelf/elf_getdata_rawchunk.c index 05ff329c..175

Re: [PATCH 03/16] libelf: Fix deadlock in __libelf_readall

2023-11-09 Thread Mark Wielaard
Hi Heather, On Tue, 2023-10-17 at 14:11 -0500, Heather McIntyre wrote: > I will push the changes after I am done testing other fixes > since I want to ensure that everything works together cohesively.  Please let us know if we can help update your patches. I realize we have been patching some of

Fwd: CfP for FOSDEM 2024, Debuggers and Analysis tools devroom

2023-11-10 Thread Mark Wielaard
Hi elfutils hackers, This sounds like a fun devroom. I will definitely go to Fosdem. Please consider submitting a talk and/or coming next year, February to Fosdem in Brussels. Cheers, Mark --- Begin Message --- Hi All, We are excited to announce that the call for proposals is now open for the

[COMMITTED] backends: Fix arm_machine_flag_name version string.

2023-11-13 Thread Mark Wielaard
tps://sourceware.org/bugzilla/show_bug.cgi?id=31058 Signed-off-by: Mark Wielaard --- backends/arm_machineflagname.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backends/arm_machineflagname.c b/backends/arm_machineflagname.c index e93092ae..d700d5f4 100644 --- a/backe

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

2023-11-13 Thread Mark Wielaard
gt; > Build state: failed test (failure) > Revision: 373f5212677235fc3ca6068b887111554790f944 > Worker: bb1-2 > Build Reason: (unknown) > Blamelist: Mark Wielaard > > Steps: > [...] > - 9: make rpmbuild ( failure ) > Logs: > - stdio: > https://b

[COMMITTED] rpmbuild: fix Makefile rules

2023-11-13 Thread Mark Wielaard
* Makefile.am (rpmbuild): Use mkdir -p. Use $(shell pwd). --- Makefile.am | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile.am b/Makefile.am index 87debb48..c9d59d4a 100644 --- a/Makefile.am +++ b/Makefile.am @@ -47,9 +47,9 @@ rpm: dist rpmbuild -ts e

Re: [PATCH] Fix computations with (potentially) NULL pointer

2023-11-14 Thread Mark Wielaard
Hi Paul, Hi Nafi, On Mon, 2023-11-13 at 22:58 +, Paul Pluzhnikov wrote: > When map_address is NULL, computing map_address+offset is technically > undefined behavior, and triggers Clang/LLVM warning when using > -fsanitize=pointer-overflow. Urgh, I had no idea NULL + ... was technically undefi

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

2023-11-14 Thread Mark Wielaard
Hi Aaron, On Sun, 2023-11-12 at 15:16 -0500, Aaron Merey wrote: > It is possible for segments of different shared libaries to be interleaved > in memory such that the segments of one library are located in between > non-contiguous segments of another library. > > For example, this can be seen wit

Re: [PATCH] libelf: Fix possible memory leak in elf_getdata_rawchunk

2023-11-14 Thread Mark Wielaard
Hi, On Wed, 2023-11-08 at 13:59 +0100, Mark Wielaard wrote: > If the rawchunk is not properly aligned we'll create a new buffer > that is correctly aligned and put the data in that new buffer with > memcpy or the conversion function. In such cases the rawchunk leaks > because

Re: [PATCH] Fix computations with (potentially) NULL pointer

2023-11-14 Thread Mark Wielaard
Hi Paul, On Tue, 2023-11-14 at 08:12 -0800, Paul Pluzhnikov wrote: > On Tue, Nov 14, 2023 at 4:57 AM Mark Wielaard wrote: > > > Urgh, I had no idea NULL + ... was technically undefined behavior. > > ISO/IEC 9899:201x > 6.5.6p8 > > When an expression that has

Re: [PATCH] Fix computations with (potentially) NULL pointer

2023-11-14 Thread Mark Wielaard
Hi Paul, On Tue, 2023-11-14 at 09:04 -0800, Paul Pluzhnikov wrote: > On Tue, Nov 14, 2023 at 8:57 AM Mark Wielaard wrote: > > Looks good. Applied. > > Thanks! > > Appreciate the speedy reviews. Unfortunately our 32bit buildbots were also very quick to poin

Re: [PATCH] Fix computations with (potentially) NULL pointer

2023-11-14 Thread Mark Wielaard
Hi Paul, On Tue, Nov 14, 2023 at 10:56:50AM -0800, Paul Pluzhnikov wrote: > On Tue, Nov 14, 2023 at 9:55 AM Mark Wielaard wrote: > > > Unfortunately our 32bit buildbots were also very quick to point out an > > issue: https://builder.sourceware.org/buildbot/#/changes/35202 &g

Re: [PATCH] Minor: include for uintptr_t

2023-11-15 Thread Mark Wielaard
Hi Paul, On Tue, 2023-11-14 at 22:20 +, Paul Pluzhnikov wrote: > We have a clang-tidy complaining that uintptr_t is not provided by any > directly included header (it's only provided by a transitively included one). > > * libelf/elf_begin.c: Include > Makes sense. Pushed. Thanks, M

Re: [PATCH] PR28204, debuginfod IMA

2023-11-15 Thread Mark Wielaard
Hi Frank, On Tue, 2023-11-14 at 11:45 -0500, Frank Ch. Eigler wrote: > > >\fIima:optimistic\fP Every downloaded file with a known-invalid > > >signature is rejected, protecting against some types of corruption. > > > > I like this wording more. But maybe it would be helpful to split the >

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

2023-11-15 Thread Mark Wielaard
00.0% Average number of tests: successful lookup: -nan unsuccessful lookup: 0.00 Only print out the Average number of tests when there were actual tests to do. Signed-off-by: Mark Wielaard --- src/readelf.c | 7 --- 1 file changed, 4 insertions(+), 3

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

2023-11-16 Thread Mark Wielaard
Hi, On Thu, 2023-11-16 at 12:09 +, buil...@sourceware.org wrote: > A new failure has been detected on builder elfutils-debian-testing-x86_64 > while building elfutils. > > Full details are available at: > https://builder.sourceware.org/buildbot/#builders/145/builds/217 > > Build state:

Re: [PATCH] libdw: check offset dwarf_formstring in all cases

2023-11-17 Thread Mark Wielaard
Hi Aleksei, On Thu, 2023-11-16 at 21:29 +, vvv...@google.com wrote: > This check was initially added to test if offset overflows the safe > prefix where any string will be null-terminated. However the check > was placed in a wrong place and didn't cover all `attrp->form` cases. > > * libd

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

2023-11-18 Thread Mark Wielaard
Hi Aleksei, On Fri, Nov 17, 2023 at 10:35:40PM +, vvv...@google.com 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 __libdwfl_

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

2023-11-18 Thread Mark Wielaard
Hi Aleksei, On Fri, Nov 17, 2023 at 10:35:41PM +, vvv...@google.com wrote: > Test dwfl-report-offline-memory against an archive that contains > non-relocatable ELFs with the same name and contents. Nice testcase. Do note that you also have to add the new test file to EXTRA_DIST so it actually

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

2023-11-19 Thread Mark Wielaard
'scanned_files_total{source=".rpm archive"}' instead of sending an kill -USR1. Signed-off-by: Mark Wielaard --- tests/run-debuginfod-response-headers.sh | 23 ++- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/tests/run-debuginfod-response-hea

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

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

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. > * tests/run-dwfl-report-offline-memory.sh:

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

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 Sourc

[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

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 base

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-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-14 Thread Mark Wielaard
stem.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-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 n

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

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 > https://git.kernel.org/pub/scm/devel/pahole/pah

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

2024-01-21 Thread Mark Wielaard
ste 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 deleti

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] libelf: Treat elf_memory as if using ELF_C_READ_MMAP

2024-02-01 Thread Mark Wielaard
Call __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 Sig

[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

Re: [PATCH] PR 30991: srcfiles tarball feature

2024-02-06 Thread Mark Wielaard
// This is 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 >

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

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) (&CUDIE (cu), &lines, &nlines); > > > - assert (cu->lines != NULL); > > &g

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. > > https://sourceware.org/bugzilla/

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 doi

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 a

[PATCH] libdw: Update dwarf_cu_dwp_section_info documentation

2024-02-16 Thread Mark Wielaard
ZE to zero. 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

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

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

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

2024-02-21 Thread Mark Wielaard
. * 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

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

2024-02-21 Thread Mark Wielaard
d cnt, 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 +3

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

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 (trunk)

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

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 i

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

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 a

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

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

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 call

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 unlik

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

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 b

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 >

[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] 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 wrong

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 said

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 stat

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

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

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

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; > >+ Dwarf_

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

2024-03-21 Thread Mark Wielaard
. Olesen > + > + * 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. > 202

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

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 an

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

2024-03-24 Thread Mark Wielaard
file: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:

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

2024-03-26 Thread Mark Wielaard
file.sh.in: Add || echo -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: Ma

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

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

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

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: > https://lore.kernel.org/all/6498586d7d0ed112e6c44be98d439abc549653c7.c

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 anym

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

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

2024-03-28 Thread Mark Wielaard
tests/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..b789715

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 + > libebl/eblopen

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

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