It's possible to run the GNU binutils test suite against ELF Tool Chain elfcopy/strip, and it produces a large number of failures. I've submitted tickets for a couple of these relating to SHT_GROUP as that's a current sticking point on FreeBSD, but I am submitting this ticket to track overall progress.
It's simple to run:
cd binutils/testsuite/binutils-all
runtest OBJCOPY=path to elfcopy -a objcopy.exp
It may be that we're not interested in implementing some of these options, but it looks like there are legitimate bugs in supported functionality here.
The output I see:
feynman% runtest OBJCOPY=/tank/emaste/src/elftoolchain/elfcopy/elfcopy -a objcopy.exp WARNING: Couldn't find the global config file. WARNING: No tool specified Test Run By emaste on Wed May 20 13:09:10 2015 Native configuration is amd64-unknown-freebsd10.1 === tests === Schedule of variations: unix Running target unix Using /usr/local/share/dejagnu/baseboards/unix.exp as board description file for target. Using /usr/local/share/dejagnu/config/unix.exp as generic interface file for target. Using ./../config/default.exp as tool-and-target-specific interface file. Running ./objcopy.exp ... Version /tank/emaste/src/elftoolchain/elfcopy/elfcopy (no version number) PASS: objcopy (simple copy) PASS: objcopy -O srec PASS: objcopy --set-start PASS: objcopy --adjust-start FAIL: objcopy --adjust-vma FAIL: objcopy --adjust-section-vma + FAIL: objcopy --adjust-section-vma = PASS: strip preserving OS/ABI PASS: strip PASS: strip with saving a symbol PASS: simple objcopy of executable PASS: run objcopy of executable PASS: run stripped executable preserving OS/ABI PASS: run stripped executable PASS: run stripped executable with saving a symbol PASS: keep only debug data FAIL: simple objcopy of debug data FAIL: objcopy (ELF unknown section type) PASS: objcopy (ELF group) PASS: objcopy (ELF group) PASS: objcopy (ELF group) PASS: objcopy (ELF group) FAIL: copy removing group member PASS: copy removing all group member FAIL: copy with setting section flags 1 FAIL: add notes section FAIL: copy with setting section flags 2 FAIL: copy with setting section flags 3 FAIL: strip --strip-unneeded on common symbol PASS: strip with section group 1 FAIL: strip with section group 2 UNSUPPORTED: strip empty file PASS: strip with section group 4 FAIL: strip with section group 5 PASS: strip with section group 6 FAIL: strip with section group 7 PASS: strip with section group 8 FAIL: strip with section group 9 ERROR: .//unique.s: assembly failed UNRESOLVED: strip on STB_GNU_UNIQUE PASS: strip -g empty file PASS: --localize-hidden test 1 FAIL: unordered .debug_info references to .debug_ranges UNSUPPORTED: unordered .debug_info references to .debug_ranges PASS: objcopy add-section FAIL: objcopy add-empty-section FAIL: objcopy on sections with SHF_EXCLUDE FAIL: strip --strip-unneeded on sections with SHF_EXCLUDE PASS: --localize-hidden test 2 === Summary === # of expected passes 26 # of unexpected failures 19 # of unresolved testcases 1 # of unsupported tests 2
Diff:
It's really good to know we can use binutils testsuite on our tools!
I'll try to track down some of these failures later and post updates here.
It looks like the tracker stripped out some of the markup above - it should be something like:
% runtest STRIP=/path/to/elfcopy/strip OBJCOPY=/path/to/elfcopy/elfcopy -a objcopy.exp
and indeed, at [r3222] I see these section group tests passing:
Thanks!
Related
Commit: [r3222]
For reference, at [r3222]:
Related
Commit: [r3222]
Diff:
Test results from a test run on newer binutils-gdb head (00acd688caf385f38493ebd8d0a7b5f94d501a79):