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
This commit is contained in:
parent
5f3f4bfe49
commit
a86377a7d0
@ -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'},
|
||||
|
@ -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
|
||||
|
||||
|
@ -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 $
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -1395,6 +1395,12 @@ _ELF_DEFINE_RELOC(R_386_PC16, 21) \
|
||||
_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
|
||||
@ -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() \
|
||||
|
@ -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
|
||||
{
|
||||
|
@ -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);
|
||||
|
@ -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_
|
||||
|
@ -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)
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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)
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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,
|
||||
|
@ -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_
|
||||
|
@ -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",
|
||||
|
@ -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)
|
||||
|
@ -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__
|
||||
|
@ -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
|
||||
|
@ -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.
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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__. */
|
||||
|
||||
|
@ -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
|
||||
|
@ -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);
|
||||
|
@ -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 {
|
||||
|
@ -6,5 +6,5 @@
|
||||
const char *
|
||||
elftc_version(void)
|
||||
{
|
||||
return "elftoolchain r3136M";
|
||||
return "elftoolchain r3163M";
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user