[PATCH 5/7] src: Check ebl_openbackend result before using ebl handle.

2020-05-10 Thread Mark Wielaard
GCC10 -fanalyzer plus -flto sees that ebl_openbackend can fail and return NULL. Most of the time we will get a dummy ebl, but in case of out of memory or corrupt ELF header it might return NULL. Make sure that we report a (fatal) error in that case in all tools. Signed-off-by: Mark Wielaard

[PATCH 6/7] libdwfl: Return failure from dwfl_standard_find_debuginfo for NULL module.

2020-05-10 Thread Mark Wielaard
GCC10 -fanalyzer plus -flto notices that some functions called by dwfl_standard_find_debuginfo check that the given module isn't NULL, but others expect it to be non-NULL. Just return a failure immediately when a NULL mod is passed to dwfl_standard_find_debuginfo. Signed-off-by: Mark Wie

[PATCH 7/7] libcpu: Free unused new bitfield on error in i386_parse.y new_bitfield.

2020-05-10 Thread Mark Wielaard
GCC10 -fanalyzer detected we didn't free the newly created bitfield on error. Make sure to free it before returning. Signed-off-by: Mark Wielaard --- libcpu/ChangeLog| 4 libcpu/i386_parse.y | 1 + 2 files changed, 5 insertions(+) diff --git a/libcpu/ChangeLog b/libcpu/ChangeLog

Re: [PATCH 1/2] libdw: Use correct CU to resolve file names in dwarf_decl_file.

2020-05-12 Thread Mark Wielaard
On Fri, 2020-05-08 at 18:50 +0200, Mark Wielaard wrote: > dwarf_decl_file uses dwarf_attr_integrate to get the DW_AT_decl_file > attribute. This means the attribute might come from a different DIE > in a different CU. If so, we need to use the CU associated with the > attribute, not

Re: [PATCH 2/2] libdw: Skip imported compiler_units in libdw_visit_scopes walking DIE tree

2020-05-12 Thread Mark Wielaard
On Fri, 2020-05-08 at 18:50 +0200, Mark Wielaard wrote: > Some gcc -flto versions imported other top-level compile units, > skip those. Otherwise we'll visit various DIE trees multiple times. > > Note in the testcase that with newer GCC versions function foo is > fully inl

Re: Some more GCC10 -fanalyzer inspired patches

2020-05-14 Thread Mark Wielaard
On Sun, 2020-05-10 at 21:53 +0200, Mark Wielaard wrote: > I did another build with the final GCC10 and -fanalyzer. The > -Wanalyzer-use-of-uninitialized-value option was removed, which caused > a lot of false positives. Without those it was easier to identify some > real issues.

[COMMITTED] size: Also obey radix printing for bsd format.

2020-05-14 Thread Mark Wielaard
eu-size already prints according to the given radix for sysv format, but not for the bsd format. Fix that. Reported-by: Ulrich Drepper Signed-off-by: Mark Wielaard --- src/ChangeLog | 4 src/size.c| 7 +-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src

Re: Range lists, zero-length functions, linker gc

2020-05-31 Thread Mark Wielaard
the associated sections in that COMDAT group will get dropped with it. If you don't do that, then the DWARF is malformed and there is not much a consumer can do about it. Said otherwise, I don't think it is correct for the linker (with --gc-sections) to drop any sections that have references to it (through relocation symbols) from other (.debug) sections. Cheers, Mark

Re: Range lists, zero-length functions, linker gc

2020-05-31 Thread Mark Wielaard
Hi, On Sun, May 31, 2020 at 01:47:38PM -0700, Fangrui Song via Elfutils-devel wrote: > On 2020-05-31, Mark Wielaard wrote: > > I think this is a producer problem. If a (code) section can be totally > > dropped then the associated (.debug) sections should have been > > generat

Re: Range lists, zero-length functions, linker gc

2020-05-31 Thread Mark Wielaard
Hi, On Sun, May 31, 2020 at 01:49:12PM -0700, David Blaikie wrote: > On Sun, May 31, 2020 at 1:41 PM Mark Wielaard wrote: > > On Sun, May 31, 2020 at 11:55:06AM -0700, Fangrui Song via Elfutils-devel > > wrote: > > > I am eager to know what you think > > &g

Re: Range lists, zero-length functions, linker gc

2020-06-01 Thread Mark Wielaard
Hi, On Sun, May 31, 2020 at 03:36:02PM -0700, David Blaikie wrote: > On Sun, May 31, 2020 at 3:30 PM Mark Wielaard wrote: > > On Sun, May 31, 2020 at 01:49:12PM -0700, David Blaikie wrote: > > > That's probably not practical for at least some users - the > > &g

Re: Range lists, zero-length functions, linker gc

2020-06-02 Thread Mark Wielaard
Hi, On Mon, 2020-06-01 at 13:18 -0700, David Blaikie wrote: > On Mon, Jun 1, 2020 at 2:31 AM Mark Wielaard wrote: > > Each skeleton compilation unit has a DW_AT_dwo_name attribute which > > indicates the .dwo file where the split unit sections can be found. It > > actually

