summaryrefslogtreecommitdiffstats
path: root/contrib/elftoolchain/elfcopy
diff options
context:
space:
mode:
authoremaste <emaste@FreeBSD.org>2015-05-14 19:48:15 +0000
committeremaste <emaste@FreeBSD.org>2015-05-14 19:48:15 +0000
commita4c24f2588a858878b30f781ab7780f8a7565dec (patch)
tree68f789ad3decb5c1b82f63186eaf665cb84861ee /contrib/elftoolchain/elfcopy
parent01699072e4f2583fa587d2aea44d8062f228b9cd (diff)
downloadFreeBSD-src-a4c24f2588a858878b30f781ab7780f8a7565dec.zip
FreeBSD-src-a4c24f2588a858878b30f781ab7780f8a7565dec.tar.gz
Update to ELF Tool Chain r3197
Highlights: - Fix man page markup, whitespace, and typos - Fix sh_info of SHT_GROUP section to point to the correct string - Improve validation in readelf and elfcopy/strip - Handle DWARF 4's DW_AT_high_pc in addr2line Sponsored by: The FreeBSD Foundation
Diffstat (limited to 'contrib/elftoolchain/elfcopy')
-rw-r--r--contrib/elftoolchain/elfcopy/elfcopy.14
-rw-r--r--contrib/elftoolchain/elfcopy/sections.c10
-rw-r--r--contrib/elftoolchain/elfcopy/segments.c4
-rw-r--r--contrib/elftoolchain/elfcopy/symbols.c4
4 files changed, 15 insertions, 7 deletions
diff --git a/contrib/elftoolchain/elfcopy/elfcopy.1 b/contrib/elftoolchain/elfcopy/elfcopy.1
index ce8f120..4889570 100644
--- a/contrib/elftoolchain/elfcopy/elfcopy.1
+++ b/contrib/elftoolchain/elfcopy/elfcopy.1
@@ -21,7 +21,7 @@
.\" out of the use of this software, even if advised of the possibility of
.\" such damage.
.\"
-.\" $Id: elfcopy.1 3173 2015-03-27 16:46:13Z emaste $
+.\" $Id: elfcopy.1 3195 2015-05-12 17:22:19Z emaste $
.\"
.Dd March 27, 2015
.Os
@@ -330,4 +330,4 @@ Do not copy symbols that are not needed for relocation processing.
.Sh HISTORY
.Nm
has been implemented by
-.An "Kai Wang" Aq kaiwang27@users.sourceforge.net .
+.An Kai Wang Aq Mt kaiwang27@users.sourceforge.net .
diff --git a/contrib/elftoolchain/elfcopy/sections.c b/contrib/elftoolchain/elfcopy/sections.c
index 077bb74..7c43a35 100644
--- a/contrib/elftoolchain/elfcopy/sections.c
+++ b/contrib/elftoolchain/elfcopy/sections.c
@@ -34,7 +34,7 @@
#include "elfcopy.h"
-ELFTC_VCSID("$Id: sections.c 3174 2015-03-27 17:13:41Z emaste $");
+ELFTC_VCSID("$Id: sections.c 3185 2015-04-11 08:56:34Z kaiwang27 $");
static void add_gnu_debuglink(struct elfcopy *ecp);
static uint32_t calc_crc32(const char *p, size_t len, uint32_t crc);
@@ -1223,6 +1223,14 @@ update_shdr(struct elfcopy *ecp, int update_link)
osh.sh_info != 0)
osh.sh_info = ecp->secndx[osh.sh_info];
+ /*
+ * sh_info of SHT_GROUP section needs to point to the correct
+ * string in the symbol table.
+ */
+ if (s->type == SHT_GROUP && (ecp->flags & SYMTAB_EXIST) &&
+ (ecp->flags & SYMTAB_INTACT) == 0)
+ osh.sh_info = ecp->symndx[osh.sh_info];
+
if (!gelf_update_shdr(s->os, &osh))
errx(EXIT_FAILURE, "gelf_update_shdr() failed: %s",
elf_errmsg(-1));
diff --git a/contrib/elftoolchain/elfcopy/segments.c b/contrib/elftoolchain/elfcopy/segments.c
index 3ed6d93..1e271a6 100644
--- a/contrib/elftoolchain/elfcopy/segments.c
+++ b/contrib/elftoolchain/elfcopy/segments.c
@@ -34,7 +34,7 @@
#include "elfcopy.h"
-ELFTC_VCSID("$Id: segments.c 3177 2015-03-30 18:19:41Z emaste $");
+ELFTC_VCSID("$Id: segments.c 3196 2015-05-12 17:33:48Z emaste $");
static void insert_to_inseg_list(struct segment *seg, struct section *sec);
@@ -442,7 +442,7 @@ copy_phdr(struct elfcopy *ecp)
s = seg->v_sec[i];
seg->msz = s->vma + s->sz - seg->addr;
if (s->type != SHT_NOBITS)
- seg->fsz = seg->msz;
+ seg->fsz = s->off + s->sz - seg->off;
}
}
diff --git a/contrib/elftoolchain/elfcopy/symbols.c b/contrib/elftoolchain/elfcopy/symbols.c
index 49bb239..4a7d38a 100644
--- a/contrib/elftoolchain/elfcopy/symbols.c
+++ b/contrib/elftoolchain/elfcopy/symbols.c
@@ -33,7 +33,7 @@
#include "elfcopy.h"
-ELFTC_VCSID("$Id: symbols.c 3174 2015-03-27 17:13:41Z emaste $");
+ELFTC_VCSID("$Id: symbols.c 3191 2015-05-04 17:07:01Z jkoshy $");
/* Symbol table buffer structure. */
struct symbuf {
@@ -1090,7 +1090,7 @@ str_hash(const char *s)
{
uint32_t hash;
- for (hash = 2166136261; *s; s++)
+ for (hash = 2166136261UL; *s; s++)
hash = (hash ^ *s) * 16777619;
return (hash & (STHASHSIZE - 1));
OpenPOWER on IntegriCloud