aboutsummaryrefslogtreecommitdiff
path: root/elfcopy/sections.c
diff options
context:
space:
mode:
authorEd Maste <emaste@FreeBSD.org>2014-12-22 20:32:23 +0000
committerEd Maste <emaste@FreeBSD.org>2014-12-22 20:32:23 +0000
commit5eccfb5cf5403e9e564066e0a75d80534b49e91d (patch)
tree78347950207dea134308b7c9d4843204e80507e0 /elfcopy/sections.c
parent5265ace0e440a23fb522c516f4ee20f43eaed2b3 (diff)
downloadsrc-5eccfb5cf5403e9e564066e0a75d80534b49e91d.tar.gz
src-5eccfb5cf5403e9e564066e0a75d80534b49e91d.zip
Import elftoolchain rev 3130vendor/elftoolchain/elftoolchain-r3130
From svn.code.sf.net/p/elftoolchain/code/trunk
Notes
Notes: svn path=/vendor/elftoolchain/dist/; revision=276077 svn path=/vendor/elftoolchain/elftoolchain-r3130/; revision=276078; tag=vendor/elftoolchain/elftoolchain-r3130
Diffstat (limited to 'elfcopy/sections.c')
-rw-r--r--elfcopy/sections.c25
1 files changed, 16 insertions, 9 deletions
diff --git a/elfcopy/sections.c b/elfcopy/sections.c
index d01659a935ee..c503666c8948 100644
--- a/elfcopy/sections.c
+++ b/elfcopy/sections.c
@@ -35,7 +35,7 @@
#include "elfcopy.h"
-ELFTC_VCSID("$Id: sections.c 2358 2011-12-19 18:22:32Z kaiwang27 $");
+ELFTC_VCSID("$Id: sections.c 3126 2014-12-21 08:03:31Z kaiwang27 $");
static void add_gnu_debuglink(struct elfcopy *ecp);
static uint32_t calc_crc32(const char *p, size_t len, uint32_t crc);
@@ -372,6 +372,14 @@ create_scn(struct elfcopy *ecp)
is_remove_reloc_sec(ecp, ish.sh_info))
continue;
+ /*
+ * Section groups should be removed if symbol table will
+ * be removed. (section group's signature stored in symbol
+ * table)
+ */
+ if (ish.sh_type == SHT_GROUP && ecp->strip == STRIP_ALL)
+ continue;
+
/* Get section flags set by user. */
sec_flags = get_section_flags(ecp, name);
@@ -762,8 +770,8 @@ resync_sections(struct elfcopy *ecp)
s->off = roundup(off, s->align);
} else {
if (s->loadable)
- warnx("moving loadable section,"
- "is this intentional?");
+ warnx("moving loadable section %s, "
+ "is this intentional?", s->name);
s->off = roundup(off, s->align);
}
@@ -1139,12 +1147,6 @@ add_to_shstrtab(struct elfcopy *ecp, const char *name)
struct section *s;
s = ecp->shstrtab;
- if (s->buf == NULL) {
- insert_to_strtab(s, "");
- insert_to_strtab(s, ".symtab");
- insert_to_strtab(s, ".strtab");
- insert_to_strtab(s, ".shstrtab");
- }
insert_to_strtab(s, name);
}
@@ -1206,6 +1208,11 @@ init_shstrtab(struct elfcopy *ecp)
s->loadable = 0;
s->type = SHT_STRTAB;
s->vma = 0;
+
+ insert_to_strtab(s, "");
+ insert_to_strtab(s, ".symtab");
+ insert_to_strtab(s, ".strtab");
+ insert_to_strtab(s, ".shstrtab");
}
void