Re: location list

2020-06-02 Thread Mark Wielaard
y checks on the valp pointer and decide it looks bogus and just error out. Also you have to have a valid Dwarf_CU pointer around because you cannot create a valid fake CU easily. So try to keep a reference (or copy) around of the Dwarf_Attribute from which you got this offset and use that for your dwarf_getlocations call. Cheers, Mark

[COMMITTED] libelf: Sync elf.h from glibc.

2020-06-04 Thread Mark Wielaard
There is now finally a PT_GNU_PROPERTY define. Also EM_ARC_COMPACT2 got renamed to EM_ARCV2. Signed-off-by: Mark Wielaard --- libdwelf/ChangeLog| 5 ++ libdwelf/dwelf_elf_e_machine_string.c | 4 +- libebl/ChangeLog | 5 ++ libebl

Re: location list

2020-06-06 Thread Mark Wielaard
cally the DW_AT_location list attributes will all point to zero. Which explains why every location list seems to be the same. We don't have a public function to just apply all relocations to an object file, but opening the file through dwfl_begin () will do it. Something like the attached. H

[PATCH] nm: Explicitly print weak 'V' or 'T' and common 'C' symbols.

2020-06-06 Thread Mark Wielaard
NIQUE for GNU_UNIQUE to make it fit 6 chars, like other binding names in sysv format. https://sourceware.org/bugzilla/show_bug.cgi?id=25227 Signed-off-by: Mark Wielaard --- src/ChangeLog| 10 +++ src/nm.c | 59 ++ tests/ChangeLog | 9 +++ tests

[PATCH] nm: Handle corrupt symbol name table.

2020-06-07 Thread Mark Wielaard
We try to sort symbol by name (when neither -n nor -p are given). This could crash if the symbol name table was corrupt. Use elf_strptr to get the symbol name and use the empty string in case a name couldn't be found. Signed-off-by: Mark Wielaard --- src/ChangeLog | 8 src

Re: [PATCH] nm: Explicitly print weak 'V' or 'T' and common 'C' symbols.

2020-06-10 Thread Mark Wielaard
On Sun, 2020-06-07 at 01:12 +0200, Mark Wielaard wrote: > Mimic binutils nm for bsd and posix formats which uses 'V' for weak > symbols, 'C' for common symbols and 'T' for weak functions. Also fix > some formatting issues. Don't print undefined address

Re: [PATCH] nm: Handle corrupt symbol name table.

2020-06-10 Thread Mark Wielaard
On Sun, 2020-06-07 at 16:51 +0200, Mark Wielaard wrote: > We try to sort symbol by name (when neither -n nor -p are given). > This could crash if the symbol name table was corrupt. Use elf_strptr > to get the symbol name and use the empty string in case a name > couldn't be

Re: location list

2020-06-10 Thread Mark Wielaard
infod calls. But one generic helper function might be convenient. The only other way to do the relocation resolving at the moment is through eu-strip --reloc-debug-sections-only (but this is a permanent, non-reversible operation on the file, which will make it unsuitable for linking with other object files). Hope that give a bit of an overview. Cheers, Mark

[COMMITTED] libebl: Remove Ebl struct size check and MODVERSION string.

2020-06-10 Thread Mark Wielaard
ently indicates any error). Signed-off-by: Mark Wielaard --- ChangeLog | 4 backends/ChangeLog | 20 backends/aarch64_init.c | 11 +++ backends/alpha_init.c | 11 +++ backends/arm_init.c | 11 +++ backends/bpf_init.c

[COMMITTED] Prepare for 0.180

