Update ELF Tool Chain to r3614

MFC after:	1 week
Relnotes:	Yes
Sponsored by:	The FreeBSD Foundation
This commit is contained in:
emaste 2018-04-27 13:59:24 +00:00
parent 98e4f07e02
commit 994b0b9af9
23 changed files with 56 additions and 48 deletions

@ -1,4 +1,4 @@
# $Id: Makefile 3107 2014-12-20 08:31:58Z kaiwang27 $ # $Id: Makefile 3608 2018-04-14 21:23:04Z jkoshy $
TOP= .. TOP= ..
@ -32,4 +32,6 @@ ${EXTRA_TARGETS}: ${PROG}
.if ${OS_HOST} == "OpenBSD" .if ${OS_HOST} == "OpenBSD"
CFLAGS+= -I/usr/local/include CFLAGS+= -I/usr/local/include
LDFLAGS+= -L/usr/local/lib LDFLAGS+= -L/usr/local/lib
.elif ${OS_HOST} == "DragonFly"
LDADD+= -lbz2
.endif .endif

@ -1,4 +1,4 @@
# $Id: Makefile 3022 2014-04-17 18:05:58Z jkoshy $ # $Id: Makefile 3594 2018-04-11 18:26:50Z jkoshy $
TOP= .. TOP= ..
@ -7,12 +7,12 @@ INCSDIR= /usr/include
.PHONY: all clean clobber depend obj .PHONY: all clean clobber depend obj
all depend obj: all depend:
clean clobber: clean clobber:
rm -f ${CLEANFILES} rm -f ${CLEANFILES}
cleandepend: cleandepend:
rm -f .depend rm -f ${.OBJDIR}/.depend
.include "${TOP}/mk/elftoolchain.inc.mk" .include "${TOP}/mk/elftoolchain.inc.mk"

@ -1,13 +1,15 @@
# #
# Build recipes for Linux based operating systems. # Build recipes for Linux based operating systems.
# #
# $Id: os.Linux.mk 2064 2011-10-26 15:12:32Z jkoshy $ # $Id: os.Linux.mk 3594 2018-04-11 18:26:50Z jkoshy $
_NATIVE_ELF_FORMAT = native-elf-format _NATIVE_ELF_FORMAT = native-elf-format
.BEGIN: ${_NATIVE_ELF_FORMAT}.h .if !make(obj)
.BEGIN: ${.OBJDIR}/${_NATIVE_ELF_FORMAT}.h
${_NATIVE_ELF_FORMAT}.h: ${.OBJDIR}/${_NATIVE_ELF_FORMAT}.h:
${.CURDIR}/${_NATIVE_ELF_FORMAT} > ${.TARGET} || rm ${.TARGET} ${.CURDIR}/${_NATIVE_ELF_FORMAT} > ${.TARGET} || rm ${.TARGET}
.endif
CLEANFILES += ${_NATIVE_ELF_FORMAT}.h CLEANFILES += ${.OBJDIR}/${_NATIVE_ELF_FORMAT}.h

@ -1,4 +1,4 @@
# $Id: Makefile 3381 2016-01-30 19:39:47Z jkoshy $ # $Id: Makefile 3608 2018-04-14 21:23:04Z jkoshy $
TOP= .. TOP= ..
@ -18,7 +18,7 @@ LDADD= -lelf -lelftc
LDADD+= -larchive LDADD+= -larchive
.endif .endif
.if defined(WITH_PE) && ${WITH_PE:tl} == "yes" .if defined(WITH_PE) && ${WITH_PE} == "yes"
SRCS+= pe.c SRCS+= pe.c
CFLAGS+= -DWITH_PE=1 CFLAGS+= -DWITH_PE=1
@ -51,4 +51,6 @@ ${EXTRA_TARGETS}: ${PROG}
.if ${OS_HOST} == "OpenBSD" .if ${OS_HOST} == "OpenBSD"
CFLAGS+= -I/usr/local/include CFLAGS+= -I/usr/local/include
LDFLAGS+= -L/usr/local/lib LDFLAGS+= -L/usr/local/lib
.elif ${OS_HOST} == "DragonFly"
LDADD+= -lbz2
.endif .endif

