Menu

#496 elfcopy/strip fails a number of GNU binutils tests

2.0
new
nobody
None
2016-02-16
2015-05-20
Ed Maste
No

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

Discussion

  • Ed Maste

    Ed Maste - 2015-05-20
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -7,6 +7,7 @@
     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.
    
     
  • Kai Wang

    Kai Wang - 2015-05-25

    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.

     
  • Ed Maste

    Ed Maste - 2015-05-25

    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:

    PASS: strip with section group 1
    PASS: strip with section group 2
    UNSUPPORTED: strip empty file
    PASS: strip with section group 4
    PASS: strip with section group 5
    PASS: strip with section group 6
    PASS: strip with section group 7
    PASS: strip with section group 8
    PASS: strip with section group 9
    

    Thanks!

     

    Related

    Commit: [r3222]

  • Ed Maste

    Ed Maste - 2015-05-25

    For reference, at [r3222]:

    % runtest STRIP=/tank/emaste/src/elftoolchain/elfcopy/strip 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 Sun May 24 21:03:57 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)
    FAIL: objcopy --reverse-bytes
    FAIL: objcopy -i --interleave-width
    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
    FAIL: 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
    PASS: 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)
    PASS: copy removing group member
    FAIL: 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
    PASS: strip --strip-unneeded on common symbol
    PASS: strip with section group 1
    PASS: strip with section group 2
    UNSUPPORTED: strip empty file
    PASS: strip with section group 4
    PASS: strip with section group 5
    PASS: strip with section group 6
    PASS: strip with section group 7
    PASS: strip with section group 8
    PASS: 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            31
    # of unexpected failures        16
    # of unresolved testcases       1
    # of unsupported tests          2
    
     

    Related

    Commit: [r3222]

  • Ed Maste

    Ed Maste - 2015-12-11
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -2,7 +2,7 @@
    
     It's simple to run:
     cd binutils/testsuite/binutils-all
    -runtest OBJCOPY=<path to elfcopy> -a objcopy.exp
    +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.
    
     
  • Ed Maste

    Ed Maste - 2016-02-16

    Test results from a test run on newer binutils-gdb head (00acd688caf385f38493ebd8d0a7b5f94d501a79):

    FAIL: objcopy (simple copy)
    FAIL: objcopy --reverse-bytes
    FAIL: objcopy -i --interleave-width
    PASS: objcopy -O srec
    PASS: objcopy --set-start
    PASS: objcopy --adjust-start
    PASS: objcopy --adjust-vma
    PASS: objcopy --adjust-section-vma +
    PASS: 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: strip 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: NOBITS sections retain sh_link field
    PASS: localize 'fo*' but not 'foo'
    PASS: weaken 'fo*' but not 'foo'
    PASS: weaken 'fo*' but not 'foo', localize foo.
    PASS: weaken '*' but not 'foo' or 'bar'
    FAIL: objcopy (ELF unknown section type)
    FAIL: objcopy (ELF group)
    FAIL: objcopy (ELF group)
    FAIL: objcopy (ELF group)
    FAIL: objcopy (ELF group)
    FAIL: copy removing group member
    FAIL: copy removing all group member
    PASS: copy with setting section flags 1
    PASS: add notes section
    PASS: copy with setting section flags 2
    PASS: copy with setting section flags 3
    FAIL: strip --strip-unneeded on common symbol
    FAIL: /pr19020a
    FAIL: /pr19020b
    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
    PASS: /strip-12
    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-symbol
    PASS: objcopy add-empty-section
    ERROR: .//exclude-1.s: assembly failed
    UNRESOLVED: objcopy on sections with SHF_EXCLUDE
    ERROR: .//exclude-1.s: assembly failed
    UNRESOLVED: strip --strip-unneeded on sections with SHF_EXCLUDE
    PASS: --localize-hidden test 2
    
     

Log in to post a comment.