|
DistroBaker |
4cf2c4 |
commit 09b034419ef16cf39abcd7a2df9d0fe704176d13
|
|
DistroBaker |
4cf2c4 |
Author: Mark Wielaard <mark@klomp.org>
|
|
DistroBaker |
4cf2c4 |
Date: Sat Oct 17 21:22:22 2020 +0200
|
|
DistroBaker |
4cf2c4 |
|
|
DistroBaker |
4cf2c4 |
libebl: Remove unused ebl_syscall_abi.
|
|
DistroBaker |
4cf2c4 |
|
|
DistroBaker |
4cf2c4 |
GCC11 -Warray-parameter warned about ebl_syscall_abi being inconsistently
|
|
DistroBaker |
4cf2c4 |
declared (once with a pointer to int, once with an array of 6 int elements).
|
|
DistroBaker |
4cf2c4 |
Since ebl_syscall_abi isn't actually used and was only implemented for
|
|
DistroBaker |
4cf2c4 |
3 backends without any tests just remove it.
|
|
DistroBaker |
4cf2c4 |
|
|
DistroBaker |
4cf2c4 |
Signed-off-by: Mark Wielaard <mark@klomp.org>
|
|
DistroBaker |
4cf2c4 |
|
|
DistroBaker |
4cf2c4 |
diff --git a/backends/Makefile.am b/backends/Makefile.am
|
|
DistroBaker |
4cf2c4 |
index f4052125..3849f457 100644
|
|
DistroBaker |
4cf2c4 |
--- a/backends/Makefile.am
|
|
DistroBaker |
4cf2c4 |
+++ b/backends/Makefile.am
|
|
DistroBaker |
4cf2c4 |
@@ -40,13 +40,13 @@ modules = i386 sh x86_64 ia64 alpha arm aarch64 sparc ppc ppc64 s390 \
|
|
DistroBaker |
4cf2c4 |
tilegx m68k bpf riscv csky
|
|
DistroBaker |
4cf2c4 |
|
|
DistroBaker |
4cf2c4 |
i386_SRCS = i386_init.c i386_symbol.c i386_corenote.c i386_cfi.c \
|
|
DistroBaker |
4cf2c4 |
- i386_retval.c i386_regs.c i386_auxv.c i386_syscall.c \
|
|
DistroBaker |
4cf2c4 |
+ i386_retval.c i386_regs.c i386_auxv.c \
|
|
DistroBaker |
4cf2c4 |
i386_initreg.c i386_unwind.c
|
|
DistroBaker |
4cf2c4 |
|
|
DistroBaker |
4cf2c4 |
sh_SRCS = sh_init.c sh_symbol.c sh_corenote.c sh_regs.c sh_retval.c
|
|
DistroBaker |
4cf2c4 |
|
|
DistroBaker |
4cf2c4 |
x86_64_SRCS = x86_64_init.c x86_64_symbol.c x86_64_corenote.c x86_64_cfi.c \
|
|
DistroBaker |
4cf2c4 |
- x86_64_retval.c x86_64_regs.c x86_64_syscall.c x86_64_initreg.c \
|
|
DistroBaker |
4cf2c4 |
+ x86_64_retval.c x86_64_regs.c x86_64_initreg.c \
|
|
DistroBaker |
4cf2c4 |
x86_64_unwind.c x32_corenote.c
|
|
DistroBaker |
4cf2c4 |
|
|
DistroBaker |
4cf2c4 |
|
|
DistroBaker |
4cf2c4 |
@@ -67,7 +67,7 @@ sparc_SRCS = sparc_init.c sparc_symbol.c sparc_regs.c sparc_retval.c \
|
|
DistroBaker |
4cf2c4 |
sparc_cfi.c sparc_initreg.c
|
|
DistroBaker |
4cf2c4 |
|
|
DistroBaker |
4cf2c4 |
ppc_SRCS = ppc_init.c ppc_symbol.c ppc_retval.c ppc_regs.c \
|
|
DistroBaker |
4cf2c4 |
- ppc_corenote.c ppc_auxv.c ppc_attrs.c ppc_syscall.c \
|
|
DistroBaker |
4cf2c4 |
+ ppc_corenote.c ppc_auxv.c ppc_attrs.c \
|
|
DistroBaker |
4cf2c4 |
ppc_cfi.c ppc_initreg.c
|
|
DistroBaker |
4cf2c4 |
|
|
DistroBaker |
4cf2c4 |
ppc64_SRCS = ppc64_init.c ppc64_symbol.c ppc64_retval.c ppc64_corenote.c \
|
|
DistroBaker |
4cf2c4 |
diff --git a/backends/i386_init.c b/backends/i386_init.c
|
|
DistroBaker |
4cf2c4 |
index 3f6b9ed1..579e5fad 100644
|
|
DistroBaker |
4cf2c4 |
--- a/backends/i386_init.c
|
|
DistroBaker |
4cf2c4 |
+++ b/backends/i386_init.c
|
|
DistroBaker |
4cf2c4 |
@@ -52,7 +52,6 @@ i386_init (Elf *elf __attribute__ ((unused)),
|
|
DistroBaker |
4cf2c4 |
HOOK (eh, debugscn_p);
|
|
DistroBaker |
4cf2c4 |
HOOK (eh, return_value_location);
|
|
DistroBaker |
4cf2c4 |
HOOK (eh, register_info);
|
|
DistroBaker |
4cf2c4 |
- HOOK (eh, syscall_abi);
|
|
DistroBaker |
4cf2c4 |
HOOK (eh, auxv_info);
|
|
DistroBaker |
4cf2c4 |
HOOK (eh, disasm);
|
|
DistroBaker |
4cf2c4 |
HOOK (eh, abi_cfi);
|
|
DistroBaker |
4cf2c4 |
diff --git a/backends/i386_syscall.c b/backends/i386_syscall.c
|
|
DistroBaker |
4cf2c4 |
deleted file mode 100644
|
|
DistroBaker |
4cf2c4 |
index 535dcd86..00000000
|
|
DistroBaker |
4cf2c4 |
--- a/backends/i386_syscall.c
|
|
DistroBaker |
4cf2c4 |
+++ /dev/null
|
|
DistroBaker |
4cf2c4 |
@@ -1,50 +0,0 @@
|
|
DistroBaker |
4cf2c4 |
-/* Linux/i386 system call ABI in DWARF register numbers.
|
|
DistroBaker |
4cf2c4 |
- Copyright (C) 2008 Red Hat, Inc.
|
|
DistroBaker |
4cf2c4 |
- This file is part of elfutils.
|
|
DistroBaker |
4cf2c4 |
-
|
|
DistroBaker |
4cf2c4 |
- This file is free software; you can redistribute it and/or modify
|
|
DistroBaker |
4cf2c4 |
- it under the terms of either
|
|
DistroBaker |
4cf2c4 |
-
|
|
DistroBaker |
4cf2c4 |
- * the GNU Lesser General Public License as published by the Free
|
|
DistroBaker |
4cf2c4 |
- Software Foundation; either version 3 of the License, or (at
|
|
DistroBaker |
4cf2c4 |
- your option) any later version
|
|
DistroBaker |
4cf2c4 |
-
|
|
DistroBaker |
4cf2c4 |
- or
|
|
DistroBaker |
4cf2c4 |
-
|
|
DistroBaker |
4cf2c4 |
- * the GNU General Public License as published by the Free
|
|
DistroBaker |
4cf2c4 |
- Software Foundation; either version 2 of the License, or (at
|
|
DistroBaker |
4cf2c4 |
- your option) any later version
|
|
DistroBaker |
4cf2c4 |
-
|
|
DistroBaker |
4cf2c4 |
- or both in parallel, as here.
|
|
DistroBaker |
4cf2c4 |
-
|
|
DistroBaker |
4cf2c4 |
- elfutils is distributed in the hope that it will be useful, but
|
|
DistroBaker |
4cf2c4 |
- WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
DistroBaker |
4cf2c4 |
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
DistroBaker |
4cf2c4 |
- General Public License for more details.
|
|
DistroBaker |
4cf2c4 |
-
|
|
DistroBaker |
4cf2c4 |
- You should have received copies of the GNU General Public License and
|
|
DistroBaker |
4cf2c4 |
- the GNU Lesser General Public License along with this program. If
|
|
DistroBaker |
4cf2c4 |
- not, see <http://www.gnu.org/licenses/>. */
|
|
DistroBaker |
4cf2c4 |
-
|
|
DistroBaker |
4cf2c4 |
-#ifdef HAVE_CONFIG_H
|
|
DistroBaker |
4cf2c4 |
-# include <config.h>
|
|
DistroBaker |
4cf2c4 |
-#endif
|
|
DistroBaker |
4cf2c4 |
-
|
|
DistroBaker |
4cf2c4 |
-#define BACKEND i386_
|
|
DistroBaker |
4cf2c4 |
-#include "libebl_CPU.h"
|
|
DistroBaker |
4cf2c4 |
-
|
|
DistroBaker |
4cf2c4 |
-int
|
|
DistroBaker |
4cf2c4 |
-i386_syscall_abi (Ebl *ebl __attribute__ ((unused)),
|
|
DistroBaker |
4cf2c4 |
- int *sp, int *pc, int *callno, int args[6])
|
|
DistroBaker |
4cf2c4 |
-{
|
|
DistroBaker |
4cf2c4 |
- *sp = 4; /* %esp */
|
|
DistroBaker |
4cf2c4 |
- *pc = 8; /* %eip */
|
|
DistroBaker |
4cf2c4 |
- *callno = 0; /* %eax */
|
|
DistroBaker |
4cf2c4 |
- args[0] = 3; /* %ebx */
|
|
DistroBaker |
4cf2c4 |
- args[1] = 1; /* %ecx */
|
|
DistroBaker |
4cf2c4 |
- args[2] = 2; /* %edx */
|
|
DistroBaker |
4cf2c4 |
- args[3] = 6; /* %esi */
|
|
DistroBaker |
4cf2c4 |
- args[4] = 7; /* %edi */
|
|
DistroBaker |
4cf2c4 |
- args[5] = 5; /* %ebp */
|
|
DistroBaker |
4cf2c4 |
- return 0;
|
|
DistroBaker |
4cf2c4 |
-}
|
|
DistroBaker |
4cf2c4 |
diff --git a/backends/ppc64_init.c b/backends/ppc64_init.c
|
|
DistroBaker |
4cf2c4 |
index f509aef6..ffc9842c 100644
|
|
DistroBaker |
4cf2c4 |
--- a/backends/ppc64_init.c
|
|
DistroBaker |
4cf2c4 |
+++ b/backends/ppc64_init.c
|
|
DistroBaker |
4cf2c4 |
@@ -58,7 +58,6 @@ ppc64_init (Elf *elf __attribute__ ((unused)),
|
|
DistroBaker |
4cf2c4 |
HOOK (eh, bss_plt_p);
|
|
DistroBaker |
4cf2c4 |
HOOK (eh, return_value_location);
|
|
DistroBaker |
4cf2c4 |
HOOK (eh, register_info);
|
|
DistroBaker |
4cf2c4 |
- HOOK (eh, syscall_abi);
|
|
DistroBaker |
4cf2c4 |
HOOK (eh, core_note);
|
|
DistroBaker |
4cf2c4 |
HOOK (eh, auxv_info);
|
|
DistroBaker |
4cf2c4 |
HOOK (eh, check_object_attribute);
|
|
DistroBaker |
4cf2c4 |
diff --git a/backends/ppc_init.c b/backends/ppc_init.c
|
|
DistroBaker |
4cf2c4 |
index ac440ab2..08468f8f 100644
|
|
DistroBaker |
4cf2c4 |
--- a/backends/ppc_init.c
|
|
DistroBaker |
4cf2c4 |
+++ b/backends/ppc_init.c
|
|
DistroBaker |
4cf2c4 |
@@ -54,7 +54,6 @@ ppc_init (Elf *elf __attribute__ ((unused)),
|
|
DistroBaker |
4cf2c4 |
HOOK (eh, bss_plt_p);
|
|
DistroBaker |
4cf2c4 |
HOOK (eh, return_value_location);
|
|
DistroBaker |
4cf2c4 |
HOOK (eh, register_info);
|
|
DistroBaker |
4cf2c4 |
- HOOK (eh, syscall_abi);
|
|
DistroBaker |
4cf2c4 |
HOOK (eh, core_note);
|
|
DistroBaker |
4cf2c4 |
HOOK (eh, auxv_info);
|
|
DistroBaker |
4cf2c4 |
HOOK (eh, check_object_attribute);
|
|
DistroBaker |
4cf2c4 |
diff --git a/backends/ppc_syscall.c b/backends/ppc_syscall.c
|
|
DistroBaker |
4cf2c4 |
deleted file mode 100644
|
|
DistroBaker |
4cf2c4 |
index b1b9c52b..00000000
|
|
DistroBaker |
4cf2c4 |
--- a/backends/ppc_syscall.c
|
|
DistroBaker |
4cf2c4 |
+++ /dev/null
|
|
DistroBaker |
4cf2c4 |
@@ -1,53 +0,0 @@
|
|
DistroBaker |
4cf2c4 |
-/* Linux/PPC system call ABI in DWARF register numbers.
|
|
DistroBaker |
4cf2c4 |
- Copyright (C) 2008 Red Hat, Inc.
|
|
DistroBaker |
4cf2c4 |
- This file is part of elfutils.
|
|
DistroBaker |
4cf2c4 |
-
|
|
DistroBaker |
4cf2c4 |
- This file is free software; you can redistribute it and/or modify
|
|
DistroBaker |
4cf2c4 |
- it under the terms of either
|
|
DistroBaker |
4cf2c4 |
-
|
|
DistroBaker |
4cf2c4 |
- * the GNU Lesser General Public License as published by the Free
|
|
DistroBaker |
4cf2c4 |
- Software Foundation; either version 3 of the License, or (at
|
|
DistroBaker |
4cf2c4 |
- your option) any later version
|
|
DistroBaker |
4cf2c4 |
-
|
|
DistroBaker |
4cf2c4 |
- or
|
|
DistroBaker |
4cf2c4 |
-
|
|
DistroBaker |
4cf2c4 |
- * the GNU General Public License as published by the Free
|
|
DistroBaker |
4cf2c4 |
- Software Foundation; either version 2 of the License, or (at
|
|
DistroBaker |
4cf2c4 |
- your option) any later version
|
|
DistroBaker |
4cf2c4 |
-
|
|
DistroBaker |
4cf2c4 |
- or both in parallel, as here.
|
|
DistroBaker |
4cf2c4 |
-
|
|
DistroBaker |
4cf2c4 |
- elfutils is distributed in the hope that it will be useful, but
|
|
DistroBaker |
4cf2c4 |
- WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
DistroBaker |
4cf2c4 |
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
DistroBaker |
4cf2c4 |
- General Public License for more details.
|
|
DistroBaker |
4cf2c4 |
-
|
|
DistroBaker |
4cf2c4 |
- You should have received copies of the GNU General Public License and
|
|
DistroBaker |
4cf2c4 |
- the GNU Lesser General Public License along with this program. If
|
|
DistroBaker |
4cf2c4 |
- not, see <http://www.gnu.org/licenses/>. */
|
|
DistroBaker |
4cf2c4 |
-
|
|
DistroBaker |
4cf2c4 |
-#ifdef HAVE_CONFIG_H
|
|
DistroBaker |
4cf2c4 |
-# include <config.h>
|
|
DistroBaker |
4cf2c4 |
-#endif
|
|
DistroBaker |
4cf2c4 |
-
|
|
DistroBaker |
4cf2c4 |
-#define BACKEND ppc_
|
|
DistroBaker |
4cf2c4 |
-#include "libebl_CPU.h"
|
|
DistroBaker |
4cf2c4 |
-
|
|
DistroBaker |
4cf2c4 |
-int
|
|
DistroBaker |
4cf2c4 |
-ppc_syscall_abi (Ebl *ebl __attribute__ ((unused)),
|
|
DistroBaker |
4cf2c4 |
- int *sp, int *pc, int *callno, int args[6])
|
|
DistroBaker |
4cf2c4 |
-{
|
|
DistroBaker |
4cf2c4 |
- *sp = 1;
|
|
DistroBaker |
4cf2c4 |
- *pc = -1;
|
|
DistroBaker |
4cf2c4 |
- *callno = 0;
|
|
DistroBaker |
4cf2c4 |
- args[0] = 3;
|
|
DistroBaker |
4cf2c4 |
- args[1] = 4;
|
|
DistroBaker |
4cf2c4 |
- args[2] = 5;
|
|
DistroBaker |
4cf2c4 |
- args[3] = 6;
|
|
DistroBaker |
4cf2c4 |
- args[4] = 7;
|
|
DistroBaker |
4cf2c4 |
- args[5] = 8;
|
|
DistroBaker |
4cf2c4 |
- return 0;
|
|
DistroBaker |
4cf2c4 |
-}
|
|
DistroBaker |
4cf2c4 |
-
|
|
DistroBaker |
4cf2c4 |
-__typeof (ppc_syscall_abi)
|
|
DistroBaker |
4cf2c4 |
-ppc64_syscall_abi __attribute__ ((alias ("ppc_syscall_abi")));
|
|
DistroBaker |
4cf2c4 |
diff --git a/backends/x86_64_init.c b/backends/x86_64_init.c
|
|
DistroBaker |
4cf2c4 |
index 44c1ad28..8db9b643 100644
|
|
DistroBaker |
4cf2c4 |
--- a/backends/x86_64_init.c
|
|
DistroBaker |
4cf2c4 |
+++ b/backends/x86_64_init.c
|
|
DistroBaker |
4cf2c4 |
@@ -56,7 +56,6 @@ x86_64_init (Elf *elf __attribute__ ((unused)),
|
|
DistroBaker |
4cf2c4 |
HOOK (eh, core_note);
|
|
DistroBaker |
4cf2c4 |
HOOK (eh, return_value_location);
|
|
DistroBaker |
4cf2c4 |
HOOK (eh, register_info);
|
|
DistroBaker |
4cf2c4 |
- HOOK (eh, syscall_abi);
|
|
DistroBaker |
4cf2c4 |
HOOK (eh, auxv_info);
|
|
DistroBaker |
4cf2c4 |
HOOK (eh, disasm);
|
|
DistroBaker |
4cf2c4 |
HOOK (eh, abi_cfi);
|
|
DistroBaker |
4cf2c4 |
diff --git a/backends/x86_64_syscall.c b/backends/x86_64_syscall.c
|
|
DistroBaker |
4cf2c4 |
deleted file mode 100644
|
|
DistroBaker |
4cf2c4 |
index 0deb8bad..00000000
|
|
DistroBaker |
4cf2c4 |
--- a/backends/x86_64_syscall.c
|
|
DistroBaker |
4cf2c4 |
+++ /dev/null
|
|
DistroBaker |
4cf2c4 |
@@ -1,50 +0,0 @@
|
|
DistroBaker |
4cf2c4 |
-/* Linux/x86-64 system call ABI in DWARF register numbers.
|
|
DistroBaker |
4cf2c4 |
- Copyright (C) 2008 Red Hat, Inc.
|
|
DistroBaker |
4cf2c4 |
- This file is part of elfutils.
|
|
DistroBaker |
4cf2c4 |
-
|
|
DistroBaker |
4cf2c4 |
- This file is free software; you can redistribute it and/or modify
|
|
DistroBaker |
4cf2c4 |
- it under the terms of either
|
|
DistroBaker |
4cf2c4 |
-
|
|
DistroBaker |
4cf2c4 |
- * the GNU Lesser General Public License as published by the Free
|
|
DistroBaker |
4cf2c4 |
- Software Foundation; either version 3 of the License, or (at
|
|
DistroBaker |
4cf2c4 |
- your option) any later version
|
|
DistroBaker |
4cf2c4 |
-
|
|
DistroBaker |
4cf2c4 |
- or
|
|
DistroBaker |
4cf2c4 |
-
|
|
DistroBaker |
4cf2c4 |
- * the GNU General Public License as published by the Free
|
|
DistroBaker |
4cf2c4 |
- Software Foundation; either version 2 of the License, or (at
|
|
DistroBaker |
4cf2c4 |
- your option) any later version
|
|
DistroBaker |
4cf2c4 |
-
|
|
DistroBaker |
4cf2c4 |
- or both in parallel, as here.
|
|
DistroBaker |
4cf2c4 |
-
|
|
DistroBaker |
4cf2c4 |
- elfutils is distributed in the hope that it will be useful, but
|
|
DistroBaker |
4cf2c4 |
- WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
DistroBaker |
4cf2c4 |
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
DistroBaker |
4cf2c4 |
- General Public License for more details.
|
|
DistroBaker |
4cf2c4 |
-
|
|
DistroBaker |
4cf2c4 |
- You should have received copies of the GNU General Public License and
|
|
DistroBaker |
4cf2c4 |
- the GNU Lesser General Public License along with this program. If
|
|
DistroBaker |
4cf2c4 |
- not, see <http://www.gnu.org/licenses/>. */
|
|
DistroBaker |
4cf2c4 |
-
|
|
DistroBaker |
4cf2c4 |
-#ifdef HAVE_CONFIG_H
|
|
DistroBaker |
4cf2c4 |
-# include <config.h>
|
|
DistroBaker |
4cf2c4 |
-#endif
|
|
DistroBaker |
4cf2c4 |
-
|
|
DistroBaker |
4cf2c4 |
-#define BACKEND x86_64_
|
|
DistroBaker |
4cf2c4 |
-#include "libebl_CPU.h"
|
|
DistroBaker |
4cf2c4 |
-
|
|
DistroBaker |
4cf2c4 |
-int
|
|
DistroBaker |
4cf2c4 |
-x86_64_syscall_abi (Ebl *ebl __attribute__ ((unused)),
|
|
DistroBaker |
4cf2c4 |
- int *sp, int *pc, int *callno, int args[6])
|
|
DistroBaker |
4cf2c4 |
-{
|
|
DistroBaker |
4cf2c4 |
- *sp = 7; /* %rsp */
|
|
DistroBaker |
4cf2c4 |
- *pc = 16; /* %rip */
|
|
DistroBaker |
4cf2c4 |
- *callno = 0; /* %rax */
|
|
DistroBaker |
4cf2c4 |
- args[0] = 5; /* %rdi */
|
|
DistroBaker |
4cf2c4 |
- args[1] = 4; /* %rsi */
|
|
DistroBaker |
4cf2c4 |
- args[2] = 1; /* %rdx */
|
|
DistroBaker |
4cf2c4 |
- args[3] = 10; /* %r10 */
|
|
DistroBaker |
4cf2c4 |
- args[4] = 8; /* %r8 */
|
|
DistroBaker |
4cf2c4 |
- args[5] = 9; /* %r9 */
|
|
DistroBaker |
4cf2c4 |
- return 0;
|
|
DistroBaker |
4cf2c4 |
-}
|
|
DistroBaker |
4cf2c4 |
diff --git a/libebl/Makefile.am b/libebl/Makefile.am
|
|
DistroBaker |
4cf2c4 |
index d0d475b8..d84e7ee2 100644
|
|
DistroBaker |
4cf2c4 |
--- a/libebl/Makefile.am
|
|
DistroBaker |
4cf2c4 |
+++ b/libebl/Makefile.am
|
|
DistroBaker |
4cf2c4 |
@@ -51,7 +51,7 @@ libebl_a_SOURCES = eblopenbackend.c eblclosebackend.c eblreloctypename.c \
|
|
DistroBaker |
4cf2c4 |
eblbsspltp.c eblretval.c eblreginfo.c eblnonerelocp.c \
|
|
DistroBaker |
4cf2c4 |
eblrelativerelocp.c eblsysvhashentrysize.c eblauxvinfo.c \
|
|
DistroBaker |
4cf2c4 |
eblcheckobjattr.c ebl_check_special_section.c \
|
|
DistroBaker |
4cf2c4 |
- ebl_syscall_abi.c eblabicfi.c eblstother.c eblinitreg.c \
|
|
DistroBaker |
4cf2c4 |
+ eblabicfi.c eblstother.c eblinitreg.c \
|
|
DistroBaker |
4cf2c4 |
ebldwarftoregno.c eblnormalizepc.c eblunwind.c \
|
|
DistroBaker |
4cf2c4 |
eblresolvesym.c eblcheckreloctargettype.c \
|
|
DistroBaker |
4cf2c4 |
ebl_data_marker_symbol.c
|
|
DistroBaker |
4cf2c4 |
diff --git a/libebl/ebl-hooks.h b/libebl/ebl-hooks.h
|
|
DistroBaker |
4cf2c4 |
index 1e7960b8..1214bb84 100644
|
|
DistroBaker |
4cf2c4 |
--- a/libebl/ebl-hooks.h
|
|
DistroBaker |
4cf2c4 |
+++ b/libebl/ebl-hooks.h
|
|
DistroBaker |
4cf2c4 |
@@ -142,10 +142,6 @@ ssize_t EBLHOOK(register_info) (Ebl *ebl,
|
|
DistroBaker |
4cf2c4 |
const char **prefix, const char **setname,
|
|
DistroBaker |
4cf2c4 |
int *bits, int *type);
|
|
DistroBaker |
4cf2c4 |
|
|
DistroBaker |
4cf2c4 |
-/* Return system call ABI registers. */
|
|
DistroBaker |
4cf2c4 |
-int EBLHOOK(syscall_abi) (Ebl *ebl, int *sp, int *pc,
|
|
DistroBaker |
4cf2c4 |
- int *callno, int args[6]);
|
|
DistroBaker |
4cf2c4 |
-
|
|
DistroBaker |
4cf2c4 |
/* Disassembler function. */
|
|
DistroBaker |
4cf2c4 |
int EBLHOOK(disasm) (Ebl *ebl, const uint8_t **startp, const uint8_t *end,
|
|
DistroBaker |
4cf2c4 |
GElf_Addr addr, const char *fmt, DisasmOutputCB_t outcb,
|
|
DistroBaker |
4cf2c4 |
diff --git a/libebl/ebl_syscall_abi.c b/libebl/ebl_syscall_abi.c
|
|
DistroBaker |
4cf2c4 |
deleted file mode 100644
|
|
DistroBaker |
4cf2c4 |
index a25369d2..00000000
|
|
DistroBaker |
4cf2c4 |
--- a/libebl/ebl_syscall_abi.c
|
|
DistroBaker |
4cf2c4 |
+++ /dev/null
|
|
DistroBaker |
4cf2c4 |
@@ -1,40 +0,0 @@
|
|
DistroBaker |
4cf2c4 |
-/* Return system call ABI mapped to DWARF register numbers.
|
|
DistroBaker |
4cf2c4 |
- Copyright (C) 2008 Red Hat, Inc.
|
|
DistroBaker |
4cf2c4 |
- This file is part of elfutils.
|
|
DistroBaker |
4cf2c4 |
-
|
|
DistroBaker |
4cf2c4 |
- This file is free software; you can redistribute it and/or modify
|
|
DistroBaker |
4cf2c4 |
- it under the terms of either
|
|
DistroBaker |
4cf2c4 |
-
|
|
DistroBaker |
4cf2c4 |
- * the GNU Lesser General Public License as published by the Free
|
|
DistroBaker |
4cf2c4 |
- Software Foundation; either version 3 of the License, or (at
|
|
DistroBaker |
4cf2c4 |
- your option) any later version
|
|
DistroBaker |
4cf2c4 |
-
|
|
DistroBaker |
4cf2c4 |
- or
|
|
DistroBaker |
4cf2c4 |
-
|
|
DistroBaker |
4cf2c4 |
- * the GNU General Public License as published by the Free
|
|
DistroBaker |
4cf2c4 |
- Software Foundation; either version 2 of the License, or (at
|
|
DistroBaker |
4cf2c4 |
- your option) any later version
|
|
DistroBaker |
4cf2c4 |
-
|
|
DistroBaker |
4cf2c4 |
- or both in parallel, as here.
|
|
DistroBaker |
4cf2c4 |
-
|
|
DistroBaker |
4cf2c4 |
- elfutils is distributed in the hope that it will be useful, but
|
|
DistroBaker |
4cf2c4 |
- WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
DistroBaker |
4cf2c4 |
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
DistroBaker |
4cf2c4 |
- General Public License for more details.
|
|
DistroBaker |
4cf2c4 |
-
|
|
DistroBaker |
4cf2c4 |
- You should have received copies of the GNU General Public License and
|
|
DistroBaker |
4cf2c4 |
- the GNU Lesser General Public License along with this program. If
|
|
DistroBaker |
4cf2c4 |
- not, see <http://www.gnu.org/licenses/>. */
|
|
DistroBaker |
4cf2c4 |
-
|
|
DistroBaker |
4cf2c4 |
-#ifdef HAVE_CONFIG_H
|
|
DistroBaker |
4cf2c4 |
-# include <config.h>
|
|
DistroBaker |
4cf2c4 |
-#endif
|
|
DistroBaker |
4cf2c4 |
-
|
|
DistroBaker |
4cf2c4 |
-#include <libeblP.h>
|
|
DistroBaker |
4cf2c4 |
-
|
|
DistroBaker |
4cf2c4 |
-
|
|
DistroBaker |
4cf2c4 |
-int
|
|
DistroBaker |
4cf2c4 |
-ebl_syscall_abi (Ebl *ebl, int *sp, int *pc, int *callno, int *args)
|
|
DistroBaker |
4cf2c4 |
-{
|
|
DistroBaker |
4cf2c4 |
- return ebl != NULL ? ebl->syscall_abi (ebl, sp, pc, callno, args) : -1;
|
|
DistroBaker |
4cf2c4 |
-}
|
|
DistroBaker |
4cf2c4 |
diff --git a/libebl/eblopenbackend.c b/libebl/eblopenbackend.c
|
|
DistroBaker |
4cf2c4 |
index b3b6fc01..90a83f26 100644
|
|
DistroBaker |
4cf2c4 |
--- a/libebl/eblopenbackend.c
|
|
DistroBaker |
4cf2c4 |
+++ b/libebl/eblopenbackend.c
|
|
DistroBaker |
4cf2c4 |
@@ -214,8 +214,6 @@ static ssize_t default_register_info (Ebl *ebl,
|
|
DistroBaker |
4cf2c4 |
const char **prefix,
|
|
DistroBaker |
4cf2c4 |
const char **setname,
|
|
DistroBaker |
4cf2c4 |
int *bits, int *type);
|
|
DistroBaker |
4cf2c4 |
-static int default_syscall_abi (Ebl *ebl, int *sp, int *pc,
|
|
DistroBaker |
4cf2c4 |
- int *callno, int args[6]);
|
|
DistroBaker |
4cf2c4 |
static bool default_check_object_attribute (Ebl *ebl, const char *vendor,
|
|
DistroBaker |
4cf2c4 |
int tag, uint64_t value,
|
|
DistroBaker |
4cf2c4 |
const char **tag_name,
|
|
DistroBaker |
4cf2c4 |
@@ -259,7 +257,6 @@ fill_defaults (Ebl *result)
|
|
DistroBaker |
4cf2c4 |
result->bss_plt_p = default_bss_plt_p;
|
|
DistroBaker |
4cf2c4 |
result->return_value_location = default_return_value_location;
|
|
DistroBaker |
4cf2c4 |
result->register_info = default_register_info;
|
|
DistroBaker |
4cf2c4 |
- result->syscall_abi = default_syscall_abi;
|
|
DistroBaker |
4cf2c4 |
result->check_object_attribute = default_check_object_attribute;
|
|
DistroBaker |
4cf2c4 |
result->check_reloc_target_type = default_check_reloc_target_type;
|
|
DistroBaker |
4cf2c4 |
result->disasm = NULL;
|
|
DistroBaker |
4cf2c4 |
@@ -690,20 +687,6 @@ default_register_info (Ebl *ebl __attribute__ ((unused)),
|
|
DistroBaker |
4cf2c4 |
return snprintf (name, namelen, "reg%d", regno);
|
|
DistroBaker |
4cf2c4 |
}
|
|
DistroBaker |
4cf2c4 |
|
|
DistroBaker |
4cf2c4 |
-static int
|
|
DistroBaker |
4cf2c4 |
-default_syscall_abi (Ebl *ebl __attribute__ ((unused)),
|
|
DistroBaker |
4cf2c4 |
- int *sp, int *pc, int *callno, int args[6])
|
|
DistroBaker |
4cf2c4 |
-{
|
|
DistroBaker |
4cf2c4 |
- *sp = *pc = *callno = -1;
|
|
DistroBaker |
4cf2c4 |
- args[0] = -1;
|
|
DistroBaker |
4cf2c4 |
- args[1] = -1;
|
|
DistroBaker |
4cf2c4 |
- args[2] = -1;
|
|
DistroBaker |
4cf2c4 |
- args[3] = -1;
|
|
DistroBaker |
4cf2c4 |
- args[4] = -1;
|
|
DistroBaker |
4cf2c4 |
- args[5] = -1;
|
|
DistroBaker |
4cf2c4 |
- return -1;
|
|
DistroBaker |
4cf2c4 |
-}
|
|
DistroBaker |
4cf2c4 |
-
|
|
DistroBaker |
4cf2c4 |
static bool
|
|
DistroBaker |
4cf2c4 |
default_check_object_attribute (Ebl *ebl __attribute__ ((unused)),
|
|
DistroBaker |
4cf2c4 |
const char *vendor __attribute__ ((unused)),
|
|
DistroBaker |
4cf2c4 |
diff --git a/libebl/libebl.h b/libebl/libebl.h
|
|
DistroBaker |
4cf2c4 |
index 23c0e950..731001d3 100644
|
|
DistroBaker |
4cf2c4 |
--- a/libebl/libebl.h
|
|
DistroBaker |
4cf2c4 |
+++ b/libebl/libebl.h
|
|
DistroBaker |
4cf2c4 |
@@ -241,14 +241,6 @@ extern ssize_t ebl_register_info (Ebl *ebl,
|
|
DistroBaker |
4cf2c4 |
const char **prefix, const char **setname,
|
|
DistroBaker |
4cf2c4 |
int *bits, int *type);
|
|
DistroBaker |
4cf2c4 |
|
|
DistroBaker |
4cf2c4 |
-/* Fill in the DWARF register numbers for the registers used in system calls.
|
|
DistroBaker |
4cf2c4 |
- The SP and PC are what kernel reports call the user stack pointer and PC.
|
|
DistroBaker |
4cf2c4 |
- The CALLNO and ARGS are the system call number and incoming arguments.
|
|
DistroBaker |
4cf2c4 |
- Each of these is filled with the DWARF register number corresponding,
|
|
DistroBaker |
4cf2c4 |
- or -1 if there is none. Returns zero when the information is available. */
|
|
DistroBaker |
4cf2c4 |
-extern int ebl_syscall_abi (Ebl *ebl, int *sp, int *pc,
|
|
DistroBaker |
4cf2c4 |
- int *callno, int args[6]);
|
|
DistroBaker |
4cf2c4 |
-
|
|
DistroBaker |
4cf2c4 |
/* Supply the ABI-specified state of DWARF CFI before CIE initial programs.
|
|
DistroBaker |
4cf2c4 |
|
|
DistroBaker |
4cf2c4 |
The DWARF 3.0 spec says that the default initial states of all registers
|
|
DistroBaker |
4cf2c4 |
commit 4b2edc1161e6786b09b65da3a62ef24078324d4c
|
|
DistroBaker |
4cf2c4 |
Author: Mark Wielaard <mark@klomp.org>
|
|
DistroBaker |
4cf2c4 |
Date: Mon Oct 19 10:17:59 2020 +0200
|
|
DistroBaker |
4cf2c4 |
|
|
DistroBaker |
4cf2c4 |
libdw: dwarf_frame_register takes an array of at least 3 Dwarf_Ops
|
|
DistroBaker |
4cf2c4 |
|
|
DistroBaker |
4cf2c4 |
GCC11 will warn about a mismatch in the declaration of dwarf_frame_register:
|
|
DistroBaker |
4cf2c4 |
|
|
DistroBaker |
4cf2c4 |
dwarf_frame_register.c:37:61: error: argument 3 of type ‘Dwarf_Op *’
|
|
DistroBaker |
4cf2c4 |
declared as a pointer [-Werror=array-parameter=]
|
|
DistroBaker |
4cf2c4 |
37 | dwarf_frame_register (Dwarf_Frame *fs, int regno, Dwarf_Op *ops_mem,
|
|
DistroBaker |
4cf2c4 |
| ~~~~~~~~~~^~~~~~~
|
|
DistroBaker |
4cf2c4 |
libdw.h:1068:43: note: previously declared as an array ‘Dwarf_Op[3]’
|
|
DistroBaker |
4cf2c4 |
1068 | Dwarf_Op ops_mem[3],
|
|
DistroBaker |
4cf2c4 |
| ~~~~~~~~~^~~~~~~~~~
|
|
DistroBaker |
4cf2c4 |
|
|
DistroBaker |
4cf2c4 |
When fixing that it will show an actual bug in the addrcfi testcase:
|
|
DistroBaker |
4cf2c4 |
|
|
DistroBaker |
4cf2c4 |
addrcfi.c:98:16: error: ‘dwarf_frame_register’ accessing 96 bytes in a
|
|
DistroBaker |
4cf2c4 |
region of size 64 [-Werror=stringop-overflow=]
|
|
DistroBaker |
4cf2c4 |
98 | int result = dwarf_frame_register (stuff->frame, regno, ops_mem, &ops, &nops;;
|
|
DistroBaker |
4cf2c4 |
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
DistroBaker |
4cf2c4 |
addrcfi.c:98:16: note: referencing argument 3 of type ‘Dwarf_Op *’
|
|
DistroBaker |
4cf2c4 |
1069 | extern int dwarf_frame_register (Dwarf_Frame *frame, int regno,
|
|
DistroBaker |
4cf2c4 |
| ^~~~~~~~~~~~~~~~~~~~
|
|
DistroBaker |
4cf2c4 |
|
|
DistroBaker |
4cf2c4 |
Fix the declaration, fix the bug and add an extra comment to the description
|
|
DistroBaker |
4cf2c4 |
in libdw.h.
|
|
DistroBaker |
4cf2c4 |
|
|
DistroBaker |
4cf2c4 |
Signed-off-by: Mark Wielaard <mark@klomp.org>
|
|
DistroBaker |
4cf2c4 |
|
|
DistroBaker |
4cf2c4 |
diff --git a/libdw/dwarf_frame_register.c b/libdw/dwarf_frame_register.c
|
|
DistroBaker |
4cf2c4 |
index d0159fb8..bcf3fa03 100644
|
|
DistroBaker |
4cf2c4 |
--- a/libdw/dwarf_frame_register.c
|
|
DistroBaker |
4cf2c4 |
+++ b/libdw/dwarf_frame_register.c
|
|
DistroBaker |
4cf2c4 |
@@ -34,7 +34,7 @@
|
|
DistroBaker |
4cf2c4 |
#include <dwarf.h>
|
|
DistroBaker |
4cf2c4 |
|
|
DistroBaker |
4cf2c4 |
int
|
|
DistroBaker |
4cf2c4 |
-dwarf_frame_register (Dwarf_Frame *fs, int regno, Dwarf_Op *ops_mem,
|
|
DistroBaker |
4cf2c4 |
+dwarf_frame_register (Dwarf_Frame *fs, int regno, Dwarf_Op ops_mem[3],
|
|
DistroBaker |
4cf2c4 |
Dwarf_Op **ops, size_t *nops)
|
|
DistroBaker |
4cf2c4 |
{
|
|
DistroBaker |
4cf2c4 |
/* Maybe there was a previous error. */
|
|
DistroBaker |
4cf2c4 |
diff --git a/libdw/libdw.h b/libdw/libdw.h
|
|
DistroBaker |
4cf2c4 |
index 1a4e15a1..ad4fa6ea 100644
|
|
DistroBaker |
4cf2c4 |
--- a/libdw/libdw.h
|
|
DistroBaker |
4cf2c4 |
+++ b/libdw/libdw.h
|
|
DistroBaker |
4cf2c4 |
@@ -1061,9 +1061,11 @@ extern int dwarf_frame_cfa (Dwarf_Frame *frame, Dwarf_Op **ops, size_t *nops)
|
|
DistroBaker |
4cf2c4 |
caller's REGNO is "same_value", i.e. this frame did not change it;
|
|
DistroBaker |
4cf2c4 |
ask the caller frame where to find it.
|
|
DistroBaker |
4cf2c4 |
|
|
DistroBaker |
4cf2c4 |
- For common simple expressions *OPS is OPS_MEM. For arbitrary DWARF
|
|
DistroBaker |
4cf2c4 |
- expressions in the CFI, *OPS is an internal pointer that can be used as
|
|
DistroBaker |
4cf2c4 |
- long as the Dwarf_CFI used to create FRAME remains alive. */
|
|
DistroBaker |
4cf2c4 |
+ For common simple expressions *OPS is OPS_MEM (which is a caller
|
|
DistroBaker |
4cf2c4 |
+ owned array for for at least 3 Dwarf_Ops). For arbitrary DWARF
|
|
DistroBaker |
4cf2c4 |
+ expressions in the CFI, *OPS is an internal pointer that can be
|
|
DistroBaker |
4cf2c4 |
+ used as long as the Dwarf_CFI used to create FRAME remains
|
|
DistroBaker |
4cf2c4 |
+ alive. */
|
|
DistroBaker |
4cf2c4 |
extern int dwarf_frame_register (Dwarf_Frame *frame, int regno,
|
|
DistroBaker |
4cf2c4 |
Dwarf_Op ops_mem[3],
|
|
DistroBaker |
4cf2c4 |
Dwarf_Op **ops, size_t *nops)
|
|
DistroBaker |
4cf2c4 |
diff --git a/tests/addrcfi.c b/tests/addrcfi.c
|
|
DistroBaker |
4cf2c4 |
index 589b8513..2b7d7bd0 100644
|
|
DistroBaker |
4cf2c4 |
--- a/tests/addrcfi.c
|
|
DistroBaker |
4cf2c4 |
+++ b/tests/addrcfi.c
|
|
DistroBaker |
4cf2c4 |
@@ -92,7 +92,7 @@ print_register (void *arg,
|
|
DistroBaker |
4cf2c4 |
|
|
DistroBaker |
4cf2c4 |
printf ("\t%s reg%u (%s%s): ", setname, regno, prefix, regname);
|
|
DistroBaker |
4cf2c4 |
|
|
DistroBaker |
4cf2c4 |
- Dwarf_Op ops_mem[2];
|
|
DistroBaker |
4cf2c4 |
+ Dwarf_Op ops_mem[3];
|
|
DistroBaker |
4cf2c4 |
Dwarf_Op *ops;
|
|
DistroBaker |
4cf2c4 |
size_t nops;
|
|
DistroBaker |
4cf2c4 |
int result = dwarf_frame_register (stuff->frame, regno, ops_mem, &ops, &nops;;
|