Re: eh_frame is debug info too

2018-09-18 Thread Mark Wielaard
ndle you get from dwarf_getcfi () is valid till the associated Dwarf handle is closed. The Dwarf_CFI returned from dwarf_getcfi_elf is owned by (and should be freed by) the called (and you will get a new one each call). So be careful you don't have a memory leak here. Cheers, Mark

[COMMITTED] tests: backtrace-dwarf.c improve error handling in test framework.

2018-09-21 Thread Mark Wielaard
To debug https://sourceware.org/bugzilla/show_bug.cgi?id=23673 clean up the test framework so we know what exactly failed. Suggested-by: Dmitry V. Levin Signed-off-by: Mark Wielaard --- tests/ChangeLog | 7 +++ tests/backtrace-dwarf.c | 38 -- 2

Re: Handling pgoff in perf elf mmap/mmap2 elf info

2018-09-21 Thread Mark Wielaard
l_report_elf_mmap function that you can use to either get a new Dwfl_Module or to extend an existing one. I have to think how that interacts with mprotect and mmunmap. Cheers, Mark

Re: Handling pgoff in perf elf mmap/mmap2 elf info

2018-10-11 Thread Mark Wielaard
but it might be interesting to see if that makes libdwfl able to just associate the whole ELF file with the correct address map. Cheers, Mark

[PATCH] strip, unstrip: Handle SHT_GROUP correctly.

2018-10-13 Thread Mark Wielaard
n the group sections have the exact same name (".group"), flags (none) and sometimes the same sizes. Which makes matching them hard. Extract the group signature and compare those when comparing two group sections. Signed-off-by: Mark Wielaard --- src/ChangeLog

[PATCH] readelf: Handle multiple .debug_macro sections and decode header flag.

2018-10-13 Thread Mark Wielaard
x27;t have that information and no interface yet for libdw users. Also decode the macro header flag byte for convenience. Signed-off-by: Mark Wielaard --- src/ChangeLog | 4 + src/readelf.c | 31 ++- tests/ChangeLog| 10 + tests/run-r

Re: [PATCH] Handle ADD/SUB relocations

2018-10-13 Thread Mark Wielaard
Hi Andreas, On Tue, 2018-10-02 at 14:46 +0200, Andreas Schwab wrote: > This adds support for ADD and SUB relocations as seen on RISC-V. Sorry this took 2 weeks. I should have reviewed it immediately because it looks just perfect. I pushed it to master. Thanks, Mark

[PATCH] libdwfl: Sanity check partial core file data reads.

2018-10-14 Thread Mark Wielaard
ff-by: Mark Wielaard --- libdwfl/ChangeLog| 7 +++ libdwfl/dwfl_segment_report_module.c | 13 +++-- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/libdwfl/ChangeLog b/libdwfl/ChangeLog index c5ea563..2e7efd4 100644 --- a/libdwfl/ChangeLog +++ b/li

[PATCH] findtextrel: Check that sh_entsize isn't zero.

2018-10-14 Thread Mark Wielaard
A bogus ELF file could have sh_entsize as zero. Don't divide by zero, but just assume there are no entries in the section. https://sourceware.org/bugzilla/show_bug.cgi?id=23755 Signed-off-by: Mark Wielaard --- src/ChangeLog | 4 src/findtextrel.c | 23 +-- 2

[PATCH] ar: Assume epoch if ar_date is bogus.

2018-10-14 Thread Mark Wielaard
If the ar header contains a bogus ar_date then in verbose mode we would get a NULL pointer from localtime. Just assume the entry was created during the epoch. https://sourceware.org/bugzilla/show_bug.cgi?id=23754 Signed-off-by: Mark Wielaard --- src/ChangeLog | 4 src/ar.c | 10

Re: Handling pgoff in perf elf mmap/mmap2 elf info

2018-10-15 Thread Mark Wielaard
++.so.6.0.25 should show it. That way we can see how the PT_LOAD segments map to the mmap events. Thanks, Mark

[PATCH] readelf: Make sure readp is smaller than cieend in print_debug_frame_section.

2018-10-16 Thread Mark Wielaard
We could end up with a negative length in a call to memchr. https://sourceware.org/bugzilla/show_bug.cgi?id=23782 Signed-off-by: Mark Wielaard --- src/ChangeLog | 5 + src/readelf.c | 12 ++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/src/ChangeLog b/src

Re: [PATCH] strip, unstrip: Handle SHT_GROUP correctly.

2018-10-17 Thread Mark Wielaard
On Sat, 2018-10-13 at 10:46 +0200, Mark Wielaard wrote: > The usage of annobin in Fedora showed a couple of bugs when using > eu-strip and eu-unstrip on ET_REL files that contain multiple group > sections. > > When stripping we should not remove the SHF_GROUP flag from section

Re: Handling pgoff in perf elf mmap/mmap2 elf info

