Summary: | strip is broken | ||
---|---|---|---|
Product: | binutils | Reporter: | H.J. Lu <hjl.tools> |
Component: | binutils | Assignee: | Not yet assigned to anyone <unassigned> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | nickc |
Priority: | P2 | ||
Version: | 2.26 | ||
Target Milestone: | --- | ||
Host: | Target: | ||
Build: | Last reconfirmed: | ||
Attachments: | A testcase |
Description
H.J. Lu
2015-08-07 15:12:44 UTC
Created attachment 8494 [details] A testcase [hjl@gnu-6 pr18785]$ make /bin/strip compare-elim.o -o good.o ./strip compare-elim.o -o bad.o cmp good.o bad.o good.o bad.o differ: byte 5729, line 9 Makefile:5: recipe for target 'all' failed make: *** [all] Error 1 [hjl@gnu-6 pr18785]$ The master branch has been updated by H.J. Lu <hjl@sourceware.org>: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=d4ac1f878ecef58f1e4b4ff0cbfb4b475656eaf4 commit d4ac1f878ecef58f1e4b4ff0cbfb4b475656eaf4 Author: H.J. Lu <hjl.tools@gmail.com> Date: Fri Aug 7 10:28:42 2015 -0700 Check sh_type/sh_flags/sh_addralign/sh_entsize when copying sh_link/sh_info When copying the sh_link and sh_info fields in stripped section headers, we also check if the sh_type, sh_flags, /sh_addralign and sh_entsize fields of the output section match the output. Since --only-keep-debug turns all non-debug sections into SHT_NOBITS sections, the output SHT_NOBITS type matches any input type. bfd/ PR binutils/18785 * elf.c (_bfd_elf_copy_private_bfd_data): When copying the sh_link and sh_info fields in stripped section headers, we also check if the sh_type, sh_flags, /sh_addralign and sh_entsize fields of the output section match the output. Since --only-keep-debug turns all non-debug sections into SHT_NOBITS sections, the output SHT_NOBITS type matches any input type. binutils/testsuite/ PR binutils/18785 * binutils-all/objcopy.exp: Run strip-12. * binutils-all/strip-12.d: New file. * binutils-all/strip-12.s: Likewise. Fixed. |