Author: emaste
Date: Thu Nov 17 18:12:17 2016
New Revision: 308772
URL: https://svnweb.freebsd.org/changeset/base/308772

Log:
  crunchide: report explicit error for combined string table
  
  Some tools produce objects with a combined strtab and shstrtab.
  These objects are not supported by crunchide since it rewrites the
  symtab and strtab to "hide" symbols. This invalidates section header
  offsets into a combined strtab/shstrtab.
  
  In the future we could support these objects (by ensuring that we retain
  unmodified section name strings in the output .strtab, and then rewriting
  each section header's sh_name).
  
  MFC after:    1 week
  Sponsored by: The FreeBSD Foundation

Modified:
  head/usr.sbin/crunch/crunchide/exec_elf32.c

Modified: head/usr.sbin/crunch/crunchide/exec_elf32.c
==============================================================================
--- head/usr.sbin/crunch/crunchide/exec_elf32.c Thu Nov 17 18:10:08 2016        
(r308771)
+++ head/usr.sbin/crunch/crunchide/exec_elf32.c Thu Nov 17 18:12:17 2016        
(r308772)
@@ -279,6 +279,10 @@ ELFNAMEEND(hide)(int fd, const char *fn)
                weird = 1;
                weirdreason = "section header string table does not exist";
        }
+       if (strtabshdr == shstrtabshdr) {
+               weird = 1;
+               weirdreason = "combined strtab and shstrtab not supported";
+       }
        if (weirdreason == NULL)
                weirdreason = "unsupported";
        if (weird) {
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to