@ -36,7 +36,7 @@
#include "elfcopy.h" #include "elfcopy.h"
ELFTC_VCSID("$Id: binary.c 3445 2016-04-20 19:08:30Z emaste $"); ELFTC_VCSID("$Id: binary.c 3611 2018-04-16 21:35:18Z jkoshy $");
/* /*
* Convert ELF object to `binary'. Sections with SHF_ALLOC flag set * Convert ELF object to `binary'. Sections with SHF_ALLOC flag set
@ -215,7 +215,7 @@ create_elf_from_binary(struct elfcopy *ecp, int ifd, const char *ifn)
if ((sym_basename = strdup(ifn)) == NULL) if ((sym_basename = strdup(ifn)) == NULL)
err(1, "strdup"); err(1, "strdup");
for (p = sym_basename; *p != '\0'; p++) for (p = sym_basename; *p != '\0'; p++)
if (!isalnum(*p)) if (!isalnum(*p & 0xFF))
*p = '_'; *p = '_';
#define _GEN_SYMNAME(S) do { \ #define _GEN_SYMNAME(S) do { \
snprintf(name, sizeof(name), "%s%s%s", "_binary_", sym_basename, S); \ snprintf(name, sizeof(name), "%s%s%s", "_binary_", sym_basename, S); \

@ -21,9 +21,9 @@
.\" out of the use of this software, even if advised of the possibility of .\" out of the use of this software, even if advised of the possibility of
.\" such damage. .\" such damage.
.\" .\"
.\" $Id: elfcopy.1 3426 2016-03-05 13:32:28Z emaste $ .\" $Id: elfcopy.1 3565 2017-08-31 02:24:19Z emaste $
.\" .\"
.Dd April 20, 2017 .Dd August 30, 2017
.Os .Os
.Dt ELFCOPY 1 .Dt ELFCOPY 1
.Sh NAME .Sh NAME

@ -39,7 +39,7 @@
#include "elfcopy.h" #include "elfcopy.h"
ELFTC_VCSID("$Id: main.c 3520 2017-04-17 01:47:52Z kaiwang27 $"); ELFTC_VCSID("$Id: main.c 3577 2017-09-14 02:19:42Z emaste $");
enum options enum options
{ {

@ -50,7 +50,7 @@
#include "_elftc.h" #include "_elftc.h"
ELFTC_VCSID("$Id: elfdump.c 3521 2017-06-04 20:07:09Z jkoshy $"); ELFTC_VCSID("$Id: elfdump.c 3584 2017-11-05 20:51:43Z jkoshy $");
#if defined(ELFTC_NEED_ELF_NOTE_DEFINITION) #if defined(ELFTC_NEED_ELF_NOTE_DEFINITION)
#include "native-elf-format.h" #include "native-elf-format.h"
@ -915,7 +915,7 @@ elf_print_ar(struct elfdump *ed, int fd)
Elf_Arhdr *arh; Elf_Arhdr *arh;
Elf_Arsym *arsym; Elf_Arsym *arsym;
Elf_Cmd cmd; Elf_Cmd cmd;
char idx[10]; char idx[21];
size_t cnt, i; size_t cnt, i;
ed->ar = ed->elf; ed->ar = ed->elf;
@ -1496,7 +1496,7 @@ elf_print_symtab(struct elfdump *ed, int i)
struct section *s; struct section *s;
const char *name; const char *name;
uint16_t *vs; uint16_t *vs;
char idx[10]; char idx[13];
Elf_Data *data; Elf_Data *data;
GElf_Sym sym; GElf_Sym sym;
int len, j, elferr, nvs; int len, j, elferr, nvs;
@ -1590,7 +1590,7 @@ elf_print_dynamic(struct elfdump *ed)
{ {
struct section *s; struct section *s;
const char *name; const char *name;
char idx[10]; char idx[13];
Elf_Data *data; Elf_Data *data;
GElf_Dyn dyn; GElf_Dyn dyn;
int elferr, i, len; int elferr, i, len;
@ -2052,7 +2052,7 @@ elf_print_note(struct elfdump *ed)
size_t count; size_t count;
int elferr, i; int elferr, i;
uint8_t *src; uint8_t *src;
char idx[10]; char idx[17];
s = NULL; s = NULL;
for (i = 0; (size_t)i < ed->shnum; i++) { for (i = 0; (size_t)i < ed->shnum; i++) {

@ -1,6 +1,6 @@
# $Id: Makefile 3097 2014-09-02 22:10:18Z kaiwang27 $ # $Id: Makefile 3594 2018-04-11 18:26:50Z jkoshy $
TOP= ${.CURDIR}/.. TOP= ..
LIB= dwarf LIB= dwarf

@ -24,7 +24,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. * SUCH DAMAGE.
* *
* $Id: libdwarf.h 3295 2016-01-08 22:08:10Z jkoshy $ * $Id: libdwarf.h 3578 2017-09-14 02:21:28Z emaste $
*/ */
#ifndef _LIBDWARF_H_ #ifndef _LIBDWARF_H_

