diff options
author | emaste <emaste@FreeBSD.org> | 2016-02-12 18:18:49 +0000 |
---|---|---|
committer | emaste <emaste@FreeBSD.org> | 2016-02-12 18:18:49 +0000 |
commit | 8629882318b420fa69066d106434be2c546b649f (patch) | |
tree | 4faefe7161f44f1e96042cb888296d788a036e3d | |
parent | 85217dee0e24c5f3ac285420e843063b4b52c1a0 (diff) | |
download | FreeBSD-src-8629882318b420fa69066d106434be2c546b649f.zip FreeBSD-src-8629882318b420fa69066d106434be2c546b649f.tar.gz |
Import ELF Tool Chain snapshot revision 3399
From http://svn.code.sf.net/p/elftoolchain/code
-rw-r--r-- | elfcopy/main.c | 4 | ||||
-rw-r--r-- | elfcopy/segments.c | 4 | ||||
-rw-r--r-- | libelf/_libelf_config.h | 8 |
3 files changed, 12 insertions, 4 deletions
diff --git a/elfcopy/main.c b/elfcopy/main.c index 2054669..b51ba4e 100644 --- a/elfcopy/main.c +++ b/elfcopy/main.c @@ -39,7 +39,7 @@ #include "elfcopy.h" -ELFTC_VCSID("$Id: main.c 3381 2016-01-30 19:39:47Z jkoshy $"); +ELFTC_VCSID("$Id: main.c 3399 2016-02-12 18:07:56Z emaste $"); enum options { @@ -316,6 +316,7 @@ create_elf(struct elfcopy *ecp) oeh.e_entry = ieh.e_entry; oeh.e_version = ieh.e_version; + ecp->flags &= ~(EXECUTABLE | DYNAMIC | RELOCATABLE); if (ieh.e_type == ET_EXEC) ecp->flags |= EXECUTABLE; else if (ieh.e_type == ET_DYN) @@ -1485,6 +1486,7 @@ Usage: %s [options] file...\n\ Options:\n\ -d | -g | -S | --strip-debug Remove debugging symbols.\n\ -h | --help Print a help message.\n\ + -o FILE | --output-file FILE Write output to FILE.\n\ --only-keep-debug Keep debugging information only.\n\ -p | --preserve-dates Preserve access and modification times.\n\ -s | --strip-all Remove all symbols.\n\ diff --git a/elfcopy/segments.c b/elfcopy/segments.c index c003c13..8ce0b83 100644 --- a/elfcopy/segments.c +++ b/elfcopy/segments.c @@ -34,7 +34,7 @@ #include "elfcopy.h" -ELFTC_VCSID("$Id: segments.c 3340 2016-01-17 15:00:56Z kaiwang27 $"); +ELFTC_VCSID("$Id: segments.c 3397 2016-02-12 14:35:19Z emaste $"); static void insert_to_inseg_list(struct segment *seg, struct section *sec); @@ -489,7 +489,7 @@ copy_phdr(struct elfcopy *ecp) ophdr.p_filesz = seg->fsz; ophdr.p_memsz = seg->msz; if (!gelf_update_phdr(ecp->eout, i, &ophdr)) - err(EXIT_FAILURE, "gelf_update_phdr failed :%s", + errx(EXIT_FAILURE, "gelf_update_phdr failed: %s", elf_errmsg(-1)); i++; diff --git a/libelf/_libelf_config.h b/libelf/_libelf_config.h index 1b8f35b..92e0b0a 100644 --- a/libelf/_libelf_config.h +++ b/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 3168 2015-02-24 19:17:47Z emaste $ + * $Id: _libelf_config.h 3396 2016-02-10 21:50:05Z emaste $ */ #if defined(__APPLE__) || defined(__DragonFly__) @@ -97,6 +97,12 @@ #define LIBELF_BYTEORDER ELFDATA2MSB #define LIBELF_CLASS ELFCLASS32 +#elif defined(__riscv64) + +#define LIBELF_ARCH EM_RISCV +#define LIBELF_BYTEORDER ELFDATA2LSB +#define LIBELF_CLASS ELFCLASS64 + #elif defined(__sparc__) #define LIBELF_ARCH EM_SPARCV9 |