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

2019-01-29 Thread Mark Wielaard
Hi Ulf, On Thu, Jan 24, 2019 at 06:53:15PM +0100, Mark Wielaard wrote: > On Fri, 2019-01-18 at 14:03 +, Ulf Hermann wrote: > > I think you should also adapt tests/Makefile.am to use our own elf.h > > in > > this case. See https://codereview.qt-project.org/#/c

Re: [PATCH elfutils 1/2] [libdwfl] parse inode in /proc/pid/maps correctly

2019-01-29 Thread Mark Wielaard
; and fixed the problem. Reading the inode number as a signed value was indeed odd. Added a ChangeLog entry and pused to master. Thanks, Mark

Re: [PATCH elfutils 2/2] [tests] parse inode in /proc/pid/maps correctly in run-backtrace-data.sh

2019-01-29 Thread Mark Wielaard
rmat. So it seems $*u should do the trick. But since I haven't been able to make the original fail, I might be wrong. Cheers, Mark

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

2019-01-31 Thread Mark Wielaard
overly complicated code to generate a core file for the run-backtrace-native-core.sh testcase. For none-core, running native tests you could look at tests/run-native-test.sh All these are slightly fragile though. Cheers, Mark

Re: [PATCH elfutils 2/2] [tests] parse inode in /proc/pid/maps correctly in run-backtrace-data.sh

2019-01-31 Thread Mark Wielaard
On Tue, Jan 29, 2019 at 09:23:39PM +, Yonghong Song wrote: > On 1/29/19 12:50 PM, Mark Wielaard wrote: > > On Fri, Jan 25, 2019 at 01:20:09PM -0800, Yonghong Song wrote: > >> The backtrace-data.c parsed the inode in /proc/pid/maps with > >> format "%*x".

Re: [PATCH elfutils] [tests] parse inode in /proc/pid/maps/correctly in run-backtrace-data.sh

2019-01-31 Thread Mark Wielaard
On Tue, Jan 29, 2019 at 01:33:03PM -0800, Yonghong Song wrote: > The backtrace-data.c parsed the inode in /proc/pid/maps with > format "%*x". > This caused failure if inode is big. For example, > 7f269223d000-7f269226b000 r-xp 00:50 10224326387095067468 > /home/... > > The error

Re: [PATCH elfutils 2/2] [tests] parse inode in /proc/pid/maps correctly in run-backtrace-data.sh

2019-01-31 Thread Mark Wielaard
On Thu, Jan 31, 2019 at 10:14:32PM +0100, Mark Wielaard wrote: > So your fix is correct. > But the testcase is also slightly wrong. > It really shouldn't check errno if the function didn't fail. > There is no guarantee that it will be zero. So, even though it found a bu

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

2019-01-31 Thread Mark Wielaard
ts/Makefile.am @@ -598,6 +598,8 @@ addsections_LDADD = $(libelf) # Don't include any -I CPPFLAGS. Except when we install our own elf.h. if !INSTALL_ELFH system_elf_libelf_test_CPPFLAGS = +else +system_elf_libelf_test_CPPFLAGS = -I$(top_srcdir)/libelf endif system_elf_libelf_test_LDADD = $(libelf) Pushed with that change. Thanks, Mark

Re: unknown error after dwarf_cfi_addrframe()

2019-02-11 Thread Mark Wielaard
irst contains the elfutils libraries libelf.so, libdw.so, etc. The second contains the backends libebl_.so > I'm trying to read frame info from .eh_frame section. But I'm getting > "unknown error". That is certainly an unhelpful error message. Sorry. Cheers, Mark

Re: unknown error after dwarf_cfi_addrframe()

2019-02-12 Thread Mark Wielaard
. Most of DWARF can be understood in an architecture independent way. But CFI does have some arch specific things. You should really use make install to get a proper installation, not just copy some files. Otherwise you might indeed miss the backends, or translations, etc. Cheers, Mark

Re: unknown error after dwarf_cfi_addrframe()

2019-02-12 Thread Mark Wielaard
d for elfutils 175 x86_64-pc-linux-gnu" eu-strings /p/paradyn/development/sasha/local/lib/libdw.so | grep ^Build eu-strings /p/paradyn/development/sasha/local/lib/elfutils/libebl_x86_64.so \ | grep ^Build Hope that helps, Mark

Re: unknown error after dwarf_cfi_addrframe()

2019-02-12 Thread Mark Wielaard
elfutils \ /tmp/elfutils/bin/eu-readelf --relocs /bin/true Since relocations are arch specific, if it cannot find the x86_64 backend it will show , otherwise it will print the correct relocation names. Cheers, Mark

[COMMITTED] Prepare for 0.176

