]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
libebl: Remove unused ebl_syscall_abi.
authorMark Wielaard <mark@klomp.org>
Sat, 17 Oct 2020 19:22:22 +0000 (21:22 +0200)
committerMark Wielaard <mark@klomp.org>
Mon, 26 Oct 2020 21:44:07 +0000 (22:44 +0100)
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 <mark@klomp.org>
15 files changed:
backends/ChangeLog
backends/Makefile.am
backends/i386_init.c
backends/i386_syscall.c [deleted file]
backends/ppc64_init.c
backends/ppc_init.c
backends/ppc_syscall.c [deleted file]
backends/x86_64_init.c
backends/x86_64_syscall.c [deleted file]
libebl/ChangeLog
libebl/Makefile.am
libebl/ebl-hooks.h
libebl/ebl_syscall_abi.c [deleted file]
libebl/eblopenbackend.c
libebl/libebl.h

index ce4c971e5d1fbe748c7bd9a7b473a4d6ec7a5e05..2f632a31d39bfde202ea02016e1fc30ec24f7487 100644 (file)
@@ -1,3 +1,15 @@
+2020-10-19  Mark Wielard  <mark@klomp.org>
+
+       * 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  <mark@klomp.org>
 
        * aarch64_init.c (aarch64_init): Hook dynamic_tag_name and
