summaryrefslogtreecommitdiff
path: root/libebl
diff options
context:
space:
mode:
authorRoland McGrath <roland@redhat.com>2008-04-01 02:30:05 +0000
committerRoland McGrath <roland@redhat.com>2008-04-01 02:30:05 +0000
commit13b69609bcd5638e6194d940855fea3dd0519605 (patch)
treeffaa63b3cd050285d68ebc6c437c012edb59ddf9 /libebl
parentd11f9cbecac4a5ac3848a68597028d1924f3ff6b (diff)
downloadelfutils-13b69609bcd5638e6194d940855fea3dd0519605.tar.gz
backends/
* sparc_symbol.c (sparc_symbol_type_name): New function. (sparc_dynamic_tag_name): New function. (sparc_dynamic_tag_check): New function. * sparc_init.c (sparc_init): Initialize those hooks. libebl/ * ebldynamictagname.c (ebl_dynamic_tag_name): Use hex for unknown tag.
Diffstat (limited to 'libebl')
-rw-r--r--libebl/ChangeLog11
-rw-r--r--libebl/Makefile.am3
-rw-r--r--libebl/ebl-hooks.h8
-rw-r--r--libebl/ebl_check_special_section.c65
-rw-r--r--libebl/ebldynamictagname.c4
-rw-r--r--libebl/eblopenbackend.c12
-rw-r--r--libebl/libebl.h6
7 files changed, 105 insertions, 4 deletions
diff --git a/libebl/ChangeLog b/libebl/ChangeLog
index 8ebc6c19..9838727a 100644
--- a/libebl/ChangeLog
+++ b/libebl/ChangeLog
@@ -1,3 +1,14 @@
+2008-03-31 Roland McGrath <roland@redhat.com>
+
+ * ebldynamictagname.c (ebl_dynamic_tag_name): Use hex for unknown tag.
+
+ * ebl-hooks.h: Add check_special_section hook.
+ * eblopenbackend.c (fill_defaults): Set new hook to ...
+ (default_check_special_section): ... this, new function.
+ * ebl_check_special_section.c: New file.
+ * Makefile.am (gen_SOURCES): Add it.
+ * libebl.h: Declare it.
+
2008-02-20 Roland McGrath <roland@redhat.com>
* libebl.h: Declare ebl_check_object_attribute.
diff --git a/libebl/Makefile.am b/libebl/Makefile.am
index 1e36b334..0d06a859 100644
--- a/libebl/Makefile.am
+++ b/libebl/Makefile.am
@@ -58,7 +58,8 @@ gen_SOURCES = eblopenbackend.c eblclosebackend.c eblstrtab.c \
eblelfclass.c eblelfdata.c eblelfmachine.c \
ebl_check_special_symbol.c eblbsspltp.c eblretval.c \
eblreginfo.c eblnonerelocp.c eblrelativerelocp.c \
- eblsysvhashentrysize.c eblauxvinfo.c eblcheckobjattr.c
+ eblsysvhashentrysize.c eblauxvinfo.c eblcheckobjattr.c \
+ ebl_check_special_section.c
libebl_a_SOURCES = $(gen_SOURCES)
diff --git a/libebl/ebl-hooks.h b/libebl/ebl-hooks.h
index c236b35e..9f6c8d2c 100644
--- a/libebl/ebl-hooks.h
+++ b/libebl/ebl-hooks.h
@@ -1,5 +1,5 @@
/* Backend hook signatures internal interface for libebl.
- Copyright (C) 2000, 2001, 2002, 2004, 2005, 2006, 2007 Red Hat, Inc.
+ Copyright (C) 2000,2001,2002,2004,2005,2006,2007,2008 Red Hat, Inc.
This file is part of Red Hat elfutils.
Red Hat elfutils is free software; you can redistribute it and/or modify
@@ -83,6 +83,12 @@ bool EBLHOOK(machine_flag_check) (GElf_Word);
/* Check whether SHF_MASKPROC flag bits are valid. */
bool EBLHOOK(machine_section_flag_check) (GElf_Xword);
+/* Check whether the section with the given index, header, and name
+ is a special machine section that is valid despite a combination
+ of flags or other details that are not generically valid. */
+bool EBLHOOK(check_special_section) (Ebl *, int,
+ const GElf_Shdr *, const char *);
+
/* Return symbolic representation of symbol type. */
const char *EBLHOOK(symbol_type_name) (int, char *, size_t);
diff --git a/libebl/ebl_check_special_section.c b/libebl/ebl_check_special_section.c
new file mode 100644
index 00000000..d1f3c6e3
--- /dev/null
+++ b/libebl/ebl_check_special_section.c
@@ -0,0 +1,65 @@
+/* Check for a special section allowed to violate generic constraints.
+ Copyright (C) 2008 Red Hat, Inc.
+ This file is part of Red Hat elfutils.
+
+ Red Hat elfutils is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by the
+ Free Software Foundation; version 2 of the License.
+
+ Red Hat 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 a copy of the GNU General Public License along
+ with Red Hat elfutils; if not, write to the Free Software Foundation,
+ Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA.
+
+ In addition, as a special exception, Red Hat, Inc. gives You the
+ additional right to link the code of Red Hat elfutils with code licensed
+ under any Open Source Initiative certified open source license
+ (http://www.opensource.org/licenses/index.php) which requires the
+ distribution of source code with any binary distribution and to
+ distribute linked combinations of the two. Non-GPL Code permitted under
+ this exception must only link to the code of Red Hat elfutils through
+ those well defined interfaces identified in the file named EXCEPTION
+ found in the source code files (the "Approved Interfaces"). The files
+ of Non-GPL Code may instantiate templates or use macros or inline
+ functions from the Approved Interfaces without causing the resulting
+ work to be covered by the GNU General Public License. Only Red Hat,
+ Inc. may make changes or additions to the list of Approved Interfaces.
+ Red Hat's grant of this exception is conditioned upon your not adding
+ any new exceptions. If you wish to add a new Approved Interface or
+ exception, please contact Red Hat. You must obey the GNU General Public
+ License in all respects for all of the Red Hat elfutils code and other
+ code used in conjunction with Red Hat elfutils except the Non-GPL Code
+ covered by this exception. If you modify this file, you may extend this
+ exception to your version of the file, but you are not obligated to do
+ so. If you do not wish to provide this exception without modification,
+ you must delete this exception statement from your version and license
+ this file solely under the GPL without exception.
+
+ Red Hat elfutils is an included package of the Open Invention Network.
+ An included package of the Open Invention Network is a package for which
+ Open Invention Network licensees cross-license their patents. No patent
+ license is granted, either expressly or impliedly, by designation as an
+ included package. Should you wish to participate in the Open Invention
+ Network licensing program, please visit www.openinventionnetwork.com
+ <http://www.openinventionnetwork.com>. */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <libeblP.h>
+
+
+bool
+ebl_check_special_section (ebl, ndx, shdr, sname)
+ Ebl *ebl;
+ int ndx;
+ const GElf_Shdr *shdr;
+ const char *sname;
+{
+ return ebl != NULL && ebl->check_special_section (ebl, ndx, shdr, sname);
+}
diff --git a/libebl/ebldynamictagname.c b/libebl/ebldynamictagname.c
index d9aa7df0..e0972ede 100644
--- a/libebl/ebldynamictagname.c
+++ b/libebl/ebldynamictagname.c
@@ -1,5 +1,5 @@
/* Return dynamic tag name.
- Copyright (C) 2001, 2002, 2006 Red Hat, Inc.
+ Copyright (C) 2001, 2002, 2006, 2008 Red Hat, Inc.
This file is part of Red Hat elfutils.
Written by Ulrich Drepper <drepper@redhat.com>, 2001.
@@ -123,7 +123,7 @@ ebl_dynamic_tag_name (ebl, tag, buf, len)
res = "FILTER";
else
{
- snprintf (buf, len, gettext ("<unknown>: %" PRId64), tag);
+ snprintf (buf, len, gettext ("<unknown>: %#" PRIx64), tag);
res = buf;
diff --git a/libebl/eblopenbackend.c b/libebl/eblopenbackend.c
index 08817f66..672e834b 100644
--- a/libebl/eblopenbackend.c
+++ b/libebl/eblopenbackend.c
@@ -202,6 +202,8 @@ static bool default_check_special_symbol (Elf *elf, GElf_Ehdr *ehdr,
const GElf_Sym *sym,
const char *name,
const GElf_Shdr *destshdr);
+static bool default_check_special_section (Ebl *, int,
+ const GElf_Shdr *, const char *);
static bool default_bss_plt_p (Elf *elf, GElf_Ehdr *ehdr);
static int default_return_value_location (Dwarf_Die *functypedie,
const Dwarf_Op **locops);
@@ -231,6 +233,7 @@ fill_defaults (Ebl *result)
result->machine_flag_name = default_machine_flag_name;
result->machine_flag_check = default_machine_flag_check;
result->machine_section_flag_check = default_machine_section_flag_check;
+ result->check_special_section = default_check_special_section;
result->symbol_type_name = default_symbol_type_name;
result->symbol_binding_name = default_symbol_binding_name;
result->dynamic_tag_name = default_dynamic_tag_name;
@@ -521,6 +524,15 @@ default_machine_section_flag_check (GElf_Xword flags)
return flags == 0;
}
+static bool
+default_check_special_section (Ebl *ebl __attribute__ ((unused)),
+ int ndx __attribute__ ((unused)),
+ const GElf_Shdr *shdr __attribute__ ((unused)),
+ const char *sname __attribute__ ((unused)))
+{
+ return false;
+}
+
static const char *
default_symbol_type_name (int ignore __attribute__ ((unused)),
char *buf __attribute__ ((unused)),
diff --git a/libebl/libebl.h b/libebl/libebl.h
index 083de03a..118ae7e7 100644
--- a/libebl/libebl.h
+++ b/libebl/libebl.h
@@ -141,6 +141,12 @@ extern bool ebl_machine_flag_check (Ebl *ebl, GElf_Word flags);
/* Check whether SHF_MASKPROC flags are valid. */
extern bool ebl_machine_section_flag_check (Ebl *ebl, GElf_Xword flags);
+/* Check whether the section with the given index, header, and name
+ is a special machine section that is valid despite a combination
+ of flags or other details that are not generically valid. */
+extern bool ebl_check_special_section (Ebl *ebl, int ndx,
+ const GElf_Shdr *shdr, const char *name);
+
/* Return symbol type name. */
extern const char *ebl_symbol_type_name (Ebl *ebl, int symbol,
char *buf, size_t len);