2019-02-14 Thread Mark Wielaard
Set version to 0.176. Update NEWS and elfutils.spec.in. Update GPG-KEY. Regenerate po/*.po files. Signed-off-by: Mark Wielaard --- ChangeLog | 7 ++ GPG-KEY | 141 -- NEWS| 10 ++ config/ChangeLog| 4

Re: [COMMITTED] Prepare for 0.176

2019-02-14 Thread Mark Wielaard
as (see backends/aarch64_symbol.c). Cheers, Mark

Re: [COMMITTED] Prepare for 0.176

2019-02-15 Thread Mark Wielaard
is test passes. > > > > If so, you might have to add a check_special_symbol hook like > > aarch64 > > has (see backends/aarch64_symbol.c). > > Please let me know and we can eventually create a PR for it. It looks like that was it. Could you try the atta

Re: [COMMITTED] Prepare for 0.176

2019-02-15 Thread Mark Wielaard
On Fri, 2019-02-15 at 14:43 +0100, Mark Wielaard wrote: > On Fri, 2019-02-15 at 09:42 +0100, Martin Liška wrote: > > > It might be this binutils commit: > > > https://sourceware.org/ml/binutils/2018-07/msg00200.html > > > > > > Which isn't in bin

elfutils 0.176 released

2019-02-15 Thread Mark Wielaard
support. RISC-V: Add untested 32-bit core file support. Mark Wielaard (23): config/upload-release.sh: Need to make before make dist. Add -Wtrampolines to CFLAGS. libelf: Get alignment correct when calling conversion functions. tests: Call test_cleanup in backtrace-subr.sh check_unsupported

Re: Elfutils 0.176 and riscv

2019-02-16 Thread Mark Wielaard
ceware.org/git/?p=glibc.git;a=commit;h=85bd1ddbdfdfd13cfd06f7c367519b6ed3360843 Cheers, Mark

Symbol versioning (Was: [Bug general/24000] couple of testsuite fails with uclibc library)

2019-02-19 Thread Mark Wielaard
libraries and programs using them. And we don't have/use a different mechanism to indicate symbols/ABI changed. How do you prevent things breaking when upgrading the elfutils libraries? Cheers, Mark

Re: Symbol versioning (Was: [Bug general/24000] couple of testsuite fails with uclibc library)

2019-02-19 Thread Mark Wielaard
is more that if we disable symbol versioning we have to make it much more clear that the resulting shared libaries aren't really usable as "normal". Cheers, Mark

[PATCH] libdwf: Initialize notes early in intuit_kernel_bounds.

2019-02-24 Thread Mark Wielaard
We fake initialization of notes with an empty asm statement. But it is simpler and less confusing to just initialize notes just before the fopen. Signed-off-by: Mark Wielaard --- libdwfl/ChangeLog | 6 ++ libdwfl/linux-kernel-modules.c | 7 ++- 2 files changed, 8

[PATCH] libelf: There is just one ELF version.

2019-02-24 Thread Mark Wielaard
id of __libelf_version_initialized. Removes one (or more) array (version) dimension from various tables and accessor functions (__elf_xfctstom, shtype_map, __libelf_data_type, __libelf_type_aligns and __libelf_type_sizes). Signed-off-by: Mark Wielaard ` --- libelf/ChangeLog | 45 ++ l

[PATCH] libelf: Remove unused internal __elf[32|64]_msize functions.

2019-02-24 Thread Mark Wielaard
Those functions were intended for ELF versions where the memory and file sizes of data structures are different. They were never used because libelf depends on the file and memory sizes being equal (otherwise using mmap wouldn't work). Signed-off-by: Mark Wielaard --- libelf/ChangeLog

[PATCH] libelf: Remove unused __elf_xfctstof.

2019-02-24 Thread Mark Wielaard
__elf_xfctstof is only used in case the memory size and file size of ELF data structures are different. This is never the case. Signed-off-by: Mark Wielaard --- libelf/ChangeLog| 5 + libelf/gelf_xlate.c | 4 libelf/libelfP.h| 2 -- 3 files changed, 5 insertions(+), 6 deletions

Re: [PATCH] libdwf: Initialize notes early in intuit_kernel_bounds.

2019-02-28 Thread Mark Wielaard
On Sun, Feb 24, 2019 at 03:11:52PM +0100, Mark Wielaard wrote: > We fake initialization of notes with an empty asm statement. But > it is simpler and less confusing to just initialize notes just > before the fopen. Pushed to master.

Re: [PATCH] libelf: There is just one ELF version.

2019-02-28 Thread Mark Wielaard
On Sun, Feb 24, 2019 at 06:07:17PM +0100, Mark Wielaard wrote: > Remove (partially defined out) code and data structures dealing with > multiple ELF versions. There hasn't been a new ELF version in the > last 20 years. Simplify the code a bit by just assuming there will > on

Re: [PATCH] libelf: Remove unused internal __elf[32|64]_msize functions.

2019-02-28 Thread Mark Wielaard
On Sun, Feb 24, 2019 at 06:14:36PM +0100, Mark Wielaard wrote: > Those functions were intended for ELF versions where the memory and > file sizes of data structures are different. They were never used > because libelf depends on the file and memory sizes being equal > (otherwis

Re: [PATCH] libelf: Remove unused __elf_xfctstof.

2019-02-28 Thread Mark Wielaard
On Sun, Feb 24, 2019 at 06:18:11PM +0100, Mark Wielaard wrote: > __elf_xfctstof is only used in case the memory size and file size of ELF > data structures are different. This is never the case. Pushed to master.

[COMMITTED] tests: Remove tgkill define from backtrace.c

2019-03-04 Thread Mark Wielaard
tgkill is never used in the test and it might conflict with newer glibc which might define tgkill themselves (just like gettid): https://sourceware.org/bugzilla/show_bug.cgi?id=6399 Signed-off-by: Mark Wielaard --- tests/ChangeLog | 4 tests/backtrace.c | 1 - 2 files changed, 4

[COMMITTED] libelf: Fix possible resource leak in elf[32|64]_updatefile.

2019-03-06 Thread Mark Wielaard
When we cannot allocate enough memory to convert the data in updatemmap we should free the scns before returning an error. Signed-off-by: Mark Wielaard --- libelf/ChangeLog | 5 + libelf/elf32_updatefile.c | 1 + 2 files changed, 6 insertions(+) diff --git a/libelf/ChangeLog b

[COMMITTED] libasm: Check return value of gelf_update_ehdr in asm_end.

2019-03-06 Thread Mark Wielaard
In theory the gelf_update_ehdr call could fail. Immediately report an error in that case. Signed-off-by: Mark Wielaard --- libasm/ChangeLog | 4 libasm/asm_end.c | 6 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/libasm/ChangeLog b/libasm/ChangeLog index 92dfd72

[PATCH] libelf: Use posix_memalign instead of aligned_alloc.

2019-03-07 Thread Mark Wielaard
Older glibc might not aligned_alloc (it is C11). Use posix_memalign instead. posix_memalign requires the alignment to be a multiple of sizeof (void *). So use malloc for smaller alignments. Signed-off-by: Mark Wielaard --- libelf/ChangeLog | 5 + libelf/elf32_updatefile.c | 20

Re: [PATCH] libelf: Use posix_memalign instead of aligned_alloc.

2019-03-13 Thread Mark Wielaard
On Thu, 2019-03-07 at 17:35 +0100, Mark Wielaard wrote: > Older glibc might not have aligned_alloc (it is C11). > Use posix_memalign instead. posix_memalign requires the alignment to > be a multiple of sizeof (void *). So use malloc for smaller > alignments. Pushed to master.

[PATCH] readelf: Print DW_AT_data_member_location as decimal offset, not hex number.

2019-04-03 Thread Mark Wielaard
location description, in which case it might have been of DW_FORM_loclist, for which it makes sense to print as hex offset (between square brackets). Signed-off-by: Mark Wielaard --- src/ChangeLog | 5 + src/readelf.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src

Re: [PATCH 0/2] Add C-SKY support

2019-04-03 Thread Mark Wielaard
#1 0x2ab79648 sleep > #2 0x2aace6a4 > /home/vmh/elfutilswk/src/stack: dwfl_thread_getframes tid 12587 at 0x2aace6a3 > in /home/vmh/elfutilswk/tests/test-25076/deleted-lib.so: Callback returned > failure > ./run-deleted.sh: line 38: kill: (12587) - No such process > FAIL run-deleted.sh (exit status: 1) This is again most likely because of script changes. The test cannot find the running process. Cheers, Mark

Re: [PATCH] readelf: Print DW_AT_data_member_location as decimal offset, not hex number.

2019-04-10 Thread Mark Wielaard
On Wed, Apr 03, 2019 at 04:54:15PM +0200, Mark Wielaard wrote: > The data_member_location attribute was printed as a hex number, but other > constant attributes like bit_offset, byte_size or alignment were printed > as decimal numbers. This is confusing. > > The reason that data_

Re: [PATCH V2 0/2] Add C-SKY support

2019-04-14 Thread Mark Wielaard
e TID 18678: #0 0x00400ff3 main #1 0x004011e4 generic_start_main #2 0x00401461 __libc_start_main #3 0x00400ef6 _start If you could run that on your C-SKY setup and post the (static) binary and core file somewhere (they are probably too big for the mailinglist. Cheers, Mark

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

2019-04-14 Thread Mark Wielaard
On Wed, 2019-04-10 at 15:51 +0800, Mao Han wrote: > +2019-04-01 Mao Han > + > + * elf.h: Update from glibc. Looks like a clean sync from glibc. Pushed to master. Thanks, Mark

Re: [PATCH] wrong backend definition?

2019-04-14 Thread Mark Wielaard
g. Thanks for noticing. We were lucky that none of the libebl_CPU.h definitions used in the file depended on the BACKEND define. This should be fixed just in case we start using the BACKEND define later. Pushed to master as attached. Thanks, Mark From e6118f9720d42af6758a0a74b7324acd4aed383

Re: [PATCH V2 2/2] Add backend support for C-SKY

2019-04-15 Thread Mark Wielaard
ord flags) > +{ > + switch (flags & EF_CSKY_ABIMASK) > +{ > +case EF_CSKY_ABIV1: > +case EF_CSKY_ABIV2: > + return true; > +default: > + return false; > +} > +} OK. Does the current backend handle both? > +const char * > +csky_section_type_name (int type, > + char *buf __attribute__ ((unused)), > + size_t len __attribute__ ((unused))) > +{ > + if (type == SHT_CSKY_ATTRIBUTES) > +return "CSKY_ATTRIBUTES"; > + > + return NULL; > +} OK. I couldn't find any description of this section. Is it like SHT_ARM_ATTRIBUTES/SHT_GNU_ATTRIBUTES? Then you might also want to handle it like that in src/readelf.c (print_attributes). > diff --git a/libebl/eblopenbackend.c b/libebl/eblopenbackend.c > index d54b720..e229dbd 100644 > --- a/libebl/eblopenbackend.c > +++ b/libebl/eblopenbackend.c > @@ -135,6 +135,7 @@ static const struct >{ "bpf", "elf_bpf", "bpf", 3, EM_BPF, 0, 0 }, >{ "riscv", "elf_riscv", "riscv", 5, EM_RISCV, ELFCLASS64, ELFDATA2LSB }, >{ "riscv", "elf_riscv", "riscv", 5, EM_RISCV, ELFCLASS32, ELFDATA2LSB }, > + { "csky", "elf_csky", "csky", 4, EM_CSKY, ELFCLASS32, ELFDATA2LSB }, > }; > #define nmachines (sizeof (machines) / sizeof (machines[0])) Looks correct. > diff --git a/src/elflint.c b/src/elflint.c > index 810c8bd..edb466d 100644 > --- a/src/elflint.c > +++ b/src/elflint.c > @@ -330,7 +330,7 @@ static const int valid_e_machine[] = > EM_CRIS, EM_JAVELIN, EM_FIREPATH, EM_ZSP, EM_MMIX, EM_HUANY, EM_PRISM, > EM_AVR, EM_FR30, EM_D10V, EM_D30V, EM_V850, EM_M32R, EM_MN10300, > EM_MN10200, EM_PJ, EM_OPENRISC, EM_ARC_A5, EM_XTENSA, EM_ALPHA, > -EM_TILEGX, EM_TILEPRO, EM_AARCH64, EM_BPF, EM_RISCV > +EM_TILEGX, EM_TILEPRO, EM_AARCH64, EM_BPF, EM_RISCV, EM_CSKY >}; > #define nvalid_e_machine \ >(sizeof (valid_e_machine) / sizeof (valid_e_machine[0])) Likewise. Thanks, Mark

[COMMITTED] config: Add git tag --verify to upload-release.sh.

2019-04-15 Thread Mark Wielaard
Add a check to make sure we have to correct (signed) tag. Signed-off-by: Mark Wielaard --- config/ChangeLog | 4 config/upload-release.sh | 1 + 2 files changed, 5 insertions(+) diff --git a/config/ChangeLog b/config/ChangeLog index f956780..9b1cce4 100644 --- a/config/ChangeLog

Re: [PATCH] elfclassify tool

2019-04-15 Thread Mark Wielaard
{ > +case classify_file: > +case classify_elf: > +case classify_executable: > +case classify_shared: > +case classify_loadable: > + command = key; > + command_path = arg; > + break; If you want to only allow one classification at a time you should check whether command is already set and call something like: argp_error (state, N_("Can only use one classification at a time.")); > +case 'v': > + ++verbose; > + break; > + > +case ARGP_KEY_ARG: > + argp_usage (state); > + exit (2); > +} > + > + return 0; > +} Thanks, Mark

Re: Dwarf_Op

2019-04-26 Thread Mark Wielaard
rpreting its number fields? Thanks, Mark

Re: Dwarf_Op

2019-04-27 Thread Mark Wielaard
r). Unfortunately there is no better/precise way to turn the CFI register rule into a Dwarf Expression Location. But note that if you use the Dwarf_Ops to calculate an Dwarf_Addr, then the 64bit unsigned arithmetic will work out (because the plus of the big unsigned constant will wrap around and turn into a small minus constant). Cheers, Mark

[COMMITTED] libdw: Reject DW_OP_implicit_value in CFI.

2019-04-27 Thread Mark Wielaard
NULL. Signed-off-by: Mark Wielaard --- libdw/ChangeLog | 5 + libdw/dwarf_getlocation.c | 2 ++ 2 files changed, 7 insertions(+) diff --git a/libdw/ChangeLog b/libdw/ChangeLog index aaa6296..22fdab3 100644 --- a/libdw/ChangeLog +++ b/libdw/ChangeLog @@ -1,3 +1,8 @@ +2019-04-27

[COMMITTED] libdw: Call check_constant_offset with direct pointers.

2019-04-28 Thread Mark Wielaard
In dwarf_getlocation_addr pass the pointers to llbufs and listlens indirectly by passing a pointer to the first array element. Simplify the code by passing the pointers directly. Signed-off-by: Mark Wielaard --- libdw/ChangeLog | 5 + libdw/dwarf_getlocation.c | 2 +- 2 files

[COMMITTED] libdw: Remove unused variable initialization in dwarf_siblingof.

2019-04-28 Thread Mark Wielaard
We immediately reassign the value of addr after declaration. Signed-off-by: Mark Wielaard --- libdw/ChangeLog | 4 libdw/dwarf_siblingof.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/libdw/ChangeLog b/libdw/ChangeLog index bc446fe5a..37aab8047 100644 --- a

[COMMITTED] libdwfl: Don't call realloc with zero in cu.c addraranges.

2019-04-28 Thread Mark Wielaard
zero after reduction (which would be invalid DWARF) we are left with a dangling pointer. Signed-off-by: Mark Wielaard --- libdwfl/ChangeLog | 4 libdwfl/cu.c | 7 +-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/libdwfl/ChangeLog b/libdwfl/ChangeLog index 1da888f6f

[COMMITTED] libdwfl: Make sure to left shift a unsigned 64bit value in expr_eval.

2019-04-28 Thread Mark Wielaard
In frame_unwind.c expr_eval we left shift 1 up to 56 bits. We have to make sure we don't left shift a 32bit signed value (that would be undefined behavior). So shift a 1ULL value instead. Signed-off-by: Mark Wielaard --- libdwfl/ChangeLog | 5 + libdwfl/frame_unwind.c | 2 +- 2

[COMMITTED] libebl: Check ebl is not NULL in ebl_symbol_[binding|type]_name.

2019-04-28 Thread Mark Wielaard
For STB_GNU_UNIQUE and STT_GNU_IFUNC we need to check the elf of the given ebl. Make sure the ebl given isn't NULL. Signed-off-by: Mark Wielaard --- libebl/ChangeLog | 7 +++ libebl/eblsymbolbindingname.c | 1 + libebl/eblsymboltypename.c| 1 + 3 files changed, 9 inser

[COMMITTED] elfcmp: Handle bad sections without crashing.

2019-04-28 Thread Mark Wielaard
If we cannot get the Shdr of a section then don't try to use or compare them. Signed-off-by: Mark Wielaard --- src/ChangeLog | 4 src/elfcmp.c | 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 57db6cadb..3786f3432 100644

[COMMITTED] nm: Simplify naming of invalid sections, check shdr isn't NULL.

2019-04-28 Thread Mark Wielaard
When shdr is NULL or the sh_name index is invalid, don't try to use it. Just call the section "[invalid section name]". Don't try to be too smart by creating a dynamic invalid name using alloca to simplify memory usage in this exceptional case. Signed-off-by: Mark Wielaard

[COMMITTED] size: Robustify against gelf_getshdr returning NULL.

2019-04-28 Thread Mark Wielaard
Signed-off-by: Mark Wielaard --- src/ChangeLog | 7 +++ src/size.c| 6 ++ 2 files changed, 13 insertions(+) diff --git a/src/ChangeLog b/src/ChangeLog index 3020bd768..e3e411ef5 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,10 @@ +2019-04-28 Mark Wielaard

[COMMITTED] unstrip: Robustify gelf_getshdr and gelf_getsymshndx calls.

2019-04-28 Thread Mark Wielaard
Signed-off-by: Mark Wielaard --- src/ChangeLog | 6 ++ src/unstrip.c | 4 2 files changed, 10 insertions(+) diff --git a/src/ChangeLog b/src/ChangeLog index e3e411ef5..ae1379327 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2019-04-28 Mark Wielaard

[PATCH] libelf: If xlate can only convert the ELF note header, just do that.

2019-04-30 Thread Mark Wielaard
t the Note header and ignoring the (raw) note data. Signed-off-by: Mark Wielaard --- libelf/note_xlate.h | 12 +++- tests/ChangeLog | 9 +++ tests/Makefile.am | 8 ++- tests/run-xlate-note.sh | 93 tests/xlate_notes.c

[COMMITTED] tests: Don't printf a known NULL symname.

2019-04-30 Thread Mark Wielaard
GCC9 on 32bit systems might warn about '%s' directive argument is null for symname in backtrace.c. Just check whether symname is NULL. Signed-off-by: Mark Wielaard --- tests/ChangeLog | 4 tests/backtrace.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --g

Re: [PATCH] libelf: If xlate can only convert the ELF note header, just do that.

2019-04-30 Thread Mark Wielaard
On Tue, Apr 30, 2019 at 01:24:48PM +0200, Mark Wielaard wrote: > When we started parsing new style ELF_T_NHDR8 notes we added extra > checks on alignment and padding. When those failed we would stop > converting and just return the rest of the ELF Note unconverted. > In the case were

[COMMITTED] tests: Don't printf a known NULL symname in backtrace-dwarf.c.

2019-05-01 Thread Mark Wielaard
GCC9 on 32bit systems might warn about '%s' directive argument is null for symname in backtrace-dwarf.c. Just check whether symname is NULL. This is an identical fix for the same issue as found in backtrace.c, but now in backtrace-dwarf.c Signed-off-by: Mark Wielaard --- tests

[PATCH] libelf: Add n_namesz offset overflow check to gelf_get_note.

2019-05-01 Thread Mark Wielaard
ff-by: Mark Wielaard --- libelf/ChangeLog | 5 + libelf/gelf_getnote.c | 5 +++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/libelf/ChangeLog b/libelf/ChangeLog index 5eadaf7..924ff59 100644 --- a/libelf/ChangeLog +++ b/libelf/ChangeLog @@ -1,3 +1,8 @@ +2019-05-01

Re: Dwarf_Op

2019-05-01 Thread Mark Wielaard
way to provide it with things like memory accessors and register values. libdwfl provides some of that through dwfl_attach_state. Cheers, Mark

Re: Dwarf_Op

2019-05-03 Thread Mark Wielaard
en the CFI expression can be turned into 1, 2 or 3 DWARF operators. The caller is asked to provide memory to store those. If the expression is bigger, then a pointer to internal storage is returned. In both cases you would just use *OPS for the *NOPS number of operations (in the first case *OPS points to your *MEM_OPS provided array, in the second case it points to some internal storage. Cheers, Mark

Re: [PATCH] libelf: If xlate can only convert the ELF note header, just do that.

2019-05-04 Thread Mark Wielaard
On Wed, May 01, 2019 at 12:04:17AM +0200, Mark Wielaard wrote: > On Tue, Apr 30, 2019 at 01:24:48PM +0200, Mark Wielaard wrote: > > When we started parsing new style ELF_T_NHDR8 notes we added extra > > checks on alignment and padding. When those failed we would stop > > conve

Re: [PATCH] libelf: Add n_namesz offset overflow check to gelf_get_note.

2019-05-04 Thread Mark Wielaard
On Wed, May 01, 2019 at 03:55:59PM +0200, Mark Wielaard wrote: > During fuzzing of the new xlate_notes testcase I noticed that > gelf_get_note didn't check whether the n_namesz of a note was > too big. This could lead to offset wrapping around. Causing an > infinite loop going o

Re: [PATCH] lib/color: Fix compilation with uClibc

2019-05-05 Thread Mark Wielaard
p_help takes a char * name as argument in both. Slightly odd, but sure, the cast to char * should be harmless. Added a ChangeLog entry and pushed to master. Thanks, Mark

[PATCH] readelf: Clean up section lists after usage.

2019-05-09 Thread Mark Wielaard
Signed-off-by: Mark Wielaard --- src/ChangeLog | 5 + src/readelf.c | 14 ++ 2 files changed, 19 insertions(+) diff --git a/src/ChangeLog b/src/ChangeLog index ae13793..0c817f4 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2019-05-09 Mark Wielaard

[PATCH] readelf: Decode DW_AT_discr_list block attributes.

2019-05-10 Thread Mark Wielaard
variant_part (parent) DIE of the variant DIE (which has the discr_list attribute). Add a testcase using both signed and unsigned discriminants. https://sourceware.org/bugzilla/show_bug.cgi?id=24509 Signed-off-by: Mark Wielaard --- src/ChangeLog | 7 + src/readelf.c

Re: Dwarf_Op

2019-05-10 Thread Mark Wielaard
und at an offset of the current CFA (or in this case, it is the CFA value). You get the CFA for a frame with dwarf_frame_cfa (), which works similar to dwarf_frame_register (), the CFA itself doesn't have/is a register number however. Hope that helps, Mark

[PATCH] libelf: Mark shdr_flags dirty if offset or size changes during update.

2019-05-12 Thread Mark Wielaard
We forgot to mark the shdr_flags dirty when only the sh_size or sh_offset changed during elf_update (). This meant that if there were no other shdr changes we only wrote out the section data, but didn't write out the shdr table to the file. Add a testcase that puts some sections in the re

Re: [PATCH] readelf: Clean up section lists after usage.

2019-05-14 Thread Mark Wielaard
On Thu, May 09, 2019 at 04:55:23PM +0200, Mark Wielaard wrote: > +2019-05-09 Mark Wielaard > + > + * readelf.c (cleanup_list): New function. > + (main): Call cleanup_list for dump_data_sections and string_sections. Pushed to master.

Re: [PATCH] readelf: Decode DW_AT_discr_list block attributes.

2019-05-14 Thread Mark Wielaard
On Fri, May 10, 2019 at 11:48:32AM -0600, Tom Tromey wrote: > >>>>> "Mark" == Mark Wielaard writes: > > Mark> Decode DW_AT_descr_list blocks using the DW_DSC values. > Mark> This requires knowing the signedness of the discriminant. > Mark> Which

Re: [PATCH] libelf: Mark shdr_flags dirty if offset or size changes during update.

2019-05-16 Thread Mark Wielaard
On Mon, 2019-05-13 at 00:13 +0200, Mark Wielaard wrote: > We forgot to mark the shdr_flags dirty when only the sh_size or > sh_offset changed during elf_update (). This meant that if there were > no other shdr changes we only wrote out the section data, but didn't > write out the

Re: [PATCH v2] skip the test when gcc not deployed

2019-05-23 Thread Mark Wielaard
Hi, On Tue, May 21, 2019 at 03:33:06PM +0800, mingli...@windriver.com wrote: > Skip the tests which depend on gcc when > gcc not deployed. What exactly are you trying to do? When would you run make check without having gcc installed? If this is to check against an alternative compiler? In the la

Re: How to use test-nlist

2019-05-23 Thread Mark Wielaard
um with the st_value and st_shndx of the symbol named if found. As you can see for me it corresponds to the values found by: $ eu-readelf -s ./test-nlist | egrep ' (var|bss|main|foo)' 58: 4048 4 OBJECT GLOBAL DEFAULT 24 var 61: 4050 4 OBJECT GLOBAL DEFAULT 25 bss 66: 1310 3 FUNCGLOBAL DEFAULT 14 foo 71: 1080408 FUNCGLOBAL DEFAULT 14 main Hope that helps you debug. Cheers, Mark

Re: How to use test-nlist

2019-05-23 Thread Mark Wielaard
On Fri, May 24, 2019 at 11:00:57AM +0800, Yu, Mingli wrote: > On 2019年05月23日 19:50, Mark Wielaard wrote: > > > # ./tests/test-nlist > > > nlist failed > > > > You are supposed to run it with make check. > > make check TESTS=test-nlist > > > >

Re: How to use test-nlist

2019-05-23 Thread Mark Wielaard
On Fri, May 24, 2019 at 02:36:15PM +0800, Yu, Mingli wrote: > > Yes. See the source code. > > The test tries to run nlist on "./test-nlist". > > Which package provides nlist, I didn't found nlist in my system. nlist is a function in libelf, one of the libraries of elfutils. Cheers, Mark

Re: How to use test-nlist

2019-05-24 Thread Mark Wielaard
-g. > > > And the that test binary isn't accidentially stripped afterwards. Make sure you fix that and the test will pass. Cheers, Mark

Re: [PATCH v2] skip the test when gcc not deployed

2019-05-24 Thread Mark Wielaard
> When would you run make check without having gcc installed? > > Thanks Mark! > I just run the check without having gcc installed, and of cource no compiler > installed in my test env. I don't think that is a realistic test environment for testing the elfutils libraries. You h

[COMMITTED] libebl: Try harder to find backend library in bin and lib origin paths.

2019-05-30 Thread Mark Wielaard
zilla/show_bug.cgi?id=24488 Signed-off-by: Mark Wielaard --- libebl/ChangeLog| 8 libebl/eblopenbackend.c | 117 +--- 2 files changed, 78 insertions(+), 47 deletions(-) diff --git a/libebl/ChangeLog b/libebl/ChangeLog index e050bfc..8a

[COMMITTED] tests: elfcopy --reverse-offs should only swap sections next to each other.

2019-06-03 Thread Mark Wielaard
The run-reverse-sections-self.sh (which really should have been called "swap-sections") could fail if the ELF file had sections that were not directly next to each other swapped. Add a check to make sure the swapped sections are actually directly next to each other. Signed-off-by: Mar

[PATCH] strip don't mmap debug output file.

2019-06-18 Thread Mark Wielaard
first read into the ELF data structure buffers, then written out as a whole. In this case the mmap output buffer is just overhead. Signed-off-by: Mark Wielaard --- src/ChangeLog | 5 + src/strip.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/ChangeLog b/src/Chang

[PATCH] libelf: Fix some 32bit offset/size issues that break updating 4G+ files.

2019-06-18 Thread Mark Wielaard
sure the machine has enough disk and memory. Do these checks look reasonable? They probably prevent (make the test SKIP) on all buildbot CI workers. Cheers, Mark - Some years ago, in commit b1d0b0fc "libelf: Use int64_t for offsets in libelf.h", we changed the public interface to us

Re: [PATCH] libelf: Fix some 32bit offset/size issues that break updating 4G+ files.

2019-06-19 Thread Mark Wielaard
On Wed, 2019-06-19 at 02:04 +0200, Mark Wielaard wrote: > The patch also contains a testcase. But since it is necessary to create > and process a 4GB+ file it is guarded by some checks to make sure the > machine has enough disk and memory. Do these checks look reasonable? > They prob

Re: [PATCH] libelf: Fix some 32bit offset/size issues that break updating 4G+ files.

2019-06-20 Thread Mark Wielaard
On Thu, 2019-06-20 at 04:54 +0300, Dmitry V. Levin wrote: > On Thu, Jun 20, 2019 at 01:10:53AM +0200, Mark Wielaard wrote: > > +# Make sure the disk is reasonably fast, should be able to write > > 100MB/s > > +fast_disk=1 > > +timeout -s9 10s dd conv=fsync if=/de

Re: [PATCH] strip don't mmap debug output file.

2019-06-24 Thread Mark Wielaard
On Tue, 2019-06-18 at 13:50 +0200, Mark Wielaard wrote: > Using ELF_C_WRITE_MMAP sometimes causes unexpected errors when disk > space is low. When writing out the file, the output file is first > extended so that it covers the whole file/mmap size. But it might > be that the file sy

Re: [PATCH V2 0/2] Add C-SKY support

2019-06-24 Thread Mark Wielaard
akes sure we are properly attached. */ You are totally correct. I have installed the attached patch. Thanks, Mark From ac9e5349dd662289485e67403be943a4ec78cd4d Mon Sep 17 00:00:00 2001 From: Mark Wielaard Date: Tue, 25 Jun 2019 00:21:42 +0200 Subject: [PATCH] stack: Fix error message when dwfl

