summaryrefslogtreecommitdiffstats
path: root/contrib/elftoolchain
diff options
context:
space:
mode:
authoremaste <emaste@FreeBSD.org>2015-02-17 15:19:58 +0000
committeremaste <emaste@FreeBSD.org>2015-02-17 15:19:58 +0000
commita86377a7d01dfcfb77f8143e978090043e18a3e3 (patch)
tree65fc99ea4efa2057bf8a6b447baa2342b366deeb /contrib/elftoolchain
parent5f3f4bfe491165db0726ce40105a452890cd5dfb (diff)
downloadFreeBSD-src-a86377a7d01dfcfb77f8143e978090043e18a3e3.zip
FreeBSD-src-a86377a7d01dfcfb77f8143e978090043e18a3e3.tar.gz
Update elftoolchain to upstream revision 3163
Most of our changes have now been committed upstream, so this change is largely bookkeeping. Sponsored by: The FreeBSD Foundation
Diffstat (limited to 'contrib/elftoolchain')
-rw-r--r--contrib/elftoolchain/addr2line/addr2line.c2
-rw-r--r--contrib/elftoolchain/common/_elftc.h15
-rw-r--r--contrib/elftoolchain/common/elfdefinitions.h9
-rw-r--r--contrib/elftoolchain/elfcopy/main.c2
-rw-r--r--contrib/elftoolchain/elfcopy/sections.c2
-rw-r--r--contrib/elftoolchain/libdwarf/_libdwarf.h2
-rw-r--r--contrib/elftoolchain/libdwarf/dwarf_attrval.c2
-rw-r--r--contrib/elftoolchain/libdwarf/dwarf_get_AT_name.32
-rw-r--r--contrib/elftoolchain/libdwarf/dwarf_get_arange_info.32
-rw-r--r--contrib/elftoolchain/libdwarf/dwarf_get_section_max_offsets.36
-rw-r--r--contrib/elftoolchain/libdwarf/dwarf_hasattr.32
-rw-r--r--contrib/elftoolchain/libdwarf/dwarf_reloc.c2
-rw-r--r--contrib/elftoolchain/libdwarf/dwarf_set_reloc_application.32
-rw-r--r--contrib/elftoolchain/libdwarf/dwarf_whatattr.32
-rw-r--r--contrib/elftoolchain/libdwarf/libdwarf.c2
-rw-r--r--contrib/elftoolchain/libdwarf/libdwarf.h2
-rw-r--r--contrib/elftoolchain/libdwarf/libdwarf_elf_init.c2
-rw-r--r--contrib/elftoolchain/libdwarf/libdwarf_reloc.c2
-rw-r--r--contrib/elftoolchain/libelf/_libelf_config.h2
-rw-r--r--contrib/elftoolchain/libelf/elf.32
-rw-r--r--contrib/elftoolchain/libelf/elf_scn.c2
-rw-r--r--contrib/elftoolchain/libelf/libelf_ar_util.c3
-rw-r--r--contrib/elftoolchain/libelf/libelf_convert.m42
-rw-r--r--contrib/elftoolchain/nm/nm.14
-rw-r--r--contrib/elftoolchain/nm/nm.c2
-rw-r--r--contrib/elftoolchain/readelf/readelf.c46
26 files changed, 83 insertions, 40 deletions
diff --git a/contrib/elftoolchain/addr2line/addr2line.c b/contrib/elftoolchain/addr2line/addr2line.c
index e1db599..6dcf19c 100644
--- a/contrib/elftoolchain/addr2line/addr2line.c
+++ b/contrib/elftoolchain/addr2line/addr2line.c
@@ -40,7 +40,7 @@
#include "_elftc.h"
-ELFTC_VCSID("$Id: addr2line.c 2185 2011-11-19 16:07:16Z jkoshy $");
+ELFTC_VCSID("$Id: addr2line.c 3148 2015-02-15 18:47:39Z emaste $");
static struct option longopts[] = {
{"target" , required_argument, NULL, 'b'},
diff --git a/contrib/elftoolchain/common/_elftc.h b/contrib/elftoolchain/common/_elftc.h
index 0b8c77c..d6c8784 100644
--- a/contrib/elftoolchain/common/_elftc.h
+++ b/contrib/elftoolchain/common/_elftc.h
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: _elftc.h 2922 2013-03-17 22:53:15Z kaiwang27 $
+ * $Id: _elftc.h 3139 2015-01-05 03:17:06Z kaiwang27 $
*/
/**
@@ -76,10 +76,17 @@
* SUCH DAMAGE.
*/
+#ifndef LIST_FOREACH_SAFE
+#define LIST_FOREACH_SAFE(var, head, field, tvar) \
+ for ((var) = LIST_FIRST((head)); \
+ (var) && ((tvar) = LIST_NEXT((var), field), 1); \
+ (var) = (tvar))
+#endif
+
#ifndef SLIST_FOREACH_SAFE
-#define SLIST_FOREACH_SAFE(var, head, field, tvar) \
- for ((var) = SLIST_FIRST((head)); \
- (var) && ((tvar) = SLIST_NEXT((var), field), 1); \
+#define SLIST_FOREACH_SAFE(var, head, field, tvar) \
+ for ((var) = SLIST_FIRST((head)); \
+ (var) && ((tvar) = SLIST_NEXT((var), field), 1); \
(var) = (tvar))
#endif
diff --git a/contrib/elftoolchain/common/elfdefinitions.h b/contrib/elftoolchain/common/elfdefinitions.h
index 8b28aeb..f0a2fc2 100644
--- a/contrib/elftoolchain/common/elfdefinitions.h
+++ b/contrib/elftoolchain/common/elfdefinitions.h
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: elfdefinitions.h 3110 2014-12-20 08:32:46Z kaiwang27 $
+ * $Id: elfdefinitions.h 3149 2015-02-15 19:00:06Z emaste $
*/
/*
@@ -1396,6 +1396,12 @@ _ELF_DEFINE_RELOC(R_386_8, 22) \
_ELF_DEFINE_RELOC(R_386_PC8, 23)
/*
+ */
+#define _ELF_DEFINE_AARCH64_RELOCATIONS() \
+_ELF_DEFINE_RELOC(R_AARCH64_ABS64, 257) \
+_ELF_DEFINE_RELOC(R_AARCH64_ABS32, 258) \
+
+/*
* These are the symbols used in the Sun ``Linkers and Loaders
* Guide'', Document No: 817-1984-17. See the X86_64 relocations list
* below for the spellings used in the ELF specification.
@@ -1962,6 +1968,7 @@ _ELF_DEFINE_RELOC(R_X86_64_IRELATIVE, 37)
#define _ELF_DEFINE_RELOCATIONS() \
_ELF_DEFINE_386_RELOCATIONS() \
+_ELF_DEFINE_AARCH64_RELOCATIONS() \
_ELF_DEFINE_AMD64_RELOCATIONS() \
_ELF_DEFINE_ARM_RELOCATIONS() \
_ELF_DEFINE_IA64_RELOCATIONS() \
diff --git a/contrib/elftoolchain/elfcopy/main.c b/contrib/elftoolchain/elfcopy/main.c
index 4a693ca..e5bea86 100644
--- a/contrib/elftoolchain/elfcopy/main.c
+++ b/contrib/elftoolchain/elfcopy/main.c
@@ -40,7 +40,7 @@
#include "elfcopy.h"
-ELFTC_VCSID("$Id: main.c 3111 2014-12-20 08:33:01Z kaiwang27 $");
+ELFTC_VCSID("$Id: main.c 3156 2015-02-15 21:40:01Z emaste $");
enum options
{
diff --git a/contrib/elftoolchain/elfcopy/sections.c b/contrib/elftoolchain/elfcopy/sections.c
index 4d23bc7..ee6d172 100644
--- a/contrib/elftoolchain/elfcopy/sections.c
+++ b/contrib/elftoolchain/elfcopy/sections.c
@@ -35,7 +35,7 @@
#include "elfcopy.h"
-ELFTC_VCSID("$Id: sections.c 3134 2014-12-23 10:43:59Z kaiwang27 $");
+ELFTC_VCSID("$Id: sections.c 3150 2015-02-15 19:07:46Z emaste $");
static void add_gnu_debuglink(struct elfcopy *ecp);
static uint32_t calc_crc32(const char *p, size_t len, uint32_t crc);
diff --git a/contrib/elftoolchain/libdwarf/_libdwarf.h b/contrib/elftoolchain/libdwarf/_libdwarf.h
index a7669e2..06413be 100644
--- a/contrib/elftoolchain/libdwarf/_libdwarf.h
+++ b/contrib/elftoolchain/libdwarf/_libdwarf.h
@@ -24,7 +24,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: _libdwarf.h 3106 2014-12-19 16:00:58Z kaiwang27 $
+ * $Id: _libdwarf.h 3161 2015-02-15 21:43:36Z emaste $
*/
#ifndef __LIBDWARF_H_
diff --git a/contrib/elftoolchain/libdwarf/dwarf_attrval.c b/contrib/elftoolchain/libdwarf/dwarf_attrval.c
index 179deed..0dd38a4 100644
--- a/contrib/elftoolchain/libdwarf/dwarf_attrval.c
+++ b/contrib/elftoolchain/libdwarf/dwarf_attrval.c
@@ -26,7 +26,7 @@
#include "_libdwarf.h"
-ELFTC_VCSID("$Id: dwarf_attrval.c 2977 2014-01-21 20:13:31Z kaiwang27 $");
+ELFTC_VCSID("$Id: dwarf_attrval.c 3159 2015-02-15 21:43:27Z emaste $");
int
dwarf_attrval_flag(Dwarf_Die die, Dwarf_Half attr, Dwarf_Bool *valp, Dwarf_Error *err)
diff --git a/contrib/elftoolchain/libdwarf/dwarf_get_AT_name.3 b/contrib/elftoolchain/libdwarf/dwarf_get_AT_name.3
index e88e3cf..473adc3 100644
--- a/contrib/elftoolchain/libdwarf/dwarf_get_AT_name.3
+++ b/contrib/elftoolchain/libdwarf/dwarf_get_AT_name.3
@@ -22,7 +22,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $Id: dwarf_get_AT_name.3 2071 2011-10-27 03:20:00Z jkoshy $
+.\" $Id: dwarf_get_AT_name.3 3142 2015-01-29 23:11:14Z jkoshy $
.\"
.Dd April 22, 2011
.Os
diff --git a/contrib/elftoolchain/libdwarf/dwarf_get_arange_info.3 b/contrib/elftoolchain/libdwarf/dwarf_get_arange_info.3
index 2e67871..3878edd 100644
--- a/contrib/elftoolchain/libdwarf/dwarf_get_arange_info.3
+++ b/contrib/elftoolchain/libdwarf/dwarf_get_arange_info.3
@@ -22,7 +22,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $Id: dwarf_get_arange_info.3 2134 2011-11-10 08:40:14Z jkoshy $
+.\" $Id: dwarf_get_arange_info.3 3142 2015-01-29 23:11:14Z jkoshy $
.\"
.Dd April 16, 2011
.Os
diff --git a/contrib/elftoolchain/libdwarf/dwarf_get_section_max_offsets.3 b/contrib/elftoolchain/libdwarf/dwarf_get_section_max_offsets.3
index 6f79341..963d4ac 100644
--- a/contrib/elftoolchain/libdwarf/dwarf_get_section_max_offsets.3
+++ b/contrib/elftoolchain/libdwarf/dwarf_get_section_max_offsets.3
@@ -22,9 +22,9 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $Id: dwarf_get_section_max_offsets.3 3098 2014-09-02 22:18:29Z kaiwang27 $
+.\" $Id: dwarf_get_section_max_offsets.3 3141 2015-01-29 23:11:10Z jkoshy $
.\"
-.Dd July 27, 2014
+.Dd December 21, 2014
.Os
.Dt DWARF_GET_SECTION_MAX_OFFSETS
.Sh NAME
@@ -101,7 +101,7 @@ is identical to function
.Fn dwarf_get_section_max_offsets_b
except that it does not provide argument
.Ar debug_types ,
-thus it can not retrieve the size of the
+and thus cannot return the size of the
.Dq \&.debug_types
section.
.Sh RETURN VALUES
diff --git a/contrib/elftoolchain/libdwarf/dwarf_hasattr.3 b/contrib/elftoolchain/libdwarf/dwarf_hasattr.3
index d3bcb27..5875848 100644
--- a/contrib/elftoolchain/libdwarf/dwarf_hasattr.3
+++ b/contrib/elftoolchain/libdwarf/dwarf_hasattr.3
@@ -22,7 +22,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $Id: dwarf_hasattr.3 2073 2011-10-27 03:30:47Z jkoshy $
+.\" $Id: dwarf_hasattr.3 3142 2015-01-29 23:11:14Z jkoshy $
.\"
.Dd April 17, 2010
.Os
diff --git a/contrib/elftoolchain/libdwarf/dwarf_reloc.c b/contrib/elftoolchain/libdwarf/dwarf_reloc.c
index c912f27..0430e4d 100644
--- a/contrib/elftoolchain/libdwarf/dwarf_reloc.c
+++ b/contrib/elftoolchain/libdwarf/dwarf_reloc.c
@@ -26,7 +26,7 @@
#include "_libdwarf.h"
-ELFTC_VCSID("$Id: dwarf_reloc.c 2075 2011-10-27 03:47:28Z jkoshy $");
+ELFTC_VCSID("$Id: dwarf_reloc.c 3161 2015-02-15 21:43:36Z emaste $");
int
dwarf_set_reloc_application(int apply)
diff --git a/contrib/elftoolchain/libdwarf/dwarf_set_reloc_application.3 b/contrib/elftoolchain/libdwarf/dwarf_set_reloc_application.3
index e62b262..db40cbb 100644
--- a/contrib/elftoolchain/libdwarf/dwarf_set_reloc_application.3
+++ b/contrib/elftoolchain/libdwarf/dwarf_set_reloc_application.3
@@ -22,7 +22,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $Id: dwarf_set_reloc_application.3 2075 2011-10-27 03:47:28Z jkoshy $
+.\" $Id: dwarf_set_reloc_application.3 3161 2015-02-15 21:43:36Z emaste $
.\"
.Dd February 11, 2015
.Os
diff --git a/contrib/elftoolchain/libdwarf/dwarf_whatattr.3 b/contrib/elftoolchain/libdwarf/dwarf_whatattr.3
index 96d9ad2..a975d3e 100644
--- a/contrib/elftoolchain/libdwarf/dwarf_whatattr.3
+++ b/contrib/elftoolchain/libdwarf/dwarf_whatattr.3
@@ -22,7 +22,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $Id: dwarf_whatattr.3 2075 2011-10-27 03:47:28Z jkoshy $
+.\" $Id: dwarf_whatattr.3 3142 2015-01-29 23:11:14Z jkoshy $
.\"
.Dd May 22, 2010
.Os
diff --git a/contrib/elftoolchain/libdwarf/libdwarf.c b/contrib/elftoolchain/libdwarf/libdwarf.c
index 961fe2c..b2406cb 100644
--- a/contrib/elftoolchain/libdwarf/libdwarf.c
+++ b/contrib/elftoolchain/libdwarf/libdwarf.c
@@ -26,7 +26,7 @@
#include "_libdwarf.h"
-ELFTC_VCSID("$Id: libdwarf.c 2070 2011-10-27 03:05:32Z jkoshy $");
+ELFTC_VCSID("$Id: libdwarf.c 3161 2015-02-15 21:43:36Z emaste $");
struct _libdwarf_globals _libdwarf = {
.errhand = NULL,
diff --git a/contrib/elftoolchain/libdwarf/libdwarf.h b/contrib/elftoolchain/libdwarf/libdwarf.h
index 20360a7..fdbcb4e 100644
--- a/contrib/elftoolchain/libdwarf/libdwarf.h
+++ b/contrib/elftoolchain/libdwarf/libdwarf.h
@@ -24,7 +24,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: libdwarf.h 3064 2014-06-06 19:35:55Z kaiwang27 $
+ * $Id: libdwarf.h 3149 2015-02-15 19:00:06Z emaste $
*/
#ifndef _LIBDWARF_H_
diff --git a/contrib/elftoolchain/libdwarf/libdwarf_elf_init.c b/contrib/elftoolchain/libdwarf/libdwarf_elf_init.c
index 731a20d..af2d370 100644
--- a/contrib/elftoolchain/libdwarf/libdwarf_elf_init.c
+++ b/contrib/elftoolchain/libdwarf/libdwarf_elf_init.c
@@ -26,7 +26,7 @@
#include "_libdwarf.h"
-ELFTC_VCSID("$Id: libdwarf_elf_init.c 2972 2013-12-23 06:46:04Z kaiwang27 $");
+ELFTC_VCSID("$Id: libdwarf_elf_init.c 3161 2015-02-15 21:43:36Z emaste $");
static const char *debug_name[] = {
".debug_abbrev",
diff --git a/contrib/elftoolchain/libdwarf/libdwarf_reloc.c b/contrib/elftoolchain/libdwarf/libdwarf_reloc.c
index e3bba67..96bb785 100644
--- a/contrib/elftoolchain/libdwarf/libdwarf_reloc.c
+++ b/contrib/elftoolchain/libdwarf/libdwarf_reloc.c
@@ -26,7 +26,7 @@
#include "_libdwarf.h"
-ELFTC_VCSID("$Id: libdwarf_reloc.c 2948 2013-05-30 21:25:52Z kaiwang27 $");
+ELFTC_VCSID("$Id: libdwarf_reloc.c 3149 2015-02-15 19:00:06Z emaste $");
Dwarf_Unsigned
_dwarf_get_reloc_type(Dwarf_P_Debug dbg, int is64)
diff --git a/contrib/elftoolchain/libelf/_libelf_config.h b/contrib/elftoolchain/libelf/_libelf_config.h
index 2ad0630..45d8714 100644
--- a/contrib/elftoolchain/libelf/_libelf_config.h
+++ b/contrib/elftoolchain/libelf/_libelf_config.h
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: _libelf_config.h 2287 2011-12-04 06:45:47Z jkoshy $
+ * $Id: _libelf_config.h 3143 2015-02-15 17:57:38Z emaste $
*/
#ifdef __DragonFly__
diff --git a/contrib/elftoolchain/libelf/elf.3 b/contrib/elftoolchain/libelf/elf.3
index e057a92..618b4f7 100644
--- a/contrib/elftoolchain/libelf/elf.3
+++ b/contrib/elftoolchain/libelf/elf.3
@@ -21,7 +21,7 @@
.\" out of the use of this software, even if advised of the possibility of
.\" such damage.
.\"
-.\" $Id: elf.3 3082 2014-07-28 09:13:33Z jkoshy $
+.\" $Id: elf.3 3142 2015-01-29 23:11:14Z jkoshy $
.\"
.Dd July 28, 2014
.Os
diff --git a/contrib/elftoolchain/libelf/elf_scn.c b/contrib/elftoolchain/libelf/elf_scn.c
index 9a9c816..0d1ac5c 100644
--- a/contrib/elftoolchain/libelf/elf_scn.c
+++ b/contrib/elftoolchain/libelf/elf_scn.c
@@ -37,7 +37,7 @@
#include "_libelf.h"
-ELFTC_VCSID("$Id: elf_scn.c 3013 2014-03-23 06:16:59Z jkoshy $");
+ELFTC_VCSID("$Id: elf_scn.c 3147 2015-02-15 18:45:23Z emaste $");
/*
* Load an ELF section table and create a list of Elf_Scn structures.
diff --git a/contrib/elftoolchain/libelf/libelf_ar_util.c b/contrib/elftoolchain/libelf/libelf_ar_util.c
index 62630ac..7b824fb 100644
--- a/contrib/elftoolchain/libelf/libelf_ar_util.c
+++ b/contrib/elftoolchain/libelf/libelf_ar_util.c
@@ -34,7 +34,7 @@
#include "_libelf.h"
#include "_libelf_ar.h"
-ELFTC_VCSID("$Id: libelf_ar_util.c 3013 2014-03-23 06:16:59Z jkoshy $");
+ELFTC_VCSID("$Id: libelf_ar_util.c 3157 2015-02-15 21:42:02Z emaste $");
/*
* Convert a string bounded by `start' and `start+sz' (exclusive) to a
@@ -278,7 +278,6 @@ _libelf_ar_open(Elf *e, int reporterror)
* Handle special archive members for the SVR4 format.
*/
if (arh.ar_name[0] == '/') {
-
if (sz == 0)
goto error;
diff --git a/contrib/elftoolchain/libelf/libelf_convert.m4 b/contrib/elftoolchain/libelf/libelf_convert.m4
index a11ace4..f400367 100644
--- a/contrib/elftoolchain/libelf/libelf_convert.m4
+++ b/contrib/elftoolchain/libelf/libelf_convert.m4
@@ -32,7 +32,7 @@
#include "_libelf.h"
-ELFTC_VCSID("$Id: libelf_convert.m4 3009 2014-03-23 01:49:59Z jkoshy $");
+ELFTC_VCSID("$Id: libelf_convert.m4 3158 2015-02-15 21:42:07Z emaste $");
/* WARNING: GENERATED FROM __file__. */
diff --git a/contrib/elftoolchain/nm/nm.1 b/contrib/elftoolchain/nm/nm.1
index d9a0325..35439e4 100644
--- a/contrib/elftoolchain/nm/nm.1
+++ b/contrib/elftoolchain/nm/nm.1
@@ -22,9 +22,9 @@
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
-.\" $Id: nm.1 2377 2012-01-03 07:10:59Z jkoshy $
+.\" $Id: nm.1 3145 2015-02-15 18:04:37Z emaste $
.\"
-.Dd January 8, 2015
+.Dd February 15, 2015
.Os
.Dt NM 1
.Sh NAME
diff --git a/contrib/elftoolchain/nm/nm.c b/contrib/elftoolchain/nm/nm.c
index 8d9cbbd..f984966 100644
--- a/contrib/elftoolchain/nm/nm.c
+++ b/contrib/elftoolchain/nm/nm.c
@@ -48,7 +48,7 @@
#include "_elftc.h"
-ELFTC_VCSID("$Id: nm.c 3124 2014-12-21 05:46:28Z kaiwang27 $");
+ELFTC_VCSID("$Id: nm.c 3145 2015-02-15 18:04:37Z emaste $");
/* symbol information list */
STAILQ_HEAD(sym_head, sym_entry);
diff --git a/contrib/elftoolchain/readelf/readelf.c b/contrib/elftoolchain/readelf/readelf.c
index a8c15c4..93e53a1 100644
--- a/contrib/elftoolchain/readelf/readelf.c
+++ b/contrib/elftoolchain/readelf/readelf.c
@@ -47,7 +47,7 @@
#include "_elftc.h"
-ELFTC_VCSID("$Id: readelf.c 3110 2014-12-20 08:32:46Z kaiwang27 $");
+ELFTC_VCSID("$Id: readelf.c 3155 2015-02-15 19:15:57Z emaste $");
/*
* readelf(1) options.
@@ -1503,7 +1503,8 @@ r_type(unsigned int mach, unsigned int type)
static const char *
note_type(const char *name, unsigned int et, unsigned int nt)
{
- if (strcmp(name, "CORE") == 0 && et == ET_CORE)
+ if ((strcmp(name, "CORE") == 0 || strcmp(name, "LINUX") == 0) &&
+ et == ET_CORE)
return note_type_linux_core(nt);
else if (strcmp(name, "FreeBSD") == 0)
if (et == ET_CORE)
@@ -1559,13 +1560,27 @@ note_type_linux_core(unsigned int nt)
case 1: return "NT_PRSTATUS (Process status)";
case 2: return "NT_FPREGSET (Floating point information)";
case 3: return "NT_PRPSINFO (Process information)";
+ case 4: return "NT_TASKSTRUCT (Task structure)";
case 6: return "NT_AUXV (Auxiliary vector)";
- case 0x46E62B7FUL: return "NT_PRXFPREG (Linux user_xfpregs structure)";
case 10: return "NT_PSTATUS (Linux process status)";
case 12: return "NT_FPREGS (Linux floating point regset)";
case 13: return "NT_PSINFO (Linux process information)";
case 16: return "NT_LWPSTATUS (Linux lwpstatus_t type)";
case 17: return "NT_LWPSINFO (Linux lwpinfo_t type)";
+ case 18: return "NT_WIN32PSTATUS (win32_pstatus structure)";
+ case 0x100: return "NT_PPC_VMX (ppc Altivec registers)";
+ case 0x102: return "NT_PPC_VSX (ppc VSX registers)";
+ case 0x202: return "NT_X86_XSTATE (x86 XSAVE extended state)";
+ case 0x300: return "NT_S390_HIGH_GPRS (s390 upper register halves)";
+ case 0x301: return "NT_S390_TIMER (s390 timer register)";
+ case 0x302: return "NT_S390_TODCMP (s390 TOD comparator register)";
+ case 0x303: return "NT_S390_TODPREG (s390 TOD programmable register)";
+ case 0x304: return "NT_S390_CTRS (s390 control registers)";
+ case 0x305: return "NT_S390_PREFIX (s390 prefix register)";
+ case 0x400: return "NT_ARM_VFP (arm VFP registers)";
+ case 0x46494c45UL: return "NT_FILE (mapped files)";
+ case 0x46E62B7FUL: return "NT_PRXFPREG (Linux user_xfpregs structure)";
+ case 0x53494749UL: return "NT_SIGINFO (siginfo_t data)";
default: return (note_type_unknown(nt));
}
}
@@ -1605,7 +1620,8 @@ note_type_unknown(unsigned int nt)
{
static char s_nt[32];
- snprintf(s_nt, sizeof(s_nt), "<unknown: %u>", nt);
+ snprintf(s_nt, sizeof(s_nt),
+ nt >= 0x100 ? "<unknown: 0x%x>" : "<unknown: %u>", nt);
return (s_nt);
}
@@ -3154,6 +3170,10 @@ dump_rel(struct readelf *re, struct section *s, Elf_Data *d)
warnx("gelf_getrel failed: %s", elf_errmsg(-1));
continue;
}
+ if (s->link >= re->shnum) {
+ warnx("invalid section link index %u", s->link);
+ continue;
+ }
symname = get_symbol_name(re, s->link, GELF_R_SYM(r.r_info));
symval = get_symbol_value(re, s->link, GELF_R_SYM(r.r_info));
if (re->ec == ELFCLASS32) {
@@ -3206,6 +3226,10 @@ dump_rela(struct readelf *re, struct section *s, Elf_Data *d)
warnx("gelf_getrel failed: %s", elf_errmsg(-1));
continue;
}
+ if (s->link >= re->shnum) {
+ warnx("invalid section link index %u", s->link);
+ continue;
+ }
symname = get_symbol_name(re, s->link, GELF_R_SYM(r.r_info));
symval = get_symbol_value(re, s->link, GELF_R_SYM(r.r_info));
if (re->ec == ELFCLASS32) {
@@ -4219,14 +4243,22 @@ dump_attributes(struct readelf *re)
len = d->d_size - 1;
p++;
while (len > 0) {
+ if (len < 4) {
+ warnx("truncated attribute section length");
+ break;
+ }
seclen = re->dw_decode(&p, 4);
if (seclen > len) {
warnx("invalid attribute section length");
break;
}
len -= seclen;
- printf("Attribute Section: %s\n", (char *) p);
nlen = strlen((char *) p) + 1;
+ if (nlen + 4 > seclen) {
+ warnx("invalid attribute section name");
+ break;
+ }
+ printf("Attribute Section: %s\n", (char *) p);
p += nlen;
seclen -= nlen + 4;
while (seclen > 0) {
@@ -6696,10 +6728,8 @@ load_sections(struct readelf *re)
return;
}
- if ((scn = elf_getscn(re->elf, 0)) == NULL) {
- warnx("elf_getscn failed: %s", elf_errmsg(-1));
+ if ((scn = elf_getscn(re->elf, 0)) == NULL)
return;
- }
(void) elf_errno();
do {
OpenPOWER on IntegriCloud