From the binutils testsuite,
% touch empty.s
% make empty.o
% elfcopy/strip -R .text -R .data -R .bss -R .ARM.attributes -R .reginfo -R .gnu.attributes -R .MIPS.abiflags -R .pdr -R .xtensa.info empty.o
zsh: segmentation fault (core dumped)
memmove + 22 at bcopy.S:65
frame #1: 0x0000000000425679 stripset_shstrtab(ecp=0x0000000800c091c0) + 337 at sections.c:1242create_elf(ecp=0x0000000800c091c0) + 2376 at main.c:383
frame #3: 0x0000000000417482 stripcreate_file(ecp=0x0000000800c091c0, src=0x00007fffffffe82a, dst=0x00007fffffffe82a) + 2010 at main.c:655main [inlined] strip_main(argc=<unavailable>, argv=<unavailable>) + 3242 at main.c:1119
frame #5: 0x0000000000412afd stripmain(argc=20, argv=0x00007fffffffe418) + 7189 at main.c:1490
One approach for a fix in review at https://reviews.freebsd.org/D1341
The fix looks good! Committed in [r3108]. Thanks!
I also added a test case for this issue in [r3109].
Related
Commit: [r3108]
Commit: [r3109]
On 20 December 2014 at 03:40, Kai Wang kaiwang27@users.sf.net wrote:
Thank you! The s->buf == NULL test should not be necessary though
since it was just calloc'd a few lines earlier.
Related
Commit: [r3108]
You're right! Fixed by [r3119].
Related
Commit: [r3119]