Re: Elf64_Phdr

2019-06-24 Thread Mark Wielaard
MMAP_PRIVATE,) or not. Cheers, Mark

Re: Elf64_Phdr

2019-06-27 Thread Mark Wielaard
existing table is removed. > What happens to the previous headers? Using references to them become invalid. Cheers, Mark

Re: Elf64_Phdr

2019-06-27 Thread Mark Wielaard
could use your own array of Elf64_Phdr or GElf_Phdr for that. Note that in the case of gelf_getphdr () you already provide your own storage, so that might be another reason to prefer the gelf interfaces. Cheers, Mark

[PATCH] libdwelf: Add dwelf_elf_e_machine_string and use it in readelf.

2019-06-28 Thread Mark Wielaard
e_machine value. Since this was the only usage of ebl->name, remove that from struct ebl. Also add a testcase that makes sure dwelf_elf_e_machine_string works for all EM values in the libelf/elf.h header so we will immediately notice when a new value appears. Signed-off-by: Mark Wiela

Re: [PATCH] libelf: Fix some 32bit offset/size issues that break updating 4G+ files.

2019-06-28 Thread Mark Wielaard
Hi, I pushed this to master with the changes suggested by Dmitry. Thanks, Mark

Re: Buildbot failure in Wildebeest Builder on whole buildset