index f4052125bdacd21a9a5dcc58779112417df8a204..3849f45716be6c373e5370465290d73a3bca5dc4 100644 (file)
@@ -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 \
index 3f6b9ed19b41523417c74bdd34e87c3b80deff59..579e5fadcb08a60c03d2d04b9a18bfc64f1eab49 100644 (file)
@@ -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 (file)
index 535dcd8..0000000
+++ /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 <http://www.gnu.org/licenses/>.  */
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-#define BACKEND i386_
-#include "libebl_CPU.h"
-
-int
-i386_syscall_abi (Ebl *ebl __attribute__ ((unused)),
-                 int *sp, int *pc, int *callno, int args[6])
-{
-  *sp = 4;                     /* %esp */
-  *pc = 8;                     /* %eip */
-  *callno = 0;                 /* %eax */
-  args[0] = 3;                 /* %ebx */
-  args[1] = 1;                 /* %ecx */
-  args[2] = 2;                 /* %edx */
-  args[3] = 6;                 /* %esi */
-  args[4] = 7;                 /* %edi */
-  args[5] = 5;                 /* %ebp */
-  return 0;
-}
index f509aef6244156e2d9b82b8d8f081a82d8b4e296..ffc9842cc084fc19ef1f9989cdc365cb16a4cda6 100644 (file)
@@ -58,7 +58,6 @@ ppc64_init (Elf *elf __attribute__ ((unused)),
   HOOK (eh, bss_plt_p);
   HOOK (eh, return_value_location);
   HOOK (eh, register_info);
-  HOOK (eh, syscall_abi);
   HOOK (eh, core_note);
   HOOK (eh, auxv_info);
   HOOK (eh, check_object_attribute);
index ac440ab21537a56d90cc69def2b4d78f2fe85d99..08468f8ffb96c2a03905c8c50c907fb7df1753b6 100644 (file)
@@ -54,7 +54,6 @@ ppc_init (Elf *elf __attribute__ ((unused)),
   HOOK (eh, bss_plt_p);
   HOOK (eh, return_value_location);
   HOOK (eh, register_info);
-  HOOK (eh, syscall_abi);
   HOOK (eh, core_note);
   HOOK (eh, auxv_info);
   HOOK (eh, check_object_attribute);
diff --git a/backends/ppc_syscall.c b/backends/ppc_syscall.c
deleted file mode 100644 (file)
index b1b9c52..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-/* Linux/PPC 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 <http://www.gnu.org/licenses/>.  */
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-#define BACKEND ppc_
-#include "libebl_CPU.h"
-
-int
-ppc_syscall_abi (Ebl *ebl __attribute__ ((unused)),
-                int *sp, int *pc, int *callno, int args[6])
-{
-  *sp = 1;
-  *pc = -1;
-  *callno = 0;
-  args[0] = 3;
-  args[1] = 4;
-  args[2] = 5;
-  args[3] = 6;
-  args[4] = 7;
-  args[5] = 8;
-  return 0;
-}
-
-__typeof (ppc_syscall_abi)
-ppc64_syscall_abi __attribute__ ((alias ("ppc_syscall_abi")));
index 44c1ad2881085c3fb1f996afe961ea6cd9c2839e..8db9b643852b809b4f9b05d060eb1d5481ebeec5 100644 (file)
@@ -56,7 +56,6 @@ x86_64_init (Elf *elf __attribute__ ((unused)),
     HOOK (eh, core_note);
   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/x86_64_syscall.c b/backends/x86_64_syscall.c
deleted file mode 100644 (file)
index 0deb8ba..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-/* Linux/x86-64 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 <http://www.gnu.org/licenses/>.  */
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-#define BACKEND x86_64_
-#include "libebl_CPU.h"
-
-int
-x86_64_syscall_abi (Ebl *ebl __attribute__ ((unused)),
-                   int *sp, int *pc, int *callno, int args[6])
-{
-  *sp = 7;                     /* %rsp */
-  *pc = 16;                    /* %rip */
-  *callno = 0;                 /* %rax */
-  args[0] = 5;                 /* %rdi */
-  args[1] = 4;                 /* %rsi */
-  args[2] = 1;                 /* %rdx */
-  args[3] = 10;                        /* %r10 */
-  args[4] = 8;                 /* %r8 */
-  args[5] = 9;                 /* %r9 */
-  return 0;
-}
index aa43b31f32fa3c77c9f2fb42bbad4f599caf14eb..dbf4b3b78dcbf194d1fcdbcb22f28156afeeff24 100644 (file)
@@ -1,3 +1,12 @@
+2020-10-19  Mark Wielaard  <mark@klomp.org>
+
+       * Makefile.am (libebl_a_SOURCES): Remove ebl_syscall_abi.c.
+       * ebl-hooks.h (syscall_abi): Remove.
+       * ebl_syscall_abi.c: Delete.
+       * eblopenbackend.c (default_syscall_abi): Remove.
+       (fill_defaults): Remove syscall_abi assignment.
+       * libebl.h (ebl_syscall_abi): Remove.
+
 2020-09-03  Mark Wielaard  <mark@klomp.org>
 
        * eblobjnote.c (ebl_object_note): For EM_AARCH64 handle BTI and PAC
index d0d475b838f184aa285bad4c28a5fe217033a41f..d84e7ee2cb39c218ffec024e699d56df9e9258b2 100644 (file)
@@ -51,7 +51,7 @@ libebl_a_SOURCES = eblopenbackend.c eblclosebackend.c eblreloctypename.c \
                   eblbsspltp.c eblretval.c eblreginfo.c eblnonerelocp.c \
                   eblrelativerelocp.c eblsysvhashentrysize.c eblauxvinfo.c \
                   eblcheckobjattr.c ebl_check_special_section.c \
-                  ebl_syscall_abi.c eblabicfi.c eblstother.c eblinitreg.c \
+                  eblabicfi.c eblstother.c eblinitreg.c \
                   ebldwarftoregno.c eblnormalizepc.c eblunwind.c \
                   eblresolvesym.c eblcheckreloctargettype.c \
                   ebl_data_marker_symbol.c
index 1e7960b8964ce9dbeeb06dfa32d314593fb54e4e..1214bb84430956011f197733ab20c595a845cf72 100644 (file)
@@ -142,10 +142,6 @@ ssize_t EBLHOOK(register_info) (Ebl *ebl,
                                const char **prefix, const char **setname,
                                int *bits, int *type);
 
-/* Return system call ABI registers.  */
-int EBLHOOK(syscall_abi) (Ebl *ebl, int *sp, int *pc,
-                         int *callno, int args[6]);
-
 /* Disassembler function.  */
 int EBLHOOK(disasm) (Ebl *ebl, const uint8_t **startp, const uint8_t *end,
                     GElf_Addr addr, const char *fmt, DisasmOutputCB_t outcb,
diff --git a/libebl/ebl_syscall_abi.c b/libebl/ebl_syscall_abi.c
deleted file mode 100644 (file)
index a25369d..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-/* Return system call ABI mapped to 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 <http://www.gnu.org/licenses/>.  */
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-#include <libeblP.h>
-
-
-int
-ebl_syscall_abi (Ebl *ebl, int *sp, int *pc, int *callno, int *args)
-{
-  return ebl != NULL ? ebl->syscall_abi (ebl, sp, pc, callno, args) : -1;
-}
index b3b6fc01a18b539a175f585043873e05a7798bbb..90a83f26f2125a180d2de9005417b994e3d46a53 100644 (file)
@@ -214,8 +214,6 @@ static ssize_t default_register_info (Ebl *ebl,
                                      const char **prefix,
                                      const char **setname,
                                      int *bits, int *type);
-static int default_syscall_abi (Ebl *ebl, int *sp, int *pc,
-                               int *callno, int args[6]);
 static bool default_check_object_attribute (Ebl *ebl, const char *vendor,
                                            int tag, uint64_t value,
                                            const char **tag_name,
@@ -259,7 +257,6 @@ fill_defaults (Ebl *result)
   result->bss_plt_p = default_bss_plt_p;
   result->return_value_location = default_return_value_location;
   result->register_info = default_register_info;
-  result->syscall_abi = default_syscall_abi;
   result->check_object_attribute = default_check_object_attribute;
   result->check_reloc_target_type = default_check_reloc_target_type;
   result->disasm = NULL;
@@ -690,20 +687,6 @@ default_register_info (Ebl *ebl __attribute__ ((unused)),
   return snprintf (name, namelen, "reg%d", regno);
 }
 
-static int
-default_syscall_abi (Ebl *ebl __attribute__ ((unused)),
-                    int *sp, int *pc, int *callno, int args[6])
-{
-  *sp = *pc = *callno = -1;
-  args[0] = -1;
-  args[1] = -1;
-  args[2] = -1;
-  args[3] = -1;
-  args[4] = -1;
-  args[5] = -1;
-  return -1;
-}
-
 static bool
 default_check_object_attribute (Ebl *ebl __attribute__ ((unused)),
                                const char *vendor  __attribute__ ((unused)),
index 23c0e95018af849603ee6f87be4d1ff3c89ca3f4..731001d30b7816118d0112a5ba25687cb279de04 100644 (file)
@@ -241,14 +241,6 @@ extern ssize_t ebl_register_info (Ebl *ebl,
                                  const char **prefix, const char **setname,
                                  int *bits, int *type);
 
-/* Fill in the DWARF register numbers for the registers used in system calls.
-   The SP and PC are what kernel reports call the user stack pointer and PC.
-   The CALLNO and ARGS are the system call number and incoming arguments.
-   Each of these is filled with the DWARF register number corresponding,
-   or -1 if there is none.  Returns zero when the information is available.  */
-extern int ebl_syscall_abi (Ebl *ebl, int *sp, int *pc,
-                           int *callno, int args[6]);
-
 /* Supply the ABI-specified state of DWARF CFI before CIE initial programs.
 
    The DWARF 3.0 spec says that the default initial states of all registers