2018-10-17 Thread Mark Wielaard
Hi Milian, On Wed, Oct 17, 2018 at 04:52:42PM +0200, Milian Wolff wrote: > On Montag, 15. Oktober 2018 23:06:07 CEST Milian Wolff wrote: > > On Montag, 15. Oktober 2018 23:04:52 CEST Mark Wielaard wrote: > > > On Mon, 2018-10-15 at 22:38 +0200, Milian Wolff wrote: > > &

[PATCH] arlib: Check that sh_entsize isn't zero.

2018-10-18 Thread Mark Wielaard
A bogus ELF file could have sh_entsize as zero. Don't divide by zero, but just assume there are no symbols in the section. https://sourceware.org/bugzilla/show_bug.cgi?id=23786 Signed-off-by: Mark Wielaard --- src/ChangeLog | 4 src/arlib.c | 3 +++ 2 files changed, 7 inser

[PATCH] size: Handle recursive ELF ar files.

2018-10-18 Thread Mark Wielaard
eu-size didn't handle an ELF ar file that contained an ar file itself correctly. handle_ar would recursively call itself but close the ELF file before returning. Only close the ELF file at the top-level. https://sourceware.org/bugzilla/show_bug.cgi?id=23787 Signed-off-by: Mark Wielaard ---

[PATCH] Recognize and parse GNU Property notes.

2018-10-19 Thread Mark Wielaard
ct the GNU_PROPERTY_STACK_SIZE, GNU_PROPERTY_NO_COPY_ON_PROTECTED and GNU_PROPERTY_X86_FEATURE_1_AND types GNU_PROPERTY_X86_FEATURE_1_IBT and GNU_PROPERTY_X86_FEATURE_1_SHSTK. Tests are added for extracting the note from sections or segments as set by gcc -fcf-protection. Signed-off-by: Mark Wie

[PATCH] Check sh_entsize is not zero.

2018-10-19 Thread Mark Wielaard
-off-by: Mark Wielaard --- libasm/ChangeLog | 4 libasm/disasm_cb.c | 2 ++ libdwfl/ChangeLog | 4 libdwfl/dwfl_module_getdwarf.c | 2 ++ src/ChangeLog | 7 +++ src/unstrip.c | 27

Re: [PATCH] strip, unstrip: Handle SHT_GROUP correctly.

2018-10-19 Thread Mark Wielaard
After a bit more testing found one other issue. It can happen that the section indexes in the group need to be renumbered when eu-unstrip puts the stripped and debug file together again. So we need to explicitly do that.commit eee4269e53154daaf0251371aacd91ec5db3eb30 Author: Mark Wielaard Date

Re: [PATCH] readelf: Handle multiple .debug_macro sections and decode header flag.

2018-10-19 Thread Mark Wielaard
On Sat, 2018-10-13 at 15:17 +0200, Mark Wielaard wrote: > In object files there could be multiple .debug_macro sections. > These are COMDAT sections used as imports. Note that the output for > DW_MACRO_import isn't ideal since the offset is printed against the > start of the .de

Re: [PATCH] libdwfl: Sanity check partial core file data reads.

2018-10-19 Thread Mark Wielaard
On Sun, 2018-10-14 at 16:48 +0200, Mark Wielaard wrote: > There were two issues when reading note data from a core file. > We didn't check if the data we already had in a buffer was big > enough. And if we did get the data, we should check if we got > everything, or just a

Re: [PATCH] findtextrel: Check that sh_entsize isn't zero.

2018-10-19 Thread Mark Wielaard
On Sun, 2018-10-14 at 16:59 +0200, Mark Wielaard wrote: > A bogus ELF file could have sh_entsize as zero. Don't divide by zero, > but just assume there are no entries in the section. Pushed to master.

Re: [PATCH] ar: Assume epoch if ar_date is bogus.

2018-10-19 Thread Mark Wielaard
On Sun, 2018-10-14 at 17:31 +0200, Mark Wielaard wrote: > If the ar header contains a bogus ar_date then in verbose mode we > would > get a NULL pointer from localtime. Just assume the entry was created > during the epoch. Pushed to master.

Re: [PATCH] readelf: Make sure readp is smaller than cieend in print_debug_frame_section.

2018-10-19 Thread Mark Wielaard
On Tue, 2018-10-16 at 14:22 +0200, Mark Wielaard wrote: > We could end up with a negative length in a call to memchr. Pushed to master.

Re: [PATCH] arlib: Check that sh_entsize isn't zero.

2018-10-19 Thread Mark Wielaard
On Thu, 2018-10-18 at 19:02 +0200, Mark Wielaard wrote: > A bogus ELF file could have sh_entsize as zero. Don't divide by zero, > but just assume there are no symbols in the section. Pushed to master.

Re: [PATCH] size: Handle recursive ELF ar files.