2019-06-28 Thread Mark Wielaard
On Fri, Jun 28, 2019 at 11:02:02PM +, build...@builder.wildebeest.org wrote: > The Buildbot has detected a failed build on builder whole buildset while > building elfutils. > Full details are available at: > https://builder.wildebeest.org/buildbot/#builders/1/builds/376 > > Buildbot URL:

Re: Buildbot failure in Wildebeest Builder on whole buildset

2019-07-01 Thread Mark Wielaard
On Sat, 2019-06-29 at 01:47 +0200, Mark Wielaard wrote: > FAIL: run-large-elf-file.sh > === > > long_bit: 64 > space_available: 38 > mem_available: 7 > 1024+0 records in > 1024+0 records out > 1073741824 bytes (1.1 GB) copied, 3.72662 s, 288 MB/s

Re: [PATCH] libelf: Fix some 32bit offset/size issues that break updating 4G+ files.

2019-07-02 Thread Mark Wielaard
limit). I'll try to create a testcase to replicate the issue to see if I can debug where the offset value gets truncated. Or do you happen to have the 5.4 GB binary named "chrome" create before splitting still around somewhere where I could download it? Thanks, Mark

Re: [PATCH] libelf: Fix some 32bit offset/size issues that break updating 4G+ files.

2019-07-03 Thread Mark Wielaard
Hi, On Tue, 2019-07-02 at 16:21 -0700, Lei Zhang wrote: > On Tue, Jul 2, 2019 at 4:15 PM Mark Wielaard wrote: > > I'll try to create a testcase to replicate the issue to see if I can > > debug where the offset value gets truncated. > > Sounds good to me. > > &g

