+2020-06-10 Mark Wielaard <mark@klomp.org>
+
+ * configure.ac (MODVERSION): Remove.
+
2020-03-30 Mark Wielaard <mark@klomp.org>
* configure.ac: Set version to 0.179.
+2020-06-10 Mark Wielard <mark@klomp.org>
+
+ * aarch64_init.c (aarch64_init): Remove ehlen, return eh.
+ * alpha_init.c (alpha_init): Likewise.
+ * arm_init.c (arm_init): Likewise.
+ * bpf_init.c (bpf_init): Likewise.
+ * csky_init.c (csky_init): Likewise.
+ * i386_init.c (i386_init): Likewise.
+ * ia64_init.c (ia64_init): Likewise.
+ * m68k_init.c (m68k_init): Likewise.
+ * ppc64_init.c (ppc64_init): Likewise.
+ * ppc_init.c (ppc_init): Likewise.
+ * riscv_init.c (riscv_init): Likewise.
+ * s390_init.c (s390_init): Likewise.
+ * sh_init.c (sh_init): Likewise.
+ * sparc_init.c (sparc_init): Likewise.
+ * tilegx_init.c (tilegx_init): Likewise.
+ * x86_64_init.c (x86_64_init): Likewise.
+ * libebl_CPU.h (init): Adjust EBLHOOK signature.
+
2019-07-05 Omar Sandoval <osandov@fb.com>
* Makefile.am: Replace libcpu_{i386,x86_64,bpf}.a with libcpu.a.
#include "common-reloc.c"
-const char *
+Ebl *
aarch64_init (Elf *elf __attribute__ ((unused)),
GElf_Half machine __attribute__ ((unused)),
- Ebl *eh,
- size_t ehlen)
+ Ebl *eh)
{
- /* Check whether the Elf_BH object has a sufficent size. */
- if (ehlen < sizeof (Ebl))
- return NULL;
-
/* We handle it. */
aarch64_init_reloc (eh);
HOOK (eh, register_info);
HOOK (eh, set_initial_registers_tid);
HOOK (eh, unwind);
- return MODVERSION;
+ return eh;
}
#include "common-reloc.c"
-const char *
+Ebl *
alpha_init (Elf *elf __attribute__ ((unused)),
GElf_Half machine __attribute__ ((unused)),
- Ebl *eh,
- size_t ehlen)
+ Ebl *eh)
{
- /* Check whether the Elf_BH object has a sufficent size. */
- if (ehlen < sizeof (Ebl))
- return NULL;
-
/* We handle it. */
alpha_init_reloc (eh);
HOOK (eh, dynamic_tag_name);
HOOK (eh, auxv_info);
eh->sysvhash_entrysize = sizeof (Elf64_Xword);
- return MODVERSION;
+ return eh;
}
#include "common-reloc.c"
-const char *
+Ebl *
arm_init (Elf *elf __attribute__ ((unused)),
GElf_Half machine __attribute__ ((unused)),
- Ebl *eh,
- size_t ehlen)
+ Ebl *eh)
{
- /* Check whether the Elf_BH object has a sufficent size. */
- if (ehlen < sizeof (Ebl))
- return NULL;
-
/* We handle it. */
arm_init_reloc (eh);
HOOK (eh, segment_type_name);
/* Bit zero encodes whether an function address is THUMB or ARM. */
eh->func_addr_mask = ~(GElf_Addr)1;
- return MODVERSION;
+ return eh;
}
#include "common-reloc.c"
-const char *
+Ebl *
bpf_init (Elf *elf __attribute__ ((unused)),
GElf_Half machine __attribute__ ((unused)),
- Ebl *eh, size_t ehlen)
+ Ebl *eh)
{
- /* Check whether the Elf_BH object has a sufficent size. */
- if (ehlen < sizeof (Ebl))
- return NULL;
-
/* We handle it. */
bpf_init_reloc (eh);
HOOK (eh, register_info);
HOOK (eh, disasm);
HOOK (eh, reloc_simple_type);
- return MODVERSION;
+ return eh;
}
/* This defines the common reloc hooks based on csky_reloc.def. */
#include "common-reloc.c"
-const char *
+Ebl *
csky_init (Elf *elf __attribute__ ((unused)),
GElf_Half machine __attribute__ ((unused)),
- Ebl *eh,
- size_t ehlen)
+ Ebl *eh)
{
- /* Check whether the Elf_BH object has a sufficent size. */
- if (ehlen < sizeof (Ebl))
- return NULL;
-
/* We handle it. */
csky_init_reloc (eh);
HOOK (eh, abi_cfi);
/* gcc/config/ #define DWARF_FRAME_REGISTERS. */
eh->frame_nregs = 38;
- return MODVERSION;
+ return eh;
}
/* This defines the common reloc hooks based on i386_reloc.def. */
#include "common-reloc.c"
-const char *
+Ebl *
i386_init (Elf *elf __attribute__ ((unused)),
GElf_Half machine __attribute__ ((unused)),
- Ebl *eh,
- size_t ehlen)
+ Ebl *eh)
{
- /* Check whether the Elf_BH object has a sufficent size. */
- if (ehlen < sizeof (Ebl))
- return NULL;
-
/* We handle it. */
i386_init_reloc (eh);
HOOK (eh, reloc_simple_type);
HOOK (eh, set_initial_registers_tid);
HOOK (eh, unwind);
- return MODVERSION;
+ return eh;
}
/* This defines the common reloc hooks based on ia64_reloc.def. */
#include "common-reloc.c"
-const char *
+Ebl *
ia64_init (Elf *elf __attribute__ ((unused)),
GElf_Half machine __attribute__ ((unused)),
- Ebl *eh,
- size_t ehlen)
+ Ebl *eh)
{
- /* Check whether the Elf_BH object has a sufficent size. */
- if (ehlen < sizeof (Ebl))
- return NULL;
-
/* We handle it. */
ia64_init_reloc (eh);
HOOK (eh, reloc_simple_type);
HOOK (eh, return_value_location);
HOOK (eh, check_reloc_target_type);
- return MODVERSION;
+ return eh;
}
#define EBLHOOK_2(a, b) a##b
/* Constructor. */
-extern const char *EBLHOOK(init) (Elf *elf, GElf_Half machine,
- Ebl *eh, size_t ehlen);
+extern Ebl *EBLHOOK(init) (Elf *elf, GElf_Half machine, Ebl *eh);
#include "ebl-hooks.h"
#include "common-reloc.c"
-const char *
+Ebl *
m68k_init (Elf *elf __attribute__ ((unused)),
GElf_Half machine __attribute__ ((unused)),
- Ebl *eh,
- size_t ehlen)
+ Ebl *eh)
{
- /* Check whether the Elf_BH object has a sufficent size. */
- if (ehlen < sizeof (Ebl))
- return NULL;
-
/* We handle it. */
m68k_init_reloc (eh);
HOOK (eh, gotpc_reloc_check);
eh->frame_nregs = 25;
HOOK (eh, set_initial_registers_tid);
- return MODVERSION;
+ return eh;
}
#include "common-reloc.c"
-const char *
+Ebl *
ppc64_init (Elf *elf __attribute__ ((unused)),
GElf_Half machine __attribute__ ((unused)),
- Ebl *eh,
- size_t ehlen)
+ Ebl *eh)
{
- /* Check whether the Elf_BH object has a sufficent size. */
- if (ehlen < sizeof (Ebl))
- return NULL;
-
/* We handle it. */
ppc64_init_reloc (eh);
HOOK (eh, reloc_simple_type);
}
}
- return MODVERSION;
+ return eh;
}
#include "common-reloc.c"
-const char *
+Ebl *
ppc_init (Elf *elf __attribute__ ((unused)),
GElf_Half machine __attribute__ ((unused)),
- Ebl *eh,
- size_t ehlen)
+ Ebl *eh)
{
- /* Check whether the Elf_BH object has a sufficent size. */
- if (ehlen < sizeof (Ebl))
- return NULL;
-
/* We handle it. */
ppc_init_reloc (eh);
HOOK (eh, reloc_simple_type);
HOOK (eh, set_initial_registers_tid);
HOOK (eh, dwarf_to_regno);
- return MODVERSION;
+ return eh;
}
extern __typeof (EBLHOOK (core_note)) riscv64_core_note attribute_hidden;
-const char *
+Ebl *
riscv_init (Elf *elf,
GElf_Half machine __attribute__ ((unused)),
- Ebl *eh,
- size_t ehlen)
+ Ebl *eh)
{
- /* Check whether the Elf_BH object has a sufficent size. */
- if (ehlen < sizeof (Ebl))
- return NULL;
-
/* We handle it. */
riscv_init_reloc (eh);
HOOK (eh, reloc_simple_type);
== EF_RISCV_FLOAT_ABI_DOUBLE))
eh->return_value_location = riscv_return_value_location_lp64d;
- return MODVERSION;
+ return eh;
}
extern __typeof (s390_core_note) s390x_core_note;
-const char *
+Ebl *
s390_init (Elf *elf __attribute__ ((unused)),
GElf_Half machine __attribute__ ((unused)),
- Ebl *eh,
- size_t ehlen)
+ Ebl *eh)
{
- /* Check whether the Elf_BH object has a sufficent size. */
- if (ehlen < sizeof (Ebl))
- return NULL;
-
/* We handle it. */
s390_init_reloc (eh);
HOOK (eh, reloc_simple_type);
if (eh->class == ELFCLASS64)
eh->sysvhash_entrysize = sizeof (Elf64_Xword);
- return MODVERSION;
+ return eh;
}
#include "common-reloc.c"
-const char *
+Ebl *
sh_init (Elf *elf __attribute__ ((unused)),
GElf_Half machine __attribute__ ((unused)),
- Ebl *eh,
- size_t ehlen)
+ Ebl *eh)
{
- /* Check whether the Elf_BH object has a sufficent size. */
- if (ehlen < sizeof (Ebl))
- return NULL;
-
/* We handle it. */
sh_init_reloc (eh);
HOOK (eh, reloc_simple_type);
HOOK (eh, register_info);
HOOK (eh, return_value_location);
- return MODVERSION;
+ return eh;
}
extern __typeof (EBLHOOK (core_note)) sparc64_core_note attribute_hidden;
-const char *
+Ebl *
sparc_init (Elf *elf __attribute__ ((unused)),
GElf_Half machine __attribute__ ((unused)),
- Ebl *eh,
- size_t ehlen)
+ Ebl *eh)
{
- /* Check whether the Elf_BH object has a sufficent size. */
- if (ehlen < sizeof (Ebl))
- return NULL;
-
/* We handle it. */
sparc_init_reloc (eh);
HOOK (eh, reloc_simple_type);
eh->ra_offset = 8;
HOOK (eh, set_initial_registers_tid);
- return MODVERSION;
+ return eh;
}
/* This defines the common reloc hooks based on tilegx_reloc.def. */
#include "common-reloc.c"
-const char *
+Ebl *
tilegx_init (Elf *elf __attribute__ ((unused)),
GElf_Half machine __attribute__ ((unused)),
- Ebl *eh,
- size_t ehlen)
+ Ebl *eh)
{
- /* Check whether the Elf_BH object has a sufficent size. */
- if (ehlen < sizeof (Ebl))
- return NULL;
-
/* We handle it. */
tilegx_init_reloc (eh);
HOOK (eh, reloc_simple_type);
HOOK (eh, register_info);
HOOK (eh, core_note);
- return MODVERSION;
+ return eh;
}
extern __typeof (EBLHOOK (core_note)) x32_core_note attribute_hidden;
-const char *
+Ebl *
x86_64_init (Elf *elf __attribute__ ((unused)),
GElf_Half machine __attribute__ ((unused)),
- Ebl *eh,
- size_t ehlen)
+ Ebl *eh)
{
- /* Check whether the Elf_BH object has a sufficent size. */
- if (ehlen < sizeof (Ebl))
- return NULL;
-
/* We handle it. */
x86_64_init_reloc (eh);
HOOK (eh, reloc_simple_type);
HOOK (eh, set_initial_registers_tid);
HOOK (eh, unwind);
- return MODVERSION;
+ return eh;
}
# Round up to the next release API (x.y) version.
eu_version=$(( (eu_version + 999) / 1000 ))
-dnl Unique ID for this build.
-MODVERSION="Build for ${eu_version} ${ac_cv_build}"
-AC_SUBST([MODVERSION])
-AC_DEFINE_UNQUOTED(MODVERSION, "$MODVERSION")
-AH_TEMPLATE([MODVERSION], [Identifier for modules in the build.])
-
AC_CHECK_SIZEOF(long)
# On aarch64 before glibc 2.20 we would get the kernel user_pt_regs instead
+2020-06-10 Mark Wielaard <mark@klomp.org>
+
+ * eblopenbackend.c (i386_init, sh_init, x86_64_init, ia64_init,
+ alpha_init, arm_init, aarch64_init, sparc_init, ppc_init,
+ ppc64_init, s390_init, tilegx_init, m68k_init, bpf_init,
+ riscv_init, csky_init): Adjust signature.
+ (openbackend): Call init without sizeof(Ebl).
+ * libeblP.h (ebl_bhinit_t): Adjust signature.
+
2020-06-04 Mark Wielaard <mark@klomp.org>
* eblsegmenttypename.c (ebl_segment_type_name): Remove
#include <system.h>
#include <libeblP.h>
-const char *i386_init (Elf *, GElf_Half, Ebl *, size_t);
-const char *sh_init (Elf *, GElf_Half, Ebl *, size_t);
-const char *x86_64_init (Elf *, GElf_Half, Ebl *, size_t);
-const char *ia64_init (Elf *, GElf_Half, Ebl *, size_t);
-const char *alpha_init (Elf *, GElf_Half, Ebl *, size_t);
-const char *arm_init (Elf *, GElf_Half, Ebl *, size_t);
-const char *aarch64_init (Elf *, GElf_Half, Ebl *, size_t);
-const char *sparc_init (Elf *, GElf_Half, Ebl *, size_t);
-const char *ppc_init (Elf *, GElf_Half, Ebl *, size_t);
-const char *ppc64_init (Elf *, GElf_Half, Ebl *, size_t);
-const char *s390_init (Elf *, GElf_Half, Ebl *, size_t);
-const char *tilegx_init (Elf *, GElf_Half, Ebl *, size_t);
-const char *m68k_init (Elf *, GElf_Half, Ebl *, size_t);
-const char *bpf_init (Elf *, GElf_Half, Ebl *, size_t);
-const char *riscv_init (Elf *, GElf_Half, Ebl *, size_t);
-const char *csky_init (Elf *, GElf_Half, Ebl *, size_t);
+Ebl *i386_init (Elf *, GElf_Half, Ebl *);
+Ebl *sh_init (Elf *, GElf_Half, Ebl *);
+Ebl *x86_64_init (Elf *, GElf_Half, Ebl *);
+Ebl *ia64_init (Elf *, GElf_Half, Ebl *);
+Ebl *alpha_init (Elf *, GElf_Half, Ebl *);
+Ebl *arm_init (Elf *, GElf_Half, Ebl *);
+Ebl *aarch64_init (Elf *, GElf_Half, Ebl *);
+Ebl *sparc_init (Elf *, GElf_Half, Ebl *);
+Ebl *ppc_init (Elf *, GElf_Half, Ebl *);
+Ebl *ppc64_init (Elf *, GElf_Half, Ebl *);
+Ebl *s390_init (Elf *, GElf_Half, Ebl *);
+Ebl *tilegx_init (Elf *, GElf_Half, Ebl *);
+Ebl *m68k_init (Elf *, GElf_Half, Ebl *);
+Ebl *bpf_init (Elf *, GElf_Half, Ebl *);
+Ebl *riscv_init (Elf *, GElf_Half, Ebl *);
+Ebl *csky_init (Elf *, GElf_Half, Ebl *);
/* This table should contain the complete list of architectures as far
as the ELF specification is concerned. */
}
if (machines[cnt].init &&
- machines[cnt].init (elf, machine, result, sizeof(Ebl)))
+ machines[cnt].init (elf, machine, result))
{
result->elf = elf;
/* A few entries are mandatory. */
};
-/* Type of the initialization functions in the backend modules. */
-typedef const char *(*ebl_bhinit_t) (Elf *, GElf_Half, Ebl *, size_t);
+/* Type of the initialization functions in the backend modules.
+ The init function returns the given Ebl * or NULL if it couldn't
+ initialize for the given Elf or machine. */
+typedef Ebl *(*ebl_bhinit_t) (Elf *, GElf_Half, Ebl *);
/* gettext helper macros. */