2018-10-19 Thread Mark Wielaard
On Fri, 2018-10-19 at 01:02 +0200, Mark Wielaard wrote: > eu-size didn't handle an ELF ar file that contained an ar file itself > correctly. handle_ar would recursively call itself but close the ELF > file before returning. Only close the ELF file at the top-level. Pushed to master.

Re: [PATCH] Check sh_entsize is not zero.

2018-10-19 Thread Mark Wielaard
On Fri, 2018-10-19 at 15:03 +0200, Mark Wielaard wrote: > There were some recent bug reports where we trusted the ELF section > header > to be sane and divided the sh_size by the sh_entsize to get the > number of > objects in the section. This would cause a divide by zero if

[COMMITTED] backends: ppc use define instead of const for size of dwarf_regs array.

2018-10-20 Thread Mark Wielaard
The size of the dwarf_regs is a constant, but when building without optimizations the compiler doesn't see that and will warn that it cannot proof the stack size is bounded. Use a define instead of a const, so the compiler will use a constant expression everywhere. Signed-off-by: Mark Wie

[PATCH] libdwelf: New function dwelf_elf_begin.

2018-10-21 Thread Mark Wielaard
nd needs duplicating the file handle. Signed-off-by: Mark Wielaard --- libdw/ChangeLog | 4 +++ libdw/libdw.map | 5 libdwelf/ChangeLog | 8 +- libdwelf/Makefile.am| 2 +- libdwelf/dwelf_e

[PATCH] readelf: Use shstrndx to lookup section names.

2018-10-24 Thread Mark Wielaard
The function section_name would use the Ehdr e_shstrndx field to find the index of the section index string table directly. But it should use elf_getshdrstrndx. Adjust all callers. Signed-off-by: Mark Wielaard --- src/ChangeLog | 21 +++ src/readelf.c | 82

[PATCH] addr2line: Use elf_getshdrstrndx not Ehdr field to print section name.

2018-10-24 Thread Mark Wielaard
Using the Ehdr field directly doesn't work when there are a large number of sections. Signed-off-by: Mark Wielaard --- src/ChangeLog | 5 + src/addr2line.c | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index bd6751a..50

[PATCH 1/4] strip: Always copy over any phdrs if there are any.

2018-10-26 Thread Mark Wielaard
Ignore the type of ELF file, just copy over any phdrs if the original file contained any. Also refuse to move around any allocated sections based on whether there are any phdrs instead of on ELF file type. Signed-off-by: Mark Wielaard --- src/ChangeLog | 6 + src/strip.c | 70

Add eu-strip --reloc-debug-sections-only option

2018-10-26 Thread Mark Wielaard
: Add --reloc-debug-sections-only option Cheers, Mark

[PATCH 2/4] strip: Split out debug section relocation into separate helper functions.

2018-10-26 Thread Mark Wielaard
Extract a couple of helper functions out of handle_elf (secndx_name, get_xndxdata and remove_debug_relocations) so they can be reused more easily in the future. Signed-off-by: Mark Wielaard --- src/ChangeLog | 7 + src/strip.c | 541

[PATCH 3/4] strip: Extract code to update shdrstrndx into new common function.

2018-10-26 Thread Mark Wielaard
Signed-off-by: Mark Wielaard --- src/ChangeLog | 5 src/strip.c | 94 +++ 2 files changed, 54 insertions(+), 45 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index f55ff6c..766c839 100644 --- a/src/ChangeLog +++ b/src

[PATCH 4/4] strip: Add --reloc-debug-sections-only option.

2018-10-26 Thread Mark Wielaard
you don't want to strip, but for which the debug section relocations can be resolved already. Signed-off-by: Mark Wielaard --- src/ChangeLog| 11 src/strip.c | 155 +-- tests/ChangeLog | 4 ++ tests/run-

Re: [PATCH] addr2line: Use elf_getshdrstrndx not Ehdr field to print section name.

2018-10-26 Thread Mark Wielaard
On Wed, 2018-10-24 at 16:18 +0200, Mark Wielaard wrote: > Using the Ehdr field directly doesn't work when there are a large > number of sections. Pushed to master.

Re: [PATCH] readelf: Use shstrndx to lookup section names.

2018-10-26 Thread Mark Wielaard
On Wed, 2018-10-24 at 16:01 +0200, Mark Wielaard wrote: > The function section_name would use the Ehdr e_shstrndx field to find the > index of the section index string table directly. But it should use > elf_getshdrstrndx. Adjust all callers. Pushed to master.

Re: [PATCH] Recognize and parse GNU Property notes.

2018-10-28 Thread Mark Wielaard
On Fri, 2018-10-19 at 12:26 +0200, Mark Wielaard wrote: > GNU Property notes are different from normal notes because they use > variable alignment/padding of their fields. They are 8 byte aligned, > but use 4 byte fields. The name is aligned at 4 bytes and padded so > that, the desc i