Re: [PATCH] libelf: Fix some 32bit offset/size issues that break updating 4G+ files.

2019-07-03 Thread Mark Wielaard
On Wed, 2019-07-03 at 08:23 -0700, Lei Zhang wrote: > On Wed, Jul 3, 2019 at 7:53 AM Mark Wielaard wrote: > > Thanks for the file, it is indeed pretty big :) > > But I am not able to replicate the issue with elfutils from git > > trunk. > > commit 31c8b3f098b06

Re: debuginfo server progress update

2019-07-05 Thread Mark Wielaard
guments and opening the resulting file path. Other clients, like gdb, then also don't need to implement the caching and quering, but can also simply call dbgclient and just open the resulting file. Cheers, Mark

Re: [RFC PATCH 0/2] elfutils: don't use dlopen() for libebl modules

2019-07-08 Thread Mark Wielaard
and it makes it > possible to use the elfutils libraries in standalone static binaries. Very timely! This came up again recently on irc where someone else also had something like this. > I came across a previous discussion [1] where Mark suggested a hybrid > approach, where one could con

Re: [RFC PATCH 0/2] elfutils: don't use dlopen() for libebl modules

2019-07-08 Thread Mark Wielaard
backend implementation): https://sourceware.org/ml/elfutils-devel/2019-q2/msg00130.html Cheers, Mark

Re: [PATCH 5/5] libdw: export libebl symbols

2019-07-08 Thread Mark Wielaard
move them into elflint? ebl_syscall_abi is never used, but actually seems useful. Not saying we should immediately do that, but the above would be some functions that deserve some attention before we make them public. Cheers, Mark

Re: [RFC PATCH 0/2] elfutils: don't use dlopen() for libebl modules

2019-07-09 Thread Mark Wielaard
ing of moving some of the functionality into libdw proper (as cleaned up, exported api) to reduce the size increase a little. And add a mechanism for only building some of the backends (or maybe just drop some old ones that nobody uses anyway). Cheers, Mark

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