summaryrefslogtreecommitdiffstats
path: root/libebl
diff options
context:
space:
mode:
authorUlf Hermann <[email protected]>2017-08-16 16:37:34 +0200
committerUlf Hermann <[email protected]>2017-08-17 17:55:41 +0200
commitd86c13d143989a961eba149e3abfab9e3f471744 (patch)
treec16c260c24712819cb967415ec79e58e26d3e4bf /libebl
parent3695a1ba8dcd16459e0f35b74e88dbef48d21861 (diff)
parent54ba4ce2973113d8f4315d4fc90e16a9b4476ea6 (diff)
Merge tag 'elfutils-0.170'
elfutils 0.170 release Change-Id: I37d03645902b9f0a9fb708af1551db8843537799
Diffstat (limited to 'libebl')
-rw-r--r--libebl/ChangeLog13
-rw-r--r--libebl/Makefile.am5
-rw-r--r--libebl/ebl-hooks.h5
-rw-r--r--libebl/ebl_data_marker_symbol.c44
-rw-r--r--libebl/eblcorenotetypename.c1
-rw-r--r--libebl/eblopenbackend.c11
-rw-r--r--libebl/libebl.h6
7 files changed, 80 insertions, 5 deletions
diff --git a/libebl/ChangeLog b/libebl/ChangeLog
index 7de72366..0d8e53bf 100644
--- a/libebl/ChangeLog
+++ b/libebl/ChangeLog
@@ -18,6 +18,19 @@
* eblmachineflagname.c: Don't include system.h.
* eblopenbackend.c: Likewise.
+2017-07-19 Gustavo Romero <[email protected]>
+
+ * eblcorenotetypename.c: Add ppc64 HTM SPRs note as known type.
+
+2017-07-20 Mark Wielaard <[email protected]>
+
+ * Makefile.am (gen_SOURCES): Add ebl_data_marker_symbol.c.
+ * ebl-hooks.h (data_marker_symbol): New hook.
+ * ebl_data_marker_symbol.c: New file.
+ * eblopenbackend.c (default_data_marker_symbol): New function.
+ (fill_defaults): Add default_data_marker_symbol.
+ * libebl.h (ebl_data_marker_symbol): New function.
+
2017-04-20 Ulf Hermann <[email protected]>
* libebl.h: Use __pure_attribute__.
diff --git a/libebl/Makefile.am b/libebl/Makefile.am
index a167549b..d46b0c8f 100644
--- a/libebl/Makefile.am
+++ b/libebl/Makefile.am
@@ -1,6 +1,6 @@
## Process this file with automake to create Makefile.in
##
-## Copyright (C) 2000-2010, 2013, 2016 Red Hat, Inc.
+## Copyright (C) 2000-2010, 2013, 2016, 2017 Red Hat, Inc.
## This file is part of elfutils.
##
## This file is free software; you can redistribute it and/or modify
@@ -55,7 +55,8 @@ gen_SOURCES = eblopenbackend.c eblclosebackend.c \
eblsysvhashentrysize.c eblauxvinfo.c eblcheckobjattr.c \
ebl_check_special_section.c ebl_syscall_abi.c eblabicfi.c \
eblstother.c eblinitreg.c ebldwarftoregno.c eblnormalizepc.c \
- eblunwind.c eblresolvesym.c eblcheckreloctargettype.c
+ eblunwind.c eblresolvesym.c eblcheckreloctargettype.c \
+ ebl_data_marker_symbol.c
libebl_a_SOURCES = $(gen_SOURCES)
diff --git a/libebl/ebl-hooks.h b/libebl/ebl-hooks.h
index b7253748..f3a0e64a 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-2011, 2013, 2014, 2016 Red Hat, Inc.
+ Copyright (C) 2000-2011, 2013, 2014, 2016, 2017 Red Hat, Inc.
This file is part of elfutils.
This file is free software; you can redistribute it and/or modify
@@ -121,6 +121,9 @@ bool EBLHOOK(relative_reloc_p) (int);
bool EBLHOOK(check_special_symbol) (Elf *, GElf_Ehdr *, const GElf_Sym *,
const char *, const GElf_Shdr *);
+/* Check if this is a data marker symbol. e.g. '$d' symbols for ARM. */
+bool EBLHOOK(data_marker_symbol) (const GElf_Sym *sym, const char *sname);
+
/* Check whether only valid bits are set on the st_other symbol flag.
Standard ST_VISIBILITY have already been masked off. */
bool EBLHOOK(check_st_other_bits) (unsigned char st_other);
diff --git a/libebl/ebl_data_marker_symbol.c b/libebl/ebl_data_marker_symbol.c
new file mode 100644
index 00000000..922d7203
--- /dev/null
+++ b/libebl/ebl_data_marker_symbol.c
@@ -0,0 +1,44 @@
+/* Check whether a symbol is a special data marker.
+ Copyright (C) 2017 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 <inttypes.h>
+#include <libeblP.h>
+
+
+bool
+ebl_data_marker_symbol (Ebl *ebl, const GElf_Sym *sym, const char *sname)
+{
+ if (ebl == NULL)
+ return false;
+
+ return ebl->data_marker_symbol (sym, sname);
+}
diff --git a/libebl/eblcorenotetypename.c b/libebl/eblcorenotetypename.c
index fa81dbec..d3a56fa9 100644
--- a/libebl/eblcorenotetypename.c
+++ b/libebl/eblcorenotetypename.c
@@ -75,6 +75,7 @@ ebl_core_note_type_name (Ebl *ebl, uint32_t type, char *buf, size_t len)
KNOWNSTYPE (PPC_VMX);
KNOWNSTYPE (PPC_SPE);
KNOWNSTYPE (PPC_VSX);
+ KNOWNSTYPE (PPC_TM_SPR);
KNOWNSTYPE (386_TLS);
KNOWNSTYPE (386_IOPERM);
KNOWNSTYPE (X86_XSTATE);
diff --git a/libebl/eblopenbackend.c b/libebl/eblopenbackend.c
index 4048f124..05a28fce 100644
--- a/libebl/eblopenbackend.c
+++ b/libebl/eblopenbackend.c
@@ -1,5 +1,5 @@
/* Generate ELF backend handle.
- Copyright (C) 2000-2016 Red Hat, Inc.
+ Copyright (C) 2000-2017 Red Hat, Inc.
This file is part of elfutils.
This file is free software; you can redistribute it and/or modify
@@ -183,6 +183,7 @@ 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_data_marker_symbol (const GElf_Sym *sym, const char *sname);
static bool default_check_st_other_bits (unsigned char st_other);
static bool default_check_special_section (Ebl *, int,
const GElf_Shdr *, const char *);
@@ -234,6 +235,7 @@ fill_defaults (Ebl *result)
result->none_reloc_p = default_none_reloc_p;
result->relative_reloc_p = default_relative_reloc_p;
result->check_special_symbol = default_check_special_symbol;
+ result->data_marker_symbol = default_data_marker_symbol;
result->check_st_other_bits = default_check_st_other_bits;
result->bss_plt_p = default_bss_plt_p;
result->return_value_location = default_return_value_location;
@@ -676,6 +678,13 @@ default_check_special_symbol (Elf *elf __attribute__ ((unused)),
}
static bool
+default_data_marker_symbol (const GElf_Sym *sym __attribute__ ((unused)),
+ const char *sname __attribute__ ((unused)))
+{
+ return false;
+}
+
+static bool
default_check_st_other_bits (unsigned char st_other __attribute__ ((unused)))
{
return false;
diff --git a/libebl/libebl.h b/libebl/libebl.h
index 87896e4a..882bdb99 100644
--- a/libebl/libebl.h
+++ b/libebl/libebl.h
@@ -1,5 +1,5 @@
/* Interface for libebl.
- Copyright (C) 2000-2010, 2013, 2014, 2015, 2016 Red Hat, Inc.
+ Copyright (C) 2000-2010, 2013, 2014, 2015, 2016, 2017 Red Hat, Inc.
This file is part of elfutils.
This file is free software; you can redistribute it and/or modify
@@ -156,6 +156,10 @@ extern bool ebl_check_special_symbol (Ebl *ebl, GElf_Ehdr *ehdr,
const GElf_Sym *sym, const char *name,
const GElf_Shdr *destshdr);
+/* Check if this is a data marker symbol. e.g. '$d' symbols for ARM. */
+extern bool ebl_data_marker_symbol (Ebl *ebl, const GElf_Sym *sym,
+ const char *sname);
+
/* Check whether only valid bits are set on the st_other symbol flag. */
extern bool ebl_check_st_other_bits (Ebl *ebl, unsigned char st_other);