@ -26,7 +26,7 @@
#include "_libdwarf.h" #include "_libdwarf.h"
ELFTC_VCSID("$Id: libdwarf_frame.c 3106 2014-12-19 16:00:58Z kaiwang27 $"); ELFTC_VCSID("$Id: libdwarf_frame.c 3589 2018-03-13 20:34:33Z kaiwang27 $");
static int static int
_dwarf_frame_find_cie(Dwarf_FrameSec fs, Dwarf_Unsigned offset, _dwarf_frame_find_cie(Dwarf_FrameSec fs, Dwarf_Unsigned offset,
@ -142,6 +142,8 @@ _dwarf_frame_parse_lsb_cie_augment(Dwarf_Debug dbg, Dwarf_Cie cie,
augdata_p = cie->cie_augdata; augdata_p = cie->cie_augdata;
while (*aug_p != '\0') { while (*aug_p != '\0') {
switch (*aug_p) { switch (*aug_p) {
case 'S':
break;
case 'L': case 'L':
/* Skip one augment in augment data. */ /* Skip one augment in augment data. */
augdata_p++; augdata_p++;

@ -26,7 +26,7 @@
#include "_libdwarf.h" #include "_libdwarf.h"
ELFTC_VCSID("$Id: libdwarf_reloc.c 3198 2015-05-14 18:36:19Z emaste $"); ELFTC_VCSID("$Id: libdwarf_reloc.c 3578 2017-09-14 02:21:28Z emaste $");
Dwarf_Unsigned Dwarf_Unsigned
_dwarf_get_reloc_type(Dwarf_P_Debug dbg, int is64) _dwarf_get_reloc_type(Dwarf_P_Debug dbg, int is64)

@ -1,6 +1,6 @@
# $Id: Makefile 2605 2012-10-02 17:52:20Z jkoshy $ # $Id: Makefile 3594 2018-04-11 18:26:50Z jkoshy $
TOP= ${.CURDIR}/.. TOP= ..
LIB= elf LIB= elf

@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. * SUCH DAMAGE.
* *
* $Id: _libelf_config.h 3400 2016-02-12 18:38:49Z emaste $ * $Id: _libelf_config.h 3566 2017-08-31 02:28:40Z emaste $
*/ */
#if defined(__APPLE__) || defined(__DragonFly__) #if defined(__APPLE__) || defined(__DragonFly__)

@ -31,7 +31,7 @@
#include "_libelf.h" #include "_libelf.h"
ELFTC_VCSID("$Id: gelf_phdr.c 3177 2015-03-30 18:19:41Z emaste $"); ELFTC_VCSID("$Id: gelf_phdr.c 3576 2017-09-14 02:15:29Z emaste $");
Elf32_Phdr * Elf32_Phdr *
elf32_getphdr(Elf *e) elf32_getphdr(Elf *e)

@ -31,7 +31,7 @@
#include "_libelf.h" #include "_libelf.h"
ELFTC_VCSID("$Id: libelf_ehdr.c 3174 2015-03-27 17:13:41Z emaste $"); ELFTC_VCSID("$Id: libelf_ehdr.c 3575 2017-09-14 02:13:36Z emaste $");
/* /*
* Retrieve counts for sections, phdrs and the section string table index * Retrieve counts for sections, phdrs and the section string table index

@ -1,6 +1,6 @@
# $Id: Makefile 3489 2016-08-31 00:12:15Z emaste $ # $Id: Makefile 3601 2018-04-12 16:58:53Z jkoshy $
TOP= ${.CURDIR}/.. TOP= ..
LIB= elftc LIB= elftc
@ -28,7 +28,8 @@ SHLIB_MAJOR= 1
WARNS?= 6 WARNS?= 6
CLEANFILES+= elftc_version.c ELFTC_VERSION_FILE= ${.OBJDIR}/elftc_version.c
CLEANFILES+= ${ELFTC_VERSION_FILE}
LDADD+= -lelf LDADD+= -lelf
@ -50,10 +51,10 @@ MLINKS= elftc_bfd_find_target.3 elftc_bfd_target_byteorder.3 \
elftc_string_table_create.3 elftc_string_table_insert.3 \ elftc_string_table_create.3 elftc_string_table_insert.3 \
elftc_string_table_create.3 elftc_string_table_lookup.3 elftc_string_table_create.3 elftc_string_table_lookup.3
.if !make(clean) && !make(clobber) .if !make(clean) && !make(clobber) && !make(obj)
.BEGIN: .SILENT .BEGIN: .SILENT
${.CURDIR}/make-toolchain-version -t ${TOP} -r ${RELEASE} \ ${.CURDIR}/make-toolchain-version -t ${.CURDIR}/${TOP} \
-h ${OS_HOST} -r ${RELEASE} -h ${OS_HOST} -o ${ELFTC_VERSION_FILE}
.endif .endif
.include "${TOP}/mk/elftoolchain.lib.mk" .include "${TOP}/mk/elftoolchain.lib.mk"

@ -37,7 +37,7 @@
#include "_libelftc.h" #include "_libelftc.h"
ELFTC_VCSID("$Id: libelftc_dem_gnu3.c 3560 2017-06-25 00:28:23Z kaiwang27 $"); ELFTC_VCSID("$Id: libelftc_dem_gnu3.c 3583 2017-10-15 15:38:47Z emaste $");
/** /**
* @file cpp_demangle.c * @file cpp_demangle.c
@ -574,8 +574,7 @@ cpp_demangle_push_type_qualifier(struct cpp_demangle_data *ddata,
if (!DEM_PUSH_STR(ddata, " imaginary")) if (!DEM_PUSH_STR(ddata, " imaginary"))
goto clean; goto clean;
if (type_str != NULL) { if (type_str != NULL) {
if (!vector_str_push(&subst_v, " imaginary", if (!VEC_PUSH_STR(&subst_v, " imaginary"))
10))
goto clean; goto clean;
if (!cpp_demangle_push_subst_v(ddata, if (!cpp_demangle_push_subst_v(ddata,
&subst_v)) &subst_v))
@ -1616,8 +1615,7 @@ cpp_demangle_read_encoding(struct cpp_demangle_data *ddata)
case SIMPLE_HASH('T', 'v'): case SIMPLE_HASH('T', 'v'):
/* virtual function virtual override thunk */ /* virtual function virtual override thunk */
if (!DEM_PUSH_STR(ddata, if (!DEM_PUSH_STR(ddata, "virtual function virtual override "))
"virtual function virtual override "))
return (0); return (0);
ddata->cur += 2; ddata->cur += 2;
if (*ddata->cur == '\0') if (*ddata->cur == '\0')

@ -1,6 +1,6 @@
# $Id: Makefile 3349 2016-01-18 21:09:16Z jkoshy $ # $Id: Makefile 3594 2018-04-11 18:26:50Z jkoshy $
TOP= ${.CURDIR}/.. TOP= ..
LIB= pe LIB= pe

@ -22,9 +22,9 @@
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\" .\"
.\" $Id: nm.1 3195 2015-05-12 17:22:19Z emaste $ .\" $Id: nm.1 3573 2017-09-14 02:06:31Z emaste $
.\" .\"
.Dd May 21, 2017 .Dd September 13, 2017
.Os .Os
.Dt NM 1 .Dt NM 1
.Sh NAME .Sh NAME

@ -47,7 +47,7 @@
#include "_elftc.h" #include "_elftc.h"
ELFTC_VCSID("$Id: readelf.c 3519 2017-04-09 23:15:58Z kaiwang27 $"); ELFTC_VCSID("$Id: readelf.c 3580 2017-09-15 23:29:59Z emaste $");
/* Backwards compatability for older FreeBSD releases. */ /* Backwards compatability for older FreeBSD releases. */
#ifndef STB_GNU_UNIQUE #ifndef STB_GNU_UNIQUE
@ -822,6 +822,7 @@ dt_type(unsigned int mach, unsigned int dtype)
case DT_SUNW_RTLDINF: return "SUNW_RTLDINF"; case DT_SUNW_RTLDINF: return "SUNW_RTLDINF";
case DT_SUNW_FILTER: return "SUNW_FILTER"; case DT_SUNW_FILTER: return "SUNW_FILTER";
case DT_SUNW_CAP: return "SUNW_CAP"; case DT_SUNW_CAP: return "SUNW_CAP";
case DT_SUNW_ASLR: return "SUNW_ASLR";
case DT_CHECKSUM: return "CHECKSUM"; case DT_CHECKSUM: return "CHECKSUM";
case DT_PLTPADSZ: return "PLTPADSZ"; case DT_PLTPADSZ: return "PLTPADSZ";
case DT_MOVEENT: return "MOVEENT"; case DT_MOVEENT: return "MOVEENT";

@ -46,7 +46,7 @@
#include "_elftc.h" #include "_elftc.h"
ELFTC_VCSID("$Id: strings.c 3498 2016-10-26 19:25:13Z emaste $"); ELFTC_VCSID("$Id: strings.c 3571 2017-09-14 02:04:50Z emaste $");
enum radix_style { enum radix_style {
RADIX_DECIMAL, RADIX_DECIMAL,

@ -6,5 +6,5 @@
const char * const char *
elftc_version(void) elftc_version(void)
{ {
return "elftoolchain r3561M"; return "elftoolchain r3614M";
} }