svn commit: r284339 - head/contrib/elftoolchain/elfcopy
Ed Maste
emaste at FreeBSD.org
Sat Jun 13 14:24:32 UTC 2015
Author: emaste
Date: Sat Jun 13 14:24:31 2015
New Revision: 284339
URL: https://svnweb.freebsd.org/changeset/base/284339
Log:
elfcopy: Handle objects without a ".shstrtab" section string table
As of LLVM revision 238073, LLVM stores symbols and section names in
the same string table. From the upstream commit mesage:
With the scheme of naming sections like ".text.foo" where foo is a
symbol, there is a big potential saving in using a single one.
This is a cherry-pick of ELF Tool Chain revision 3225.
Sponsored by: The FreeBSD Foundation
Modified:
head/contrib/elftoolchain/elfcopy/sections.c
Modified: head/contrib/elftoolchain/elfcopy/sections.c
==============================================================================
--- head/contrib/elftoolchain/elfcopy/sections.c Sat Jun 13 07:31:50 2015 (r284338)
+++ head/contrib/elftoolchain/elfcopy/sections.c Sat Jun 13 14:24:31 2015 (r284339)
@@ -1349,6 +1349,14 @@ set_shstrtab(struct elfcopy *ecp)
s = ecp->shstrtab;
+ if (s->os == NULL) {
+ /* Input object does not contain .shstrtab section */
+ if ((s->os = elf_newscn(ecp->eout)) == NULL)
+ errx(EXIT_FAILURE, "elf_newscn failed: %s",
+ elf_errmsg(-1));
+ insert_to_sec_list(ecp, s, 1);
+ }
+
if (gelf_getshdr(s->os, &sh) == NULL)
errx(EXIT_FAILURE, "692 gelf_getshdr() failed: %s",
elf_errmsg(-1));
More information about the svn-src-head
mailing list