[COMMITTED] unstrip: Add ELF_CHECK to make sure gelf_getehdr () doesn't return NULL.

2018-11-02 Thread Mark Wielaard
Although we would most likely have seen an error before, make sure we provide a proper error message in the unlikely case gelf_getehdr () returns NULL. Signed-off-by: Mark Wielaard --- src/ChangeLog | 5 + src/unstrip.c | 1 + 2 files changed, 6 insertions(+) diff --git a/src/ChangeLog b

Re: [PATCH] libdwelf: New function dwelf_elf_begin.

2018-11-04 Thread Mark Wielaard
On Mon, 2018-10-22 at 01:47 +0200, Mark Wielaard wrote: > It currently wraps __libdw_open_file which makes error handling > slight tricky and needs duplicating the file handle. Which introduced some confusion that could cause the file descriptor to leak. The attached updated patch adds a v

[PATCH] libcpu: Recognize bpf jump variants BPF_JLT, BPF_JLE, BPF_JSLT and BPF_JSLE

2018-11-04 Thread Mark Wielaard
ween a register and another register or immediate. Add these new constants to bpf.h, recognize them in bpf_disasm and update the testfile-bpf-dis1.expect file. Signed-off-by: Mark Wielaard --- lib/ChangeLog | 4 lib/bpf.h | 4 libcpu/Cha

Re: [PATCH] Also find CFI in sections of type SHT_X86_64_UNWIND

2018-11-04 Thread Mark Wielaard
need to check the arch. Does != SHT_NOBITS work for you? - What does eu-readelf -S show? I think we need a x86_64_section_type_name () ebl hook to show it correctly. Thanks, Mark

Re: [PATCH] Also find CFI in sections of type SHT_X86_64_UNWIND

2018-11-06 Thread Mark Wielaard
Hi Milian, On Tue, 2018-11-06 at 00:12 +0100, Milian Wolff wrote: > On Montag, 5. November 2018 00:04:32 CET Mark Wielaard wrote: > > Interestingly, when I try to reproduce this on my laptop (i.e. compile even > the trivial C example), then I cannot reproduce this at all a

Re: Add eu-strip --reloc-debug-sections-only option

2018-11-06 Thread Mark Wielaard
On Fri, 2018-10-26 at 23:50 +0200, Mark Wielaard wrote: > eu-strip already supports --reloc-debug-sections to resolve all > relocations between .debug_ sections while creating a separate > .debug file with -f. It is sometimes useful to do the same without > doing any oth

Re: [PATCH 4/4] strip: Add --reloc-debug-sections-only option.

2018-11-06 Thread Mark Wielaard
On Fri, 2018-10-26 at 23:50 +0200, Mark Wielaard wrote: > diff --git a/tests/ChangeLog b/tests/ChangeLog > index 751a081..0870d4c 100644 > --- a/tests/ChangeLog > +++ b/tests/ChangeLog > @@ -1,3 +1,7 @@ > +2018-10-26 Mark Wielaard > + > + * run-strip-reloc.sh: Add

Re: Elfutils new release

2018-11-07 Thread Mark Wielaard
ploited. But it is of course always a good idea to fix any bugs found. Cheers, Mark

Re: [PATCH 4/4] strip: Add --reloc-debug-sections-only option.

2018-11-09 Thread Mark Wielaard
On Tue, Nov 06, 2018 at 03:21:24PM +0100, Mark Wielaard wrote: > The buildbot didn't sent any failure emails (I am still looking into > why), but this new cmp test failed on debian-armhf, fedora-ppc64 and > fedora-ppc64le: > https://builder.wildebeest.org/buildbot/#/builders/15/

[PATCH] strip: Also handle gnu compressed debug sections with --reloc-debug-sections

2018-11-09 Thread Mark Wielaard
e original input file). Add compressed ET_REL tests to run-strip-reloc.sh testcase. Signed-off-by: Mark Wielaard --- libelf/ChangeLog | 4 libelf/elf_compress_gnu.c | 7 --- src/ChangeLog | 5 + src/strip.c | 29 +++---

Re: [PATCH] Also find CFI in sections of type SHT_X86_64_UNWIND

2018-11-09 Thread Mark Wielaard
On Wed, Nov 07, 2018 at 10:02:54AM +0100, Milian Wolff wrote: > On Dienstag, 6. November 2018 12:06:57 CET Mark Wielaard wrote: > > It seems to only happen with a specific combination of gcc and the gold > > linker, I could only generate the SHT_X86_64_UNWIND sections only on >

Re: [PATCH] libdwelf: New function dwelf_elf_begin.

2018-11-09 Thread Mark Wielaard
On Sun, Nov 04, 2018 at 05:37:42PM +0100, Mark Wielaard wrote: > On Mon, 2018-10-22 at 01:47 +0200, Mark Wielaard wrote: > > It currently wraps __libdw_open_file which makes error handling > > slight tricky and needs duplicating the file handle. > > Which introduced some