2020-06-11 Thread Mark Wielaard
Set version to 0.180. Update NEWS and elfutils.spec.in. Set copyright year in printversion. Regenerate po/*.po files. Update .gitignore. Signed-off-by: Mark Wielaard --- .gitignore | 27 - ChangeLog | 6 ++ NEWS| 14 +++ config/ChangeLog

Re: Buildbot failure in Wildebeest Builder on whole buildset

2020-06-11 Thread Mark Wielaard
This doesn't fail on any other buildbot worker. I suspect it is a timing issue with a signal not arriving when expected. But I am not sure. I don't think this should hold up the release, given that is is probably just a testsuite quirk. Cheers, Mark

[COMMITTED] tests: Add GCOV flags when necessary.

2020-06-11 Thread Mark Wielaard
The nlist-test has a special compile rule, make sure it gets the GCOV flags when configuring with --enable-gcov. Signed-off-by: Mark Wielaard --- tests/ChangeLog | 4 tests/Makefile.am | 8 +++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/tests/ChangeLog b/tests

elfutils 0.180 released

2020-06-11 Thread Mark Wielaard
ysconfig: add /var/lib/pulp as default search path Mark Wielaard (27): config: chmod uploaded dir and files to make them readable. libdwfl: Initialize bits to NULL in dwfl_standard_find_debuginfo for LTO. libcpu: Replace assert with goto invalid_op for bad prefix. elflint: Allow SHF_EXCLU

Re: elfutils 0.180 released

2020-06-11 Thread Mark Wielaard
Hi Martin, On Thu, 2020-06-11 at 20:51 +0200, Martin Liška wrote: > On 6/11/20 8:31 PM, Martin Liška wrote: > > On 6/11/20 7:48 PM, Mark Wielaard wrote: > > > ELFUTILS 0.180 -http://elfutils.org/ > > > > Thank you for the release. I'm seeing a

Re: [PATCH] elfutils/configure.ac: use $READELF, not readelf

2020-06-15 Thread Mark Wielaard
ChangeLog entry and pushed to master. Thanks, Mark

[COMMITTED] tests: Use #/usr/bin/env bash in scripts that use bash

2020-06-15 Thread Mark Wielaard
Some systems don't have bash in /bin. Signed-off-by: Mark Wielaard --- config/ChangeLog | 4 +++ config/upload-release.sh | 2 +- tests/ChangeLog | 30 +++ tests/coverage.sh

[PATCH 05/10] libdwfl: Flag an error if CIE return_address_register is invalid.

2020-06-16 Thread Mark Wielaard
If the CIE return address register is invalid (unknown) for the architecture immediately flag an error and return. Signed-off-by: Mark Wielaard --- libdwfl/ChangeLog | 5 + libdwfl/frame_unwind.c | 6 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/libdwfl

[PATCH 10/10] debuginfod: Make sure handle_data can be allocated and is always freed.

2020-06-16 Thread Mark Wielaard
When allocating handle_data we should check for out of memory failures. Also when the allocation has succeeded make sure we always clean up by going to out1 on any future errors. So move the curl_multi_init call earlier, because that goes to out0 on failure. Signed-off-by: Mark Wielaard

[PATCH 02/10] libdw: Add missing FALLTHROUGH in execute_cfi.

2020-06-16 Thread Mark Wielaard
Signed-off-by: Mark Wielaard --- libdw/ChangeLog | 4 libdw/cfi.c | 1 + 2 files changed, 5 insertions(+) diff --git a/libdw/ChangeLog b/libdw/ChangeLog index c75b0958..72cd5003 100644 --- a/libdw/ChangeLog +++ b/libdw/ChangeLog @@ -1,3 +1,7 @@ +2020-06-16 Mark Wielaard

[PATCH 04/10] libdwfl: When we find a compressed image, use that, don't search for others

2020-06-16 Thread Mark Wielaard
We try to find a compressed vmlinux image ending with either .gz, bz2 or xz. Stop searching if we find one. Otherwise we will leak a file descriptor for an earlier one we opened. Signed-off-by: Mark Wielaard --- libdwfl/ChangeLog | 5 + libdwfl/linux-kernel-modules.c | 2 +- 2

[PATCH 03/10] elflint: Explicitly check and ignore elf_compress error.

2020-06-16 Thread Mark Wielaard
se in the code we do explicitly check for errors. Signed-off-by: Mark Wielaard --- src/ChangeLog | 5 + src/elflint.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/ChangeLog b/src/ChangeLog index 512d7b54..e78bc358 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@

[PATCH 07/10] debuginfod: Handle not being able to fopen interval_path.

2020-06-16 Thread Mark Wielaard
Although we check for and/or create the interval_path right before, there is still a possibility that the fopen call fails. Handle that as if the file is unreadable. Signed-off-by: Mark Wielaard --- debuginfod/ChangeLog | 5 + debuginfod/debuginfod-client.c | 9 +++-- 2 files

[PATCH 08/10] debuginfod: Make sure suffix can place zero terminator when copying filename

2020-06-16 Thread Mark Wielaard
We need to make sure that we can always place a zero terminator at the end of suffix when we are copying the filename. So add one more char to the suffix array. And make sure that we can always add an extra escape character when we need to escape the current character. Signed-off-by: Mark

[PATCH 09/10] debuginfod: Fix build_id hexadecimal length check.

2020-06-16 Thread Mark Wielaard
end of the build_id_bytes array. Signed-off-by: Mark Wielaard --- debuginfod/ChangeLog | 5 + debuginfod/debuginfod-client.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/debuginfod/ChangeLog b/debuginfod/ChangeLog index 9ff2e111..d6bbfac8 100644 --- a

[PATCH 01/10] backends: Make the reloc_nametable zero element an one char array.

2020-06-16 Thread Mark Wielaard
We are using the reloc_nametable zero element as an char array. So make that element an actual array (we are actually after one of the next string arrays in the table). Signed-off-by: Mark Wielaard --- backends/ChangeLog | 6 ++ backends/common-reloc.c | 6 +++--- 2 files changed, 9

[PATCH 06/10] ar, ranlib: Call fchown before fchmod, explicitly check and ignore errors.

2020-06-16 Thread Mark Wielaard
Also explicitly test and then ignore any errors for chown. We used to do some asm trick, but that confuses some static analyzers (and it is somewhat unreadable). Also split out the giant if statements to make them a little bit more understandable. Signed-off-by: Mark Wielaard --- src/ChangeLog

Re: [PATCH 01/10] backends: Make the reloc_nametable zero element an one char array.

2020-06-19 Thread Mark Wielaard
On Wed, 2020-06-17 at 00:25 +0200, Mark Wielaard wrote: > We are using the reloc_nametable zero element as an char array. > So make that element an actual array (we are actually after one > of the next string arrays in the table). Pushed to master.

Re: Range lists, zero-length functions, linker gc

2020-06-19 Thread Mark Wielaard
contribution (ELF headers but DWARF headers > moreso - having a separate .debug_addr, .debug_line, etc section for > each function would be very expensive) would make for very large > object files. I see your point, but maybe this shouldn't be handled by the linker then, but maybe have a linker plugin so the compiler can fixup the DWARF (or generate it later). Cheers, Mark

Re: [PATCH 02/10] libdw: Add missing FALLTHROUGH in execute_cfi.

2020-06-19 Thread Mark Wielaard
Pushed to master.

Re: [PATCH 03/10] elflint: Explicitly check and ignore elf_compress error.

2020-06-19 Thread Mark Wielaard
On Wed, 2020-06-17 at 00:25 +0200, Mark Wielaard wrote: > We just want to make sure that any section data is decompressed before > use, if the section was already decompressed that is fine, so just ignore > any errors. The make this more clear, explicitly check for errors, then > don&#

Re: [PATCH 04/10] libdwfl: When we find a compressed image, use that, don't search for others

2020-06-19 Thread Mark Wielaard
On Wed, 2020-06-17 at 00:25 +0200, Mark Wielaard wrote: > We try to find a compressed vmlinux image ending with either .gz, bz2 or > xz. Stop searching if we find one. Otherwise we will leak a file descriptor > for an earlier one we opened. Pushed to master

Re: [PATCH 05/10] libdwfl: Flag an error if CIE return_address_register is invalid.

2020-06-19 Thread Mark Wielaard
On Wed, 2020-06-17 at 00:25 +0200, Mark Wielaard wrote: > If the CIE return address register is invalid (unknown) for the > architecture immediately flag an error and return. Pushed to master.

Re: [PATCH 06/10] ar, ranlib: Call fchown before fchmod, explicitly check and ignore errors.

2020-06-19 Thread Mark Wielaard
On Wed, 2020-06-17 at 00:25 +0200, Mark Wielaard wrote: > In ar and ranlib we don't mind if the fchown call fails (it normally > would, then the file simply gets own by the current user). We used to > call fchown before fchmod, but that might ignore (or reset) some mode > flag

Re: Tombstone values in debug sections (was: Range lists, zero-length functions, linker gc)

2020-06-19 Thread Mark Wielaard
e proposal to address the issue of having a single machine instruction corresponds to more than one source statement: http://wiki.dwarfstd.org/index.php?title=TwoLevelLineTables Which seems useful in these kind of situations. But I don't know the current status of the proposal. Cheers, Mark

Re: Question on how to copy an elf file and edit the .preinit_array section

2020-06-19 Thread Mark Wielaard
his is why in a lot of test/examples you actually see elf_flagelf (elf, ELF_C_SET, ELF_F_LAYOUT) (to tell libelf not to assume it can adjust the section headers itself) when you have an ELF file with program headers (because you don't want the data offsets to get out of sync). Cheers, Mark

Re: Difference between dwarf_getscopes and dwarf_getscopes_die

2020-06-19 Thread Mark Wielaard
dwarf_getscopes for "where am I?" Then you use dwarf_getscopes_die for "how did I get here?" Another example use (of both calls) is eu-stack (src/stack.c), which combines the "real" call stack (use getscopes to tell where you are), with the inlined "call stack" (by using dwarf_getscopes_die). Hope that helps, Mark

Re: Can dwarf_getscopes{,_die} performance be improved?

2020-06-19 Thread Mark Wielaard
er to create/keep them. And/or have some explicit way to create them, maybe triggered by some helper function to get at the parent of a DIE. Cheers, Mark

Re: Buildbot failure in Wildebeest Builder on whole buildset

2020-06-19 Thread Mark Wielaard
have to get replacement hardware/memory :{ Cheers, Mark

Re: [PATCH 07/10] debuginfod: Handle not being able to fopen interval_path.

2020-06-24 Thread Mark Wielaard
Hi, On Wed, 2020-06-17 at 00:25 +0200, Mark Wielaard wrote: > Although we check for and/or create the interval_path right before, > there is still a possibility that the fopen call fails. Handle that > as if the file is unreadable. On Wed, 2020-06-17 at 00:25 +0200, Mark Wielaard wr

Re: Range lists, zero-length functions, linker gc

2020-06-24 Thread Mark Wielaard
Hi David, On Fri, 2020-06-19 at 17:46 -0700, David Blaikie via Elfutils-devel wrote: > On Fri, Jun 19, 2020 at 5:00 AM Mark Wielaard wrote: > > I think that is kind of the point of Early Debug. Only use DWARF (at > > first) for address/range-less data like types and program sc

Re: location list

2020-06-25 Thread Mark Wielaard
the "Standard callbacks" in the libdwfl.h file. If you do use it, it might override/change some search paths for where to get the Dwarf data/file from. Again, you could not use this functionality if you don't like it. (Dwfl also works when you provide it the Dwarf data files directly.) Just look at what you need/want. Cheers, Mark

Re: Can dwarf_getscopes{,_die} performance be improved?

2020-06-25 Thread Mark Wielaard
;caching" explicit might be best. Maybe we can call it a DieTree? We would then have a function to create a DieTree and (new) functions that take a DieTree (and a Dwarf_Die) to operate on it. The user can then also destroy the DieTree again when done. Cheers, Mark

Re: Questions regarding editing an elf executable

2020-06-25 Thread Mark Wielaard
cated (SHF_ALLOC) sections are packed together when the file has a program header. So moving them around is a little tricky (you might have to move them all and/or update the segment headers too). Also there might be other entries, like the _DYNAMIC symbol, pointing at them. libelf doesn't provide any help here, sorry. It only keeps track of the section headers, but is unaware how to update the program headers (or how the section data offset/sizes corresponds to the segments). Cheers, Mark

Re: [PATCH] Complete PR25797 by modifying * debuginfod-client.c : check scheme instead of effective url so that user may abbreviate DEBUGINFOD_URL * tests/run-debuginfod-find.sh : add one test for sch

2020-06-29 Thread Mark Wielaard
rl with strncasecmp instead of strncmp might work here with most libcurl versions. If you want to be more prudent then you can also check for the scheme when that fails with #ifdef CURLINFO_SCHEME > if (resp_code == 0) >{ > verified_handle = msg->easy_handle; > break; >} > -} > + } Another whitespace only change. > } > } > } Thanks, Mark

[PATCH] libasm: Make libasm.h include work without relying on any other include.

2020-07-04 Thread Mark Wielaard
/sourceware.org/bugzilla/show_bug.cgi?id=26176 Signed-off-by: Mark Wielaard --- libasm/ChangeLog | 4 libasm/libasm.h| 1 + tests/ChangeLog| 6 ++ tests/Makefile.am | 5 +++-- tests/run-test-includes.sh | 26 ++ 5 fi

[PATCH] libdwfl, src: Replace some asserts with proper check or error messages.

2020-07-04 Thread Mark Wielaard
library code really shouldn't assert and for utilities a proper error message is better than crashing with an assert. https://sourceware.org/bugzilla/show_bug.cgi?id=26176 Signed-off-by: Mark Wielaard --- libdwfl/ChangeLog| 14 ++ libdwfl/argp-

Re: [PATCH] debuginfod: DEBUGINFOD_URLS should accept scheme-free urls

2020-07-05 Thread Mark Wielaard
ons we support. I did make some whitespace changes and added ChangeLog entries as attached. Pushed to master. Thanks, Mark From 8de6f9af46f12fe3b2a0871523f6df13c4b39e34 Mon Sep 17 00:00:00 2001 From: Alice Zhang Date: Fri, 3 Jul 2020 13:37:34 -0400 Subject: [PATCH] debuginfod: DEBUGINFOD_URLS should

Re: [PATCH] libasm: Make libasm.h include work without relying on any other include.

2020-07-17 Thread Mark Wielaard
On Sun, 2020-07-05 at 00:17 +0200, Mark Wielaard wrote: > The public headers should be usable when includes as is. > libasm.h wasn't because it was using gelf.h data structures without > include gelf.h. Include it now in libasm.h. > > Add a new testcase run-test-includes.s

[PATCH] configure.ac: Set -DBAD_FTS=1 also for CXXFLAGS.

2020-07-17 Thread Mark Wielaard
debuginfod.cxx checks whether or not BAD_FTS is defined. This only matters on old 32bit arches. Signed-off-by: Mark Wielaard --- ChangeLog| 4 configure.ac | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 99f50492..c6b526fe 100644 --- a

Re: [PATCH] libdwfl, src: Replace some asserts with proper check or error messages.

2020-07-19 Thread Mark Wielaard
On Sun, Jul 05, 2020 at 12:33:38AM +0200, Mark Wielaard wrote: > library code really shouldn't assert and for utilities a proper > error message is better than crashing with an assert. Pushed to master.

[PATCH] elfclassify: Handle fwrite to stdout failing.

2020-07-19 Thread Mark Wielaard
In theory an fwrite can fail, if so, signal it by calling issue (). Signed-off-by: Mark Wielaard --- src/ChangeLog | 4 src/elfclassify.c | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/ChangeLog b/src/ChangeLog index 0129b8bf..fa7411fd 100644 --- a/src

[PATCH] Only typedef Ebl once.

2020-07-19 Thread Mark Wielaard
. This only affects internal code, since libebl.h isn't a public header. For internal code, only add the typedef in libebl.h when libasm.h hasn't been included. Make sure all code that includes both headers includes libasm.h first. Signed-off-by: Mark Wielaard --- libasm/ChangeLog | 4 ++

Re: [PATCH] configure.ac: Set -DBAD_FTS=1 also for CXXFLAGS.

2020-07-22 Thread Mark Wielaard
On Sat, 2020-07-18 at 01:56 +0200, Mark Wielaard wrote: > debuginfod.cxx checks whether or not BAD_FTS is defined. > This only matters on old 32bit arches. Pushed to master.

Re: [PATCH] elfclassify: Handle fwrite to stdout failing.

2020-07-23 Thread Mark Wielaard
On Sun, 2020-07-19 at 19:41 +0200, Mark Wielaard wrote: > In theory an fwrite can fail, if so, signal it by calling issue (). Pushed to master.

Re: [PATCH] Only typedef Ebl once.

2020-07-23 Thread Mark Wielaard
On Sun, 2020-07-19 at 22:03 +0200, Mark Wielaard wrote: > Since commit 287a18452 libasm.h defines an opague Ebl handle. > This is fine, except for (internal) code that also includes libebl.h. > Since C11 having multiple typedefs for the same thing is fine, but we > do build using G

[PATCH] libelf: Fixup SHF_COMPRESSED sh_addralign in elf_update if necessary.

2020-08-19 Thread Mark Wielaard
same for the sh_addralign field of a SHF_COMPRESSED section. Signed-off-by: Mark Wielaard --- libelf/ChangeLog | 5 + libelf/elf32_updatenull.c | 12 2 files changed, 17 insertions(+) diff --git a/libelf/ChangeLog b/libelf/ChangeLog index 8f6d2d2d..77044c1c 100644 --- a/libe

Re: [PATCH] libelf: Fixup SHF_COMPRESSED sh_addralign in elf_update if necessary.

2020-08-25 Thread Mark Wielaard
On Wed, Aug 19, 2020 at 11:51:15PM +0200, Mark Wielaard wrote: > In elf_getdata.c we have the following to compensate for possibly > bad sh_addralign values of compressed sections: > > /* Compressed data has a header, but then compressed data. > Make sure to set t

[PATCH] readelf: It is not an error if there are no line number statements

2020-08-26 Thread Mark Wielaard
It can happen that there are no line number statements at the end of a debug line section. So don't check that there are any more bytes after the last file entry. And print "No line number statements." libdw already got this corner case correct. Signed-off-by: Mark Wielaard ---

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

2020-08-28 Thread Mark Wielaard
Gets us DT_AARCH64_BTI_PLT and DT_AARCH64_PAC_PLT. Signed-off-by: Mark Wielaard --- libelf/ChangeLog | 4 libelf/elf.h | 2 ++ 2 files changed, 6 insertions(+) diff --git a/libelf/ChangeLog b/libelf/ChangeLog index 77044c1c..a3f15883 100644 --- a/libelf/ChangeLog +++ b/libelf

[PATCH 2/2] backends: Implement aarch64_dynamic_tag_name and aarch64_dynamic_tag_check

2020-08-28 Thread Mark Wielaard
Signed-off-by: Mark Wielaard --- backends/ChangeLog| 7 +++ backends/aarch64_init.c | 2 ++ backends/aarch64_symbol.c | 26 ++ 3 files changed, 35 insertions(+) diff --git a/backends/ChangeLog b/backends/ChangeLog index c85dfd2a..ce4c971e 100644 --- a

Re: [PATCH] libdwfl: do not dlopen libdebuginfod.so in --disable-libdebuginfod mode

2020-08-30 Thread Mark Wielaard
buginfod and it handles --enable-libdebuginfod=dummy correctly. To double check I removed all references to debuginfod_client from libdwflP.h when libdebuginfod is disabled. And things look fine in that case too. I think it makes sense to add this to your patch. See attached. Thanks, Mark diff

Re: [PATCH] readelf: It is not an error if there are no line number statements

2020-08-30 Thread Mark Wielaard
On Wed, Aug 26, 2020 at 02:30:42PM +0200, Mark Wielaard wrote: > It can happen that there are no line number statements at the end of > a debug line section. So don't check that there are any more bytes > after the last file entry. And print "No line number statements." Pushed.

Re: [PATCH] libdwfl: do not dlopen libdebuginfod.so in --disable-libdebuginfod mode

2020-08-31 Thread Mark Wielaard
Hi Dmitry, On Sun, Aug 30, 2020 at 11:49:10PM +0300, Dmitry V. Levin wrote: > On Sun, Aug 30, 2020 at 10:40:29PM +0200, Mark Wielaard wrote: > > To double check I removed all references to debuginfod_client from > > libdwflP.h when libdebuginfod is disabled. And things look fine i

[PATCH] readelf: base address entry can be first

2020-09-01 Thread Mark Wielaard
In both debug_ranges and debug_loc a base address entry can be the first in the range or loc list. If so print the offset and set first to false. Otherwise don't print the entry list offset, but do set first to false. Signed-off-by: Mark Wielaard --- src/ChangeLog | 6 ++ src/read

Doing a 0.181 release (arm64 bti/pac issues)

2020-09-02 Thread Mark Wielaard
to the list and working on the new property notes. But I don't fully understand why backtracing is broken right now. I would like to resolve those issues before doing a release (hopefully later this or next week). Are there any other things people would like to make it into 0.181? Thanks, Mark

[PATCH] libebl: Handle aarch64 bti, pac bits in gnu property note

2020-09-03 Thread Mark Wielaard
: Mark Wielaard --- libebl/ChangeLog | 5 ++ libebl/eblobjnote.c | 67 +++ tests/ChangeLog | 5 ++ tests/run-readelf-n.sh | 31 + tests/testfile-gnu-property-note

[PATCH] libdw: Remove duplicate local wildcards from map file.

2020-09-03 Thread Mark Wielaard
We only need one local: * entry to capture all private local symbols. Signed-off-by: Mark Wielaard --- libdw/ChangeLog | 8 libdw/libdw.map | 10 -- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/libdw/ChangeLog b/libdw/ChangeLog index 796dbfb7..13683ef0

Re: [PATCH] libebl: Handle aarch64 bti, pac bits in gnu property note

2020-09-03 Thread Mark Wielaard
On Thu, 2020-09-03 at 11:56 +0200, Mark Wielaard wrote: > When building with gcc -mbranch-protection= we might get a gnu property > note indicating BTI (Branch Target Identification) and/or PAC (Pointer > Authentication Code) is being used. > > Add a small testcase to show eu

[PATCH] libdw,readelf: Recognize DW_CFA_AARCH64_negate_ra_state

2020-09-03 Thread Mark Wielaard
es to show the value is correctly recognized. Also don't warn we cannot find any DWARF if we are just dumping frames (those will come from .eh_frame if there is no .debug_frame). Signed-off-by: Mark Wielaard --- libdw/ChangeLog | 12 +++ libdw/cfi.c | 41 +--

Re: [PATCH] libdw: Remove duplicate local wildcards from map file.

2020-09-03 Thread Mark Wielaard
On Thu, Sep 03, 2020 at 07:57:15PM +0300, Dmitry V. Levin wrote: > On Thu, Sep 03, 2020 at 03:00:36PM +0200, Mark Wielaard wrote: > > We only need one local: * entry to capture all private local symbols. > > Yes, the first one (inside ELFUTILS_0.122) is enough. Thanks for the re

[COMMITTED] elflint: Handle .debug_line_str as .debug_str

2020-09-04 Thread Mark Wielaard
The new DWARF5 .debug_line_str is identical to the .debug_str section. Signed-off-by: Mark Wielaard --- src/ChangeLog | 4 src/elflint.c | 1 + 2 files changed, 5 insertions(+) diff --git a/src/ChangeLog b/src/ChangeLog index 8eb2103d..e37f3587 100644 --- a/src/ChangeLog +++ b/src

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

2020-09-07 Thread Mark Wielaard
On Sat, 2020-08-29 at 00:42 +0200, Mark Wielaard wrote: > Gets us DT_AARCH64_BTI_PLT and DT_AARCH64_PAC_PLT. Pushed.

Re: [PATCH 2/2] backends: Implement aarch64_dynamic_tag_name and aarch64_dynamic_tag_check

2020-09-07 Thread Mark Wielaard
On Sat, 2020-08-29 at 00:42 +0200, Mark Wielaard wrote: > +2020-08-28 Mark Wielard > + > + * aarch64_init.c (aarch64_init): Hook dynamic_tag_name and > + dynamic_tag_check. > + * aarch64_symbol.c (aarch64_dynamic_tag_name): New function. > + (aarch64_dynamic_ta

Re: [PATCH] readelf: base address entry can be first

2020-09-07 Thread Mark Wielaard
On Tue, 2020-09-01 at 23:48 +0200, Mark Wielaard wrote: > In both debug_ranges and debug_loc a base address entry can be the > first in the range or loc list. If so print the offset and set first > to false. Otherwise don't print the entry list offset, but do set > first to false. Pushed.

Re: [PATCH] libebl: Handle aarch64 bti, pac bits in gnu property note

2020-09-07 Thread Mark Wielaard
On Thu, 2020-09-03 at 17:28 +0200, Mark Wielaard wrote: > On Thu, 2020-09-03 at 11:56 +0200, Mark Wielaard wrote: > > When building with gcc -mbranch-protection= we might get a gnu property > > note indicating BTI (Branch Target Identification) and/or PAC (Pointer > > Authenti

Re: [PATCH] libdw,readelf: Recognize DW_CFA_AARCH64_negate_ra_state

2020-09-07 Thread Mark Wielaard
On Thu, 2020-09-03 at 17:58 +0200, Mark Wielaard wrote: > DW_CFA_AARCH64_negate_ra_state is used on aarch64 to indicate whether > or not the return address is mangled or not. This has the same value > as the DW_CFA_GNU_window_save. So we have to pass around the e_machine > value of th

Re: Doing a 0.181 release (arm64 bti/pac issues)

2020-09-07 Thread Mark Wielaard
Hi, On Wed, 2020-09-02 at 15:03 +0200, Mark Wielaard wrote: > On irc Martin was asking about doing a new release. I do think it is > time for 0.181. But I am struggling a bit with Fedora arm64 which has > turned on BTI/PAC which caused some issues: > https://bugzilla.redhat.com/sho

[COMMITTED] Prepare for 0.181

2020-09-08 Thread Mark Wielaard
Set version to 0.181. Update NEWS and elfutils.spec.in. Regenerate po/*.po files. Signed-off-by: Mark Wielaard --- ChangeLog | 5 + NEWS| 17 + config/ChangeLog| 4 + config/elfutils.spec.in | 13 + configure.ac| 2 +- po/ChangeLog

[PATCH] debuginfod: Fix BUILD_STATIC build.

2020-09-08 Thread Mark Wielaard
The BUILD_STATIC build, as used by the coverage setup, was broken for debuginfod because the DUMMY_LIBDEBUGINFOD case was mixed up. It should include libcurl_LIBS when NOT doing a dummy build. Signed-off-by: Mark Wielaard --- debuginfod/ChangeLog | 5 + debuginfod/Makefile.am | 4 ++-- 2

elfutils 0.181 released

2020-09-08 Thread Mark Wielaard
Alice Zhang (1): debuginfod: DEBUGINFOD_URLS should accept scheme-free urls Dmitry V. Levin (1): libdwfl: do not dlopen libdebuginfod.so in --disable-libdebuginfod mode Frank Ch. Eigler (1): PR26195: adapt debuginfod to API change in libmicrohttpd-0.9.71 Mark Wielaard (30): tests: Add

[COMMITTED] debuginfod-find.c: Fix license block comment. File is GPLv3+ only.

2020-09-16 Thread Mark Wielaard
The license itself was correct, just the comment to get a copy of the LGPL was wrong. Signed-off-by: Mark Wielaard --- debuginfod/ChangeLog | 4 debuginfod/debuginfod-find.c | 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/debuginfod/ChangeLog b/debuginfod

Re: [PATCH] debuginfod: Fix BUILD_STATIC build.

2020-09-17 Thread Mark Wielaard
On Tue, Sep 08, 2020 at 02:14:51PM +0200, Mark Wielaard wrote: > The BUILD_STATIC build, as used by the coverage setup, was broken for > debuginfod because the DUMMY_LIBDEBUGINFOD case was mixed up. It should > include libcurl_LIBS when NOT doing a dummy build. Pushed.

[PATCH] libdwfl: Add ZSTD support.

2020-09-18 Thread Mark Wielaard
USE_INFLATE code path. But I felt that the many macros didn't really help understand the code. So the unzip routine has a slightly different code path for ZSTD. Signed-off-by: Mark Wielaard --- ChangeLog| 4 ++ config/ChangeLog | 5 ++ c

Re: PATCH: debuginfod, db size reduction

2020-09-19 Thread Mark Wielaard
in commit d63a809d). Thanks, Mark

Re: [PATCH] libdwfl: Add ZSTD support.

2020-09-21 Thread Mark Wielaard
Hi, On Fri, 2020-09-18 at 15:17 +0200, Mark Wielaard wrote: > Newer kernels might be compressed using ZSTD add support to libdwfl > open so we can can automatically read ZSTD compressed files and > kernel images. > > The support is very similar to the bzip2 and lzma support,

[PATCH] readelf: Support showing view pairs in loclists as GNU extension.

2020-09-28 Thread Mark Wielaard
View pairs are encoded in .debug_loclists as they are encoded in .debug_locs sections by the GCC compiler. Scan for DW_AT_GNU_locviews attributes that point to the view pairs just in front of the actual location lists. Signed-off-by: Mark Wielaard --- src/ChangeLog | 9 ++ src/readelf.c

Re: [PATCH] readelf: Support showing view pairs in loclists as GNU extension.

2020-10-02 Thread Mark Wielaard
On Mon, Sep 28, 2020 at 09:43:44AM +0200, Mark Wielaard wrote: > View pairs are encoded in .debug_loclists as they are encoded in > .debug_locs sections by the GCC compiler. Scan for DW_AT_GNU_locviews > attributes that point to the view pairs just in front of the actual > location lists. Pushed.

Re: [PATCH] Add a --{enable,disable}-progs configure option

2020-10-02 Thread Mark Wielaard
o as described. But I am slightly reluctant to apply this because it totally breaks make check. How do you check the build is really correct? Would it be possible to use a small subset of the testsuite with --disable-progs? Thanks, Mark

<    13   14   15   16   17   18   19   20   21   22   >