[PATCH] libebl: Remove unused ebl_syscall_abi.

2020-10-19 Thread Mark Wielaard
GCC11 -Warray-parameter warned about ebl_syscall_abi being inconsistently
declared (once with a pointer to int, once with an array of 6 int elements).
Since ebl_syscall_abi isn't actually used and was only implemented for
3 backends without any tests just remove it.

Signed-off-by: Mark Wielaard 
---
 backends/ChangeLog| 12 +
 backends/Makefile.am  |  6 ++---
 backends/i386_init.c  |  1 -
 backends/i386_syscall.c   | 50 
 backends/ppc64_init.c |  1 -
 backends/ppc_init.c   |  1 -
 backends/ppc_syscall.c| 53 ---
 backends/x86_64_init.c|  1 -
 backends/x86_64_syscall.c | 50 
 libebl/ChangeLog  |  9 +++
 libebl/Makefile.am|  2 +-
 libebl/ebl-hooks.h|  4 ---
 libebl/ebl_syscall_abi.c  | 40 -
 libebl/eblopenbackend.c   | 17 -
 libebl/libebl.h   |  8 --
 15 files changed, 25 insertions(+), 230 deletions(-)
 delete mode 100644 backends/i386_syscall.c
 delete mode 100644 backends/ppc_syscall.c
 delete mode 100644 backends/x86_64_syscall.c
 delete mode 100644 libebl/ebl_syscall_abi.c

diff --git a/backends/ChangeLog b/backends/ChangeLog
index ce4c971e..2f632a31 100644
--- a/backends/ChangeLog
+++ b/backends/ChangeLog
@@ -1,3 +1,15 @@
+2020-10-19  Mark Wielard  
+
+   * Makefile.am (i386_SRCS): Remove i386_syscall.c.
+   (x86_64_SRCS): Remove x86_64_syscall.c.
+   (ppc_SRCS): Remove ppc_syscall.c.
+   * i386_init.c (i386_init): Remove syscall_abi HOOK.
+   * i386_syscall.c: Delete.
+   * ppc64_init.c (ppc64_init): Remove syscall_abi HOOK.
+   * ppc_syscall.c: Delete.
+   * x86_64_init.c (x86_64_init): Remove syscall_abi HOOK.
+   * x86_64_syscall.c: Delete.
+
 2020-08-28  Mark Wielard  
 
* aarch64_init.c (aarch64_init): Hook dynamic_tag_name and
diff --git a/backends/Makefile.am b/backends/Makefile.am
index f4052125..3849f457 100644
--- a/backends/Makefile.am
+++ b/backends/Makefile.am
@@ -40,13 +40,13 @@ modules = i386 sh x86_64 ia64 alpha arm aarch64 sparc ppc 
ppc64 s390 \
  tilegx m68k bpf riscv csky
 
 i386_SRCS = i386_init.c i386_symbol.c i386_corenote.c i386_cfi.c \
-   i386_retval.c i386_regs.c i386_auxv.c i386_syscall.c \
+   i386_retval.c i386_regs.c i386_auxv.c \
i386_initreg.c i386_unwind.c
 
 sh_SRCS = sh_init.c sh_symbol.c sh_corenote.c sh_regs.c sh_retval.c
 
 x86_64_SRCS = x86_64_init.c x86_64_symbol.c x86_64_corenote.c x86_64_cfi.c \
- x86_64_retval.c x86_64_regs.c x86_64_syscall.c x86_64_initreg.c \
+ x86_64_retval.c x86_64_regs.c x86_64_initreg.c \
  x86_64_unwind.c x32_corenote.c
 
 
@@ -67,7 +67,7 @@ sparc_SRCS = sparc_init.c sparc_symbol.c sparc_regs.c 
sparc_retval.c \
  sparc_cfi.c sparc_initreg.c
 
 ppc_SRCS = ppc_init.c ppc_symbol.c ppc_retval.c ppc_regs.c \
-  ppc_corenote.c ppc_auxv.c ppc_attrs.c ppc_syscall.c \
+  ppc_corenote.c ppc_auxv.c ppc_attrs.c \
   ppc_cfi.c ppc_initreg.c
 
 ppc64_SRCS = ppc64_init.c ppc64_symbol.c ppc64_retval.c ppc64_corenote.c \