Re: [PATCH] libcpu: Recognize bpf jump variants BPF_JLT, BPF_JLE, BPF_JSLT and BPF_JSLE

2018-11-09 Thread Mark Wielaard
On Sun, Nov 04, 2018 at 09:40:32PM +0100, Mark Wielaard wrote: > Linux kernel 4.13 introduced 4 more jump class variants. > > commit 92b31a9af73b3a3fc801899335d6c47966351830 > Author: Daniel Borkmann > Date: Thu Aug 10 01:39:55 2017 +0200 > > bpf: ad

Re: Buildbot failure in Wildebeest Builder on whole buildset

2018-11-10 Thread Mark Wielaard
ll look into supporting these ELF notes. Cheers, Mark

Re: [PATCH] Also find CFI in sections of type SHT_X86_64_UNWIND

2018-11-10 Thread Mark Wielaard
ep 17 00:00:00 2001 From: Mark Wielaard Date: Sat, 10 Nov 2018 23:33:03 +0100 Subject: [PATCH] elflint: Allow PT_GNU_EH_FRAME segment to match SHT_X86_64_UNWIND section. The gold linker might generate an .eh_frame_hdr with a SHT_X86_64_UNWIND type instead of a SHT_PROGBITS type. Signed-off-

[PATCH] Recognize NT_VERSION notes.

2018-11-11 Thread Mark Wielaard
NT_VERSION notes are emitted by the gas .version directive. They have an empty description and (ab)use the owner name to store the version data string. Signed-off-by: Mark Wielaard --- libebl/ChangeLog| 9 + libebl/eblobjnote.c | 10 +- libebl

[PATCH] Handle GNU Build Attribute ELF Notes.

2018-11-12 Thread Mark Wielaard
GA 0 GNU Build Attribute OPEN "stack_realign": FALSE A new test was added to run-readelf -n for the existing annobin file. Signed-off-by: Mark Wielaard --- libebl/ChangeLog| 8 +++ libebl/eblobjnote.c | 151 +

Re: [PATCH] Recognize NT_VERSION notes.

2018-11-13 Thread Mark Wielaard
On Mon, 2018-11-12 at 00:08 +0100, Mark Wielaard wrote: > NT_VERSION notes are emitted by the gas .version directive. > They have an empty description and (ab)use the owner name to store > the version data string. I pushed this to master because it is a prerequisite of the GNU Build Attr

Re: [PATCH] Handle GNU Build Attribute ELF Notes.

2018-11-13 Thread Mark Wielaard
into the sources. Lets do that then :) It also resolves the self-test failure on Fedora 29, so it should make the buildbot happy again. Pushed to master. Thanks, Mark

Re: [PATCH] strip: Also handle gnu compressed debug sections with --reloc-debug-sections

2018-11-13 Thread Mark Wielaard
On Fri, 2018-11-09 at 17:41 +0100, Mark Wielaard wrote: > Check whether a section was gnu compressed and decompress it first > before trying to resolve relocations. Recompress it afterwards. > > This found a bug in elf_compress_gnu which would use the "raw" file > cont

Re: Buildbot failure in Wildebeest Builder on whole buildset

2018-11-13 Thread Mark Wielaard
e incorrectly aligned compressed sections and 2) we generate such incorrectly aligned compressed sections ourselves. Pondering fixes. Cheers, Mark

Re: Buildbot failure in Wildebeest Builder on whole buildset

2018-11-13 Thread Mark Wielaard
On Tue, 2018-11-13 at 18:29 +0100, Mark Wielaard wrote: > So we might actually have two bugs. 1) we don't handle incorrectly > aligned compressed sections and 2) we generate such incorrectly > aligned compressed sections ourselves. > > Pondering fixes. The fixes were

Re: [PATCH] Also find CFI in sections of type SHT_X86_64_UNWIND

2018-11-13 Thread Mark Wielaard
On Sun, 2018-11-11 at 00:28 +0100, Mark Wielaard wrote: > Found another issue while testing with a gcc 8.1 and gold setup I > noticed some self-tests failed because elflint doesn't know about > SHT_X86_64_UNWIND section type and cannot match the PT_GNU_EH_FRAME > segment. The att

Prepare for 0.175

