summaryrefslogtreecommitdiff
path: root/elfutils/libebl/eblopenbackend.c
diff options
context:
space:
mode:
Diffstat (limited to 'elfutils/libebl/eblopenbackend.c')
-rw-r--r--elfutils/libebl/eblopenbackend.c90
1 files changed, 63 insertions, 27 deletions
diff --git a/elfutils/libebl/eblopenbackend.c b/elfutils/libebl/eblopenbackend.c
index c801a6a0..cc03fe70 100644
--- a/elfutils/libebl/eblopenbackend.c
+++ b/elfutils/libebl/eblopenbackend.c
@@ -1,5 +1,5 @@
/* Generate ELF backend handle.
- Copyright (C) 2000, 2001, 2002, 2003, 2004 Red Hat, Inc.
+ Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005 Red Hat, Inc.
This program is Open Source software; you can redistribute it and/or
modify it under the terms of the Open Software License version 1.0 as
@@ -123,6 +123,7 @@ static const char *default_object_type_name (int ignore, char *buf,
static const char *default_reloc_type_name (int ignore, char *buf, size_t len);
static bool default_reloc_type_check (int ignore);
static bool default_reloc_valid_use (Elf *elf, int ignore);
+static Elf_Type default_reloc_simple_type (Elf *elf, int ignore);
static bool default_gotpc_reloc_check (Elf *elf, int ignore);
static const char *default_segment_type_name (int ignore, char *buf,
size_t len);
@@ -180,6 +181,7 @@ openbackend (elf, emulation, machine)
result->reloc_type_name = default_reloc_type_name;
result->reloc_type_check = default_reloc_type_check;
result->reloc_valid_use = default_reloc_valid_use;
+ result->reloc_simple_type = default_reloc_simple_type;
result->gotpc_reloc_check = default_gotpc_reloc_check;
result->segment_type_name = default_segment_type_name;
result->section_type_name = default_section_type_name;
@@ -219,7 +221,7 @@ openbackend (elf, emulation, machine)
try to load the module. */
char dsoname[100];
strcpy (stpcpy (stpcpy (dsoname,
- "$ORIGIN/../" LIBSTR "/elfutils/libebl_"),
+ "$ORIGIN/../$LIB/elfutils/libebl_"),
machines[cnt].dsoname),
".so");
@@ -321,85 +323,111 @@ ebl_openbackend_emulation (const char *emulation)
/* Default callbacks. Mostly they just return the error value. */
static const char *
-default_object_type_name (int ignore, char *buf, size_t len)
+default_object_type_name (int ignore __attribute__ ((unused)),
+ char *buf __attribute__ ((unused)),
+ size_t len __attribute__ ((unused)))
{
return NULL;
}
static const char *
-default_reloc_type_name (int ignore, char *buf, size_t len)
+default_reloc_type_name (int ignore __attribute__ ((unused)),
+ char *buf __attribute__ ((unused)),
+ size_t len __attribute__ ((unused)))
{
return NULL;
}
static bool
-default_reloc_type_check (int ignore)
+default_reloc_type_check (int ignore __attribute__ ((unused)))
{
return false;
}
static bool
-default_reloc_valid_use (Elf *elf, int ignore)
+default_reloc_valid_use (Elf *elf __attribute__ ((unused)),
+ int ignore __attribute__ ((unused)))
{
return false;
}
+static Elf_Type
+default_reloc_simple_type (Elf *elf __attribute__ ((unused)),
+ int ignore __attribute__ ((unused)))
+{
+ return ELF_T_NUM;
+}
+
static bool
-default_gotpc_reloc_check (Elf *elf, int ignore)
+default_gotpc_reloc_check (Elf *elf __attribute__ ((unused)),
+ int ignore __attribute__ ((unused)))
{
return false;
}
static const char *
-default_segment_type_name (int ignore, char *buf, size_t len)
+default_segment_type_name (int ignore __attribute__ ((unused)),
+ char *buf __attribute__ ((unused)),
+ size_t len __attribute__ ((unused)))
{
return NULL;
}
static const char *
-default_section_type_name (int ignore, char *buf, size_t len)
+default_section_type_name (int ignore __attribute__ ((unused)),
+ char *buf __attribute__ ((unused)),
+ size_t len __attribute__ ((unused)))
{
return NULL;
}
static const char *
-default_section_name (int ignore, int ignore2, char *buf, size_t len)
+default_section_name (int ignore __attribute__ ((unused)),
+ int ignore2 __attribute__ ((unused)),
+ char *buf __attribute__ ((unused)),
+ size_t len __attribute__ ((unused)))
{
return NULL;
}
static const char *
-default_machine_flag_name (Elf64_Word *ignore)
+default_machine_flag_name (Elf64_Word *ignore __attribute__ ((unused)))
{
return NULL;
}
static bool
-default_machine_flag_check (Elf64_Word flags)
+default_machine_flag_check (Elf64_Word flags __attribute__ ((unused)))
{
return flags == 0;
}
static const char *
-default_symbol_type_name (int ignore, char *buf, size_t len)
+default_symbol_type_name (int ignore __attribute__ ((unused)),
+ char *buf __attribute__ ((unused)),
+ size_t len __attribute__ ((unused)))
{
return NULL;
}
static const char *
-default_symbol_binding_name (int ignore, char *buf, size_t len)
+default_symbol_binding_name (int ignore __attribute__ ((unused)),
+ char *buf __attribute__ ((unused)),
+ size_t len __attribute__ ((unused)))
{
return NULL;
}
static const char *
-default_dynamic_tag_name (int64_t ignore, char *buf, size_t len)
+default_dynamic_tag_name (int64_t ignore __attribute__ ((unused)),
+ char *buf __attribute__ ((unused)),
+ size_t len __attribute__ ((unused)))
{
return NULL;
}
static bool
-default_dynamic_tag_check (int64_t ignore)
+default_dynamic_tag_check (int64_t ignore __attribute__ ((unused)))
{
return false;
}
@@ -411,38 +439,48 @@ default_sh_flags_combine (GElf_Word flags1, GElf_Word flags2)
}
static void
-default_destr (struct ebl *ignore)
+default_destr (struct ebl *ignore __attribute__ ((unused)))
{
}
static const char *
-default_osabi_name (int ignore, char *buf, size_t len)
+default_osabi_name (int ignore __attribute__ ((unused)),
+ char *buf __attribute__ ((unused)),
+ size_t len __attribute__ ((unused)))
{
return NULL;
}
static const char *
-default_core_note_type_name (uint32_t ignore, char *buf, size_t len)
+default_core_note_type_name (uint32_t ignore __attribute__ ((unused)),
+ char *buf __attribute__ ((unused)),
+ size_t len __attribute__ ((unused)))
{
return NULL;
}
static const char *
-default_object_note_type_name (uint32_t ignore, char *buf, size_t len)
+default_object_note_type_name (uint32_t ignore __attribute__ ((unused)),
+ char *buf __attribute__ ((unused)),
+ size_t len __attribute__ ((unused)))
{
return NULL;
}
static bool
-default_core_note (const char *name, uint32_t type, uint32_t descsz,
- const char *desc)
+default_core_note (const char *name __attribute__ ((unused)),
+ uint32_t type __attribute__ ((unused)),
+ uint32_t descsz __attribute__ ((unused)),
+ const char *desc __attribute__ ((unused)))
{
return NULL;
}
static bool
-default_object_note (const char *name, uint32_t type, uint32_t descsz,
- const char *desc)
+default_object_note (const char *name __attribute__ ((unused)),
+ uint32_t type __attribute__ ((unused)),
+ uint32_t descsz __attribute__ ((unused)),
+ const char *desc __attribute__ ((unused)))
{
return NULL;
}
@@ -481,9 +519,7 @@ default_debugscn_p (const char *name)
};
const size_t ndwarf_scn_names = (sizeof (dwarf_scn_names)
/ sizeof (dwarf_scn_names[0]));
- size_t cnt;
-
- for (cnt = 0; cnt < ndwarf_scn_names; ++cnt)
+ for (size_t cnt = 0; cnt < ndwarf_scn_names; ++cnt)
if (strcmp (name, dwarf_scn_names[cnt]) == 0)
return true;