diff --git a/backends/i386_init.c b/backends/i386_init.c
index 3f6b9ed1..579e5fad 100644
--- a/backends/i386_init.c
+++ b/backends/i386_init.c
@@ -52,7 +52,6 @@ i386_init (Elf *elf __attribute__ ((unused)),
   HOOK (eh, debugscn_p);
   HOOK (eh, return_value_location);
   HOOK (eh, register_info);
-  HOOK (eh, syscall_abi);
   HOOK (eh, auxv_info);
   HOOK (eh, disasm);
   HOOK (eh, abi_cfi);
diff --git a/backends/i386_syscall.c b/backends/i386_syscall.c
deleted file mode 100644
index 535dcd86..
--- a/backends/i386_syscall.c
+++ /dev/null
@@ -1,50 +0,0 @@
-/* Linux/i386 system call ABI in DWARF register numbers.
-   Copyright (C) 2008 Red Hat, Inc.
-   This file is part of elfutils.
-
-   This file is free software; you can redistribute it and/or modify
-   it under the terms of either
-
- * the GNU Lesser General Public License as published by the Free
-   Software Foundation; either version 3 of the License, or (at
-   your option) any later version
-
-   or
-
- * the GNU General Public License as published by the Free
-   Software Foundation; either version 2 of the License, or (at
-   your option) any later version
-
-   or both in parallel, as here.
-
-   elfutils is distributed in the hope that it will be useful, but
-   WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   General Public License for more details.
-
-   You should have received copies of the GNU General Public License and
-   the GNU Lesser General Public License along with this program.  If
-   not, see .  */
-
-#ifdef HAVE_CONFIG_H
-# include 
-#endif
-
-#define BACKEND i386_
-#include "libebl_CPU.h"
-
-int
-i386_syscall_abi (Ebl *ebl __attribute__ 

[PATCH] backends: Remove tilegx backend.

2020-10-19 Thread Mark Wielaard
Support for the Tilera TILE-Gx processor has been removed or deprecated
in gcc and binutils already. There are no users and there is no way to
test it.

Signed-off-by: Mark Wielaard 
---
 backends/ChangeLog |  12 +++
 backends/Makefile.am   |   7 +-
 backends/tilegx_corenote.c |  64 ---
 backends/tilegx_init.c |  53 -
 backends/tilegx_regs.c | 129 ---
 backends/tilegx_reloc.def  | 121 -
 backends/tilegx_retval.c   | 154 -
 backends/tilegx_symbol.c   |  58 --
 libebl/ChangeLog   |   5 ++
 libebl/eblopenbackend.c|   3 +-
 tests/ChangeLog|   6 ++
 tests/Makefile.am  |   2 +-
 tests/run-allregs.sh   |  69 -
 tests/testfile60.bz2   | Bin 2974 -> 0 bytes
 14 files changed, 27 insertions(+), 656 deletions(-)
 delete mode 100644 backends/tilegx_corenote.c
 delete mode 100644 backends/tilegx_init.c
 delete mode 100644 backends/tilegx_regs.c
 delete mode 100644 backends/tilegx_reloc.def
 delete mode 100644 backends/tilegx_retval.c
 delete mode 100644 backends/tilegx_symbol.c
 delete mode 100755 tests/testfile60.bz2

diff --git a/backends/ChangeLog b/backends/ChangeLog
index 2f632a31..81d4127c 100644
--- a/backends/ChangeLog
+++ b/backends/ChangeLog
@@ -1,3 +1,15 @@
+2020-10-19  Mark Wielard  
+
+   * Makefile.am (modules): Remove tilegx.
+   (tilegx_SRCS): Removed.
+   (libebl_backends_a_SOURCES): Remove tilegx_SRCS.
+   * tilegx_corenote.c: Removed.
+   * tilegx_init.c: Removed.
+   * tilegx_regs.c: Removed.
+   * tilegx_reloc.def: Removed.
+   * tilegx_retval.c: Removed.
+   * tilegx_symbol.c: Removed.
+
 2020-10-19  Mark Wielard  
 
* Makefile.am (i386_SRCS): Remove i386_syscall.c.
diff --git a/backends/Makefile.am b/backends/Makefile.am
index 3849f457..62916c9c 100644
--- a/backends/Makefile.am
+++ b/backends/Makefile.am
@@ -37,7 +37,7 @@ AM_CPPFLAGS += -I$(top_srcdir)/libebl -I$(top_srcdir)/libasm \
 noinst_LIBRARIES = libebl_backends.a libebl_backends_pic.a
 
 modules = i386 sh x86_64 ia64 alpha arm aarch64 sparc ppc ppc64 s390 \
- tilegx m68k bpf riscv csky
+ m68k bpf riscv csky
 
 i386_SRCS = i386_init.c i386_symbol.c i386_corenote.c i386_cfi.c \
i386_retval.c i386_regs.c i386_auxv.c \
@@ -77,9 +77,6 @@ s390_SRCS = s390_init.c s390_symbol.c s390_regs.c 
s390_retval.c \
s390_corenote.c s390x_corenote.c s390_cfi.c s390_initreg.c \
s390_unwind.c
 
-tilegx_SRCS = tilegx_init.c tilegx_symbol.c tilegx_regs.c \
-  tilegx_retval.c tilegx_corenote.c
-
 m68k_SRCS = m68k_init.c m68k_symbol.c m68k_regs.c \
m68k_retval.c m68k_corenote.c m68k_cfi.c m68k_initreg.c
 
@@ -101,7 +98,7 @@ csky_SRCS = csky_attrs.c csky_init.c csky_symbol.c 
csky_cfi.c \
 libebl_backends_a_SOURCES = $(i386_SRCS) $(sh_SRCS) $(x86_64_SRCS) \
$(ia64_SRCS) $(alpha_SRCS) $(arm_SRCS) \
$(aarch64_SRCS) $(sparc_SRCS) $(ppc_SRCS) \
-   $(ppc64_SRCS) $(s390_SRCS) $(tilegx_SRCS) \
+   $(ppc64_SRCS) $(s390_SRCS) \
$(m68k_SRCS) $(bpf_SRCS) $(riscv_SRCS) $(csky_SRCS)
 
 libebl_backends_pic_a_SOURCES =
diff --git a/backends/tilegx_corenote.c b/backends/tilegx_corenote.c
deleted file mode 100644
index be3e7dbf..
--- a/backends/tilegx_corenote.c
+++ /dev/null
@@ -1,64 +0,0 @@
-/* TILE-Gx specific core note handling.
-   Copyright (C) 2012 Tilera Corporation
-   This file is part of elfutils.
-
-   This file is free software; you can redistribute it and/or modify
-   it under the terms of either
-
- * the GNU Lesser General Public License as published by the Free
-   Software Foundation; either version 3 of the License, or (at
-   your option) any later version
-
-   or
-
- * the GNU General Public License as published by the Free
-   Software Foundation; either version 2 of the License, or (at
-   your option) any later version
-
-   or both in parallel, as here.
-
-   elfutils is distributed in the hope that it will be useful, but
-   WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   General Public License for more details.
-
-   You should have received copies of the GNU General Public License and
-   the GNU Lesser General Public License along with this program.  If
-   not, see .  */
-
-
-#ifdef HAVE_CONFIG_H
-# include 
-#endif
-
-#include 
-#include 
-#include 
-#include 
-#include 
-
-#define BACKENDtilegx_
-#include "libebl_CPU.h"
-
-static const Ebl_Register_Location prstatus_regs[] =
-  {
-{ .offset = 0, .regno = 0, .count = 56, .bits = 64 }, /* r0-r55 */
-{ .offset = 56 * 8, .regno = 64, .count = 1, .bits = 64 } /* pc */
-  };
-#define PRSTATUS_R

[PATCH] libdw: dwarf_frame_register takes an array of at least 3 Dwarf_Ops

2020-10-19 Thread Mark Wielaard
GCC11 will warn about a mismatch in the declaration of dwarf_frame_register:

dwarf_frame_register.c:37:61: error: argument 3 of type ‘Dwarf_Op *’
  declared as a pointer [-Werror=array-parameter=]
   37 | dwarf_frame_register (Dwarf_Frame *fs, int regno, Dwarf_Op *ops_mem,
  |   ~~^~~
libdw.h:1068:43: note: previously declared as an array ‘Dwarf_Op[3]’
 1068 |  Dwarf_Op ops_mem[3],
  |  ~^~

When fixing that it will show an actual bug in the addrcfi testcase:

addrcfi.c:98:16: error: ‘dwarf_frame_register’ accessing 96 bytes in a
  region of size 64 [-Werror=stringop-overflow=]
   98 |   int result = dwarf_frame_register (stuff->frame, regno, ops_mem, 
&ops, &nops);
  |
^~~~
addrcfi.c:98:16: note: referencing argument 3 of type ‘Dwarf_Op *’
 1069 | extern int dwarf_frame_register (Dwarf_Frame *frame, int regno,
  |^~~~

Fix the declaration, fix the bug and add an extra comment to the description
in libdw.h.

Signed-off-by: Mark Wielaard 
---
 libdw/dwarf_frame_register.c | 2 +-
 libdw/libdw.h| 8 +---
 tests/addrcfi.c  | 2 +-
 3 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/libdw/dwarf_frame_register.c b/libdw/dwarf_frame_register.c
index d0159fb8..bcf3fa03 100644
--- a/libdw/dwarf_frame_register.c
+++ b/libdw/dwarf_frame_register.c
@@ -34,7 +34,7 @@
 #include 
 
 int
-dwarf_frame_register (Dwarf_Frame *fs, int regno, Dwarf_Op *ops_mem,
+dwarf_frame_register (Dwarf_Frame *fs, int regno, Dwarf_Op ops_mem[3],
  Dwarf_Op **ops, size_t *nops)
 {
   /* Maybe there was a previous error.  */
diff --git a/libdw/libdw.h b/libdw/libdw.h
index 1a4e15a1..ad4fa6ea 100644
--- a/libdw/libdw.h
+++ b/libdw/libdw.h
@@ -1061,9 +1061,11 @@ extern int dwarf_frame_cfa (Dwarf_Frame *frame, Dwarf_Op 
**ops, size_t *nops)
caller's REGNO is "same_value", i.e. this frame did not change it;
ask the caller frame where to find it.
 
-   For common simple expressions *OPS is OPS_MEM.  For arbitrary DWARF
-   expressions in the CFI, *OPS is an internal pointer that can be used as
-   long as the Dwarf_CFI used to create FRAME remains alive.  */
+   For common simple expressions *OPS is OPS_MEM (which is a caller
+   owned array for for at least 3 Dwarf_Ops).  For arbitrary DWARF
+   expressions in the CFI, *OPS is an internal pointer that can be
+   used as long as the Dwarf_CFI used to create FRAME remains
+   alive.  */
 extern int dwarf_frame_register (Dwarf_Frame *frame, int regno,
 Dwarf_Op ops_mem[3],
 Dwarf_Op **ops, size_t *nops)
diff --git a/tests/addrcfi.c b/tests/addrcfi.c
index 589b8513..2b7d7bd0 100644
--- a/tests/addrcfi.c
+++ b/tests/addrcfi.c
@@ -92,7 +92,7 @@ print_register (void *arg,
 
   printf ("\t%s reg%u (%s%s): ", setname, regno, prefix, regname);
 
-  Dwarf_Op ops_mem[2];
+  Dwarf_Op ops_mem[3];
   Dwarf_Op *ops;
   size_t nops;
   int result = dwarf_frame_register (stuff->frame, regno, ops_mem, &ops, 
&nops);
-- 
2.18.4



[PATCH v2] libdw: dwarf_frame_register takes an array of at least 3 Dwarf_Ops

2020-10-19 Thread Mark Wielaard
Forgot the ChangeLog entries in the first version.

GCC11 will warn about a mismatch in the declaration of dwarf_frame_register:

dwarf_frame_register.c:37:61: error: argument 3 of type ‘Dwarf_Op *’
  declared as a pointer [-Werror=array-parameter=]
   37 | dwarf_frame_register (Dwarf_Frame *fs, int regno, Dwarf_Op *ops_mem,
  |   ~~^~~
libdw.h:1068:43: note: previously declared as an array ‘Dwarf_Op[3]’
 1068 |  Dwarf_Op ops_mem[3],
  |  ~^~

When fixing that it will show an actual bug in the addrcfi testcase:

addrcfi.c:98:16: error: ‘dwarf_frame_register’ accessing 96 bytes in a
  region of size 64 [-Werror=stringop-overflow=]
   98 |   int result = dwarf_frame_register (stuff->frame, regno, ops_mem, 
&ops, &nops);
  |
^~~~
addrcfi.c:98:16: note: referencing argument 3 of type ‘Dwarf_Op *’
 1069 | extern int dwarf_frame_register (Dwarf_Frame *frame, int regno,
  |^~~~

Fix the declaration, fix the bug and add an extra comment to the description
in libdw.h.

Signed-off-by: Mark Wielaard 
---
 libdw/ChangeLog  | 7 +++
 libdw/dwarf_frame_register.c | 2 +-
 libdw/libdw.h| 8 +---
 tests/ChangeLog  | 4 
 tests/addrcfi.c  | 2 +-
 5 files changed, 18 insertions(+), 5 deletions(-)

diff --git a/libdw/ChangeLog b/libdw/ChangeLog
index 8b0b583a..a6d2b1de 100644
--- a/libdw/ChangeLog
+++ b/libdw/ChangeLog
@@ -1,3 +1,10 @@
+2020-10-19  Mark Wielaard  
+
+   * dwarf_frame_register.c (dwarf_frame_register): Declare ops_mem
+   as array of (at least) 3 elements.
+   * libdw.h (dwarf_frame_register): Add extra explanation of ops_mem
+   argument.
+
 2020-09-03  Mark Wielaard  
 
* dwarf.h: Add DW_CFA_AARCH64_negate_ra_state.
diff --git a/libdw/dwarf_frame_register.c b/libdw/dwarf_frame_register.c
index d0159fb8..bcf3fa03 100644
--- a/libdw/dwarf_frame_register.c
+++ b/libdw/dwarf_frame_register.c
@@ -34,7 +34,7 @@
 #include 
 
 int
-dwarf_frame_register (Dwarf_Frame *fs, int regno, Dwarf_Op *ops_mem,
+dwarf_frame_register (Dwarf_Frame *fs, int regno, Dwarf_Op ops_mem[3],
  Dwarf_Op **ops, size_t *nops)
 {
   /* Maybe there was a previous error.  */
diff --git a/libdw/libdw.h b/libdw/libdw.h
index 1a4e15a1..ad4fa6ea 100644
--- a/libdw/libdw.h
+++ b/libdw/libdw.h
@@ -1061,9 +1061,11 @@ extern int dwarf_frame_cfa (Dwarf_Frame *frame, Dwarf_Op 
**ops, size_t *nops)
caller's REGNO is "same_value", i.e. this frame did not change it;
ask the caller frame where to find it.
 
-   For common simple expressions *OPS is OPS_MEM.  For arbitrary DWARF
-   expressions in the CFI, *OPS is an internal pointer that can be used as
-   long as the Dwarf_CFI used to create FRAME remains alive.  */
+   For common simple expressions *OPS is OPS_MEM (which is a caller
+   owned array for for at least 3 Dwarf_Ops).  For arbitrary DWARF
+   expressions in the CFI, *OPS is an internal pointer that can be
+   used as long as the Dwarf_CFI used to create FRAME remains
+   alive.  */
 extern int dwarf_frame_register (Dwarf_Frame *frame, int regno,
 Dwarf_Op ops_mem[3],
 Dwarf_Op **ops, size_t *nops)
diff --git a/tests/ChangeLog b/tests/ChangeLog
index 9d8994c3..7fc7044b 100644
--- a/tests/ChangeLog
+++ b/tests/ChangeLog
@@ -1,3 +1,7 @@
+2020-10-19  Mark Wielaard  
+
+   * addrcfi.c (print_register): Make ops_mem 3 elements.
+
 2020-10-19  Mark Wielaard  
 
* testfile60.bz2: Removed.
diff --git a/tests/addrcfi.c b/tests/addrcfi.c
index 589b8513..2b7d7bd0 100644
--- a/tests/addrcfi.c
+++ b/tests/addrcfi.c
@@ -92,7 +92,7 @@ print_register (void *arg,
 
   printf ("\t%s reg%u (%s%s): ", setname, regno, prefix, regname);
 
-  Dwarf_Op ops_mem[2];
+  Dwarf_Op ops_mem[3];
   Dwarf_Op *ops;
   size_t nops;
   int result = dwarf_frame_register (stuff->frame, regno, ops_mem, &ops, 
&nops);
-- 
2.18.4



[Bug debuginfod/26756] New: some more operational metrics

2020-10-19 Thread fche at redhat dot com via Elfutils-devel
https://sourceware.org/bugzilla/show_bug.cgi?id=26756

Bug ID: 26756
   Summary: some more operational metrics
   Product: elfutils
   Version: unspecified
Status: NEW
  Severity: normal
  Priority: P2
 Component: debuginfod
  Assignee: unassigned at sourceware dot org
  Reporter: fche at redhat dot com
CC: elfutils-devel at sourceware dot org
  Target Milestone: ---

debuginfod should make it easier to detect errors than just logfile scraping,
e.g. when an -ENOSPC condition occurs.  We should start exporting error
counters to prometheus.  This could be pretty simple, if e.g. associated with
the creation of a libc_exception object.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

[Bug debuginfod/26756] some more operational metrics

2020-10-19 Thread fche at redhat dot com via Elfutils-devel
https://sourceware.org/bugzilla/show_bug.cgi?id=26756

--- Comment #1 from Frank Ch. Eigler  ---
also: the fdcache population/activity should be instrumented

-- 
You are receiving this mail because:
You are on the CC list for the bug.