2018-11-14 Thread Mark Wielaard
Set version to 0.175 Update NEWS and elfutils.spec.in. Regenerate po/*.po files. Signed-off-by: Mark Wielaard --- NEWS| 18 + config/elfutils.spec.in | 14 + configure.ac|2 +- po/de.po| 1162

Re: Elfutils new release

2018-11-14 Thread Mark Wielaard
On Wed, 2018-11-07 at 15:33 +0100, Mark Wielaard wrote: > On Wed, 2018-11-07 at 14:15 +, Karbownik, Anna wrote: > > I'd like to ask you whether you plan to release 0.175 elfutils > > version? > > There are enough (small) new features and bug fixes to do a new > re

Re: [PATCH] Handle GNU Build Attribute ELF Notes.

2018-11-14 Thread Mark Wielaard
Hi Nick, I have a local hack that defines SHF_GNU_BUILD_NOTE and allows it in elflint. But without any documentation on what the semantics of this section flag are. I cannot find this flag being used in the binaries generated on Fedora 29. Is this flag ever used? Thanks, Mark

[PATCH] libebl: Don't update w, t and len unnecessarily in ebl_object_note_type_name.

2018-11-15 Thread Mark Wielaard
Harmless, but useless. Signed-off-by: Mark Wielaard --- libebl/ChangeLog| 5 + libebl/eblobjnotetypename.c | 8 +++- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/libebl/ChangeLog b/libebl/ChangeLog index 79a2ff4..a2f8956 100644 --- a/libebl/ChangeLog +++ b

Re: [PATCH] libebl: Don't update w, t and len unnecessarily in ebl_object_note_type_name.

2018-11-16 Thread Mark Wielaard
On Thu, Nov 15, 2018 at 03:55:12PM +0100, Mark Wielaard wrote: > Harmless, but useless. Pushed to master.

elfutils 0.175 released

2018-11-16 Thread Mark Wielaard
BPF_JSLE. backends: RISCV handles ADD/SUB relocations. Handle SHT_X86_64_UNWIND. Fixes CVE-2018-18310, CVE-2018-18520 and CVE-2018-18521. * GIT SHORTLOG * Andreas Schwab (1): Handle ADD/SUB relocations Mark Wielaard (34): tests: backtrace-dwarf.c improve error handling in test framework

[PATCH] libelf: Get alignement correct when calling conversion functions.

2018-11-18 Thread Mark Wielaard
nt Signed-off-by: Mark Wielaard --- libelf/ChangeLog | 5 libelf/elf32_updatefile.c | 36 tests/ChangeLog| 7 ++ tests/Makefile.am | 6 +++-- tests/run-strip-version.sh | 58 ++

Re: elfutils 0.175 released

2018-11-18 Thread Mark Wielaard
On Sun, Nov 18, 2018 at 11:46:29PM +0100, Kurt Roeckx wrote: > On Fri, Nov 16, 2018 at 02:00:46PM +0100, Mark Wielaard wrote: > > ELFUTILS 0.175 - http://elfutils.org/ > > > > A new release of elfutils is available at: > > ftp://sourceware.org/pub/elfutils/0.175/ &g

[PATCH] Add -Wtrampolines to CFLAGS.

2018-11-19 Thread Mark Wielaard
-Wtrampolines to CLAGS to make sure we don't. Signed-off-by: Mark Wielaard --- config/ChangeLog | 4 config/eu.am | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/config/ChangeLog b/config/ChangeLog index f281eb2..40d6f85 100644 --- a/config/ChangeLog +++ b/c

Re: elfutils 0.175 released

2018-11-20 Thread Mark Wielaard
On Tue, 2018-11-20 at 00:43 +0100, Kurt Roeckx wrote: > On Fri, Nov 16, 2018 at 02:00:46PM +0100, Mark Wielaard wrote: > > ELFUTILS 0.175 - http://elfutils.org/ > > > > A new release of elfutils is available at: > > ftp://sourceware.org/pub/elfutils/0.175/ > > o

Re: [PATCH] Add -Wtrampolines to CFLAGS.

2018-11-21 Thread Mark Wielaard
On Mon, 2018-11-19 at 11:54 +0100, Mark Wielaard wrote: > elfutils uses nested functions a lot. This is fine unless one takes > the > address of such a nested function. When taking the address of a > nested > function a trampoline is generated that on some systems require the

Re: [PATCH] libelf: Get alignement correct when calling conversion functions.

2018-11-21 Thread Mark Wielaard
On Sun, 2018-11-18 at 15:38 +0100, Mark Wielaard wrote: > When writing out data that needs to be converted we have to make sure > the conversion function is called on correctly aligned buffers. When > using mmap this might mean we have to convert into a temporarily > buffer > if th

[PATCH] libdw: Enable building with -Og.

2018-11-23 Thread Mark Wielaard
return if an error occurs anyway. https://sourceware.org/bugzilla/show_bug.cgi?id=23914 Signed-off-by: Mark Wielaard --- libdw/ChangeLog| 5 + libdw/dwarf_child.c| 2 +- libdw/dwarf_getattrs.c | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/libdw/ChangeLog b

[PATCH] libdwfl: Fix relocation overlap sanity check.

2018-11-23 Thread Mark Wielaard
dn't get relocations applied. Signed-off-by: Mark Wielaard --- The diff might look big, but without the whitespace changes it is just: @@ -561,7 +562,13 @@ relocate_section (Dwfl_Module *mod, Elf *relocated, const GElf_Ehdr *ehdr, shdrs or phdrs data then we refuse to do the relocations. I

Re: [PATCH] libdwfl: Fix relocation overlap sanity check.

2018-11-26 Thread Mark Wielaard
On Fri, 2018-11-23 at 21:20 +0100, Mark Wielaard wrote: > We would not relocate when the relocation section data or the target > section date would overlap with one of the ELF headers. This is only > really necessary if the data comes directly from the mmapped file. > Otherwise ther

Re: [PATCH] libdw: Enable building with -Og.

2018-11-26 Thread Mark Wielaard
On Fri, 2018-11-23 at 21:08 +0100, Mark Wielaard wrote: > When building with -Og gcc is unable to see that __libdw_dieabbrev () > will initialize what the second argument points to when no error > occurs > as called by dwarf_child and dwarf_getattrs. Causing an possibly > uninitiali

[PATCH] libebl: Fix reading GNU_PROPERTY_STACK_SIZE reading from 32bit notes.

2018-12-02 Thread Mark Wielaard
-off-by: Mark Wielaard --- libebl/ChangeLog| 5 ++ libebl/eblobjnote.c | 20 -- tests/ChangeLog | 9 +++ tests/Makefile.am | 4 ++ tests/run-readelf-n.sh | 101 tests

Re: [PATCH] libebl: Fix reading GNU_PROPERTY_STACK_SIZE reading from 32bit notes.

2018-12-05 Thread Mark Wielaard
On Mon, 2018-12-03 at 00:15 +0100, Mark Wielaard wrote: > When reading a GNU_PROPERTY_STACK_SIZE we need to use the proper data > type. GElf_Addr is 64bit always and when reading a 32bit size part of > it would not be initialized. Use either Elf32_Addr or Elf64_Addr to > read and pr

Re: dwfl_link_map_report() on a core file with sysroot? Opens the wrong solibs?

2019-01-06 Thread Mark Wielaard
attempt adds a new function call, > dwfl_set_sysroot(), which works, but feels a bit clunky. I might see > if I can just use the find_elf callback instead. If you got this working please let us know. It might help others and/or deciding how to add a proper interface/config/hook for it. Thanks, Mark

Re: RISC-V support

2019-01-08 Thread Mark Wielaard
already found the CONTRIBUTING file: https://sourceware.org/git/?p=elfutils.git;a=blob_plain;f=CONTRIBUTING If not, please look through it, we are fairly easy on contributions, just make sure you read and agree to the Developer's Certfificate of Origin. Partial patches are OK. But it is preferred to have them somewhat testable. Please don't contribute code that is completely theoretical and cannot be validated at all. Thanks, Mark

Re: [PATCH] RISC-V: Improve riscv64 core file support.

2019-01-08 Thread Mark Wielaard
atch the new readelf > output for coredumps. This commit looks perfect (but please keep the lines a bit smaller, so git show looks ok on a 80 char term - yeah, I know how old school). Pushed to master. Thanks, Mark

Re: [PATCH] RISC-V: Add initial return value location support.

2019-01-10 Thread Mark Wielaard
tion and DWARF register mappings. The calling convention is explained in: https://github.com/riscv/riscv-elf-psabi-doc/blob/master/riscv-elf.md#procedure-calling-convention But I couldn't find an official DWARF register mapping. If you have references I like to add them to the code. Pushed

Re: [PATCH] RISC-V: Add untested 32-bit core file support.

2019-01-12 Thread Mark Wielaard
t;{ > -{ .offset = 8, .regno = 1, .count = 31, .bits = 64 } /* x1..x31 */ > +{ .offset = BITS/8, .regno = 1, .count = 31, .bits = 64 } /* x1..x31 */ >}; Should that be .bits = BITS ? Thanks, Mark

Re: RISC-V support

2019-01-12 Thread Mark Wielaard
one for function descriptor support for example). Cheers, Mark

Re: [PATCH] RISC-V: Add untested 32-bit core file support.

2019-01-13 Thread Mark Wielaard
On Sat, Jan 12, 2019 at 04:37:51PM -0800, Jim Wilson wrote: > On Sat, Jan 12, 2019 at 2:29 PM Mark Wielaard wrote: > > > static const Ebl_Register_Location prstatus_regs[] = > > >{ > > > -{ .offset = 8, .regno = 1, .count = 31, .bits = 64 } /* x1..x31 */

Re: [PATCH] Skip run-readelf-compressed.sh test if built without bzip2

2019-01-13 Thread Mark Wielaard
am. Thanks, Mark

[PATCH] libebl: Check NT_PLATFORM core notes contain a zero terminated string.

2019-01-16 Thread Mark Wielaard
Most strings in core notes are fixed size. But NT_PLATFORM contains just a variable length string. Check that it is actually zero terminated before passing to readelf to print. https://sourceware.org/bugzilla/show_bug.cgi?id=24089 Signed-off-by: Mark Wielaard --- libdwfl/ChangeLog

Re: [PATCH] Skip run-readelf-compressed.sh test if built without bzip2

2019-01-16 Thread Mark Wielaard
gi-bin/get-raw-msg?listname=elfutils-devel&date=2019-q1&msgid=67ff4de2-fd5a-0ba8-0b5d-173c5619a88b%40qt.io But please do feel free to post patches as pull requests using git request-pull -p if you have a public git repo (but please use -p and also sent the output to the list to make reviewing easier). Cheers, Mark

[PATCH] configure: Add new --enable-install-elfh option.

2019-01-18 Thread Mark Wielaard
the system installed elf.h. Add a new configure option --enable-install-elfh to install elf.h. But warn when it is enabled for the default /usr or /usr/local prefix because it might clash with the glibc/system elf.h header in that case. Signed-off-by: Mark Wielaard --- ChangeLog | 4

[PATCH] libdw: Check terminating NUL byte in dwarf_getsrclines for dir/file table.

2019-01-20 Thread Mark Wielaard
org/bugzilla/show_bug.cgi?id=24102 Signed-off-by: Mark Wielaard --- libdw/ChangeLog | 5 + libdw/dwarf_getsrclines.c | 11 --- src/ChangeLog | 5 + src/readelf.c | 8 ++-- 4 files changed, 24 insertions(+), 5 deletions(-) diff --git a/li

[PATCH] libdwfl: Sanity check partial core file dyn data read.

2019-01-20 Thread Mark Wielaard
When reading the dyn data from the core file check if we got everything, or just part of the data. https://sourceware.org/bugzilla/show_bug.cgi?id=24103 Signed-off-by: Mark Wielaard --- libdwfl/ChangeLog| 5 + libdwfl/dwfl_segment_report_module.c | 6 ++ 2 files

Re: MIPS Elfutils support?

2019-01-22 Thread Mark Wielaard
end. Best would be to discuss with the Debian maintainer, Kurt Roeckx < k...@roeckx.be>, how to move this forward/upstream. Thanks, Mark

Re: [PATCH] Use separate files for strip outputs

2019-01-23 Thread Mark Wielaard
rip: illformed file 'testfile' in the run-strip-test-many.sh.log (but without actually failing the test... I am still investgating why/how it is failing. Will apply your patch afterwards. Thanks, Mark

Re: [PATCH] Use separate files for strip outputs

2019-01-24 Thread Mark Wielaard
On Wed, 2019-01-23 at 23:19 +0100, Mark Wielaard wrote: > As you say in your commit message this exposes that the > run-strip-test-many.sh actually fails. Indeed, even without > you patch you can see src/strip: illformed file 'testfile' > in the run-strip-test-many.sh.log

Re: [PATCH] configure: Add new --enable-install-elfh option.

2019-01-24 Thread Mark Wielaard
(whether we are actually on a POSIX system or not). And I am not sure it really should define uid_t, gid_t, mode_t, and pid_t. Those normally don't come from features.h (they would come from sys/types.h). Cheers, Mark From 86f9481187bccb78b2533674bb905a0de1a03abf Mon Sep 17 00:00:00 2001

Re: [PATCHv1 0/2] specify a sysroot to search when examining a core file

2019-01-29 Thread Mark Wielaard
arser dwfl_standard_argp (). It would be nice to add a --sysroot argument parser there too that would automatically call dwfl_set_sysroot to make them handle --sysroot automagically. - Is there a way to have some small testcase for this? Cheers, Mark

Re: [PATCHv2 1/2] libdwfl: specify optional sysroot to search for shared libraries

2019-01-29 Thread Mark Wielaard
Dwfl sysroot. > } > >if (mod != NULL) > @@ -1037,3 +1052,10 @@ dwfl_link_map_report (Dwfl *dwfl, const void *auxv, > size_t auxv_size, >&integrated_memory_callback, &mcb, r_debug_info); > } > INTDEF (dwfl_link_map_report) > + > +void > +dwfl_set_sysroot (Dwfl *dwfl, const char *sysroot) > +{ > + dwfl->sysroot = realpath(sysroot, NULL); > +} > +INTDEF (dwfl_set_sysroot) I like it better if this goes into its own file (in theory every public function has its own implementation file). Also see the comments above for the function declaration. You probably want to handle sysroot already been set (error or replace?) and sysroot being NULL (error or clear sysroot setting?). Cheers, Mark

Re: [PATCHv2 2/2] eu-stack: add support for sysroot option

2019-01-29 Thread Mark Wielaard
looks perfect (but is missing a ChangeLog entry). Thanks, Mark

<    8   9   10   11   12   13   14   15   16   17   >