Page MenuHomeFreeBSD

strip: Provide a size hint when creating the string table.
ClosedPublic

Authored by markj on Jun 6 2019, 9:21 PM.

Details

Summary

Use the input file's .shstrtab size as the hint. The libelftc
default seems to be too small and we get lots of resizing and hash
collisions with the input files from PR 234949.

Test Plan

With this change we are faster than GNU strip. :)

markj@raichu> time strip ghc-8.6.2/libraries/Cabal/Cabal/dist-install/build/libHSCabal-2.4.0.1.a

real    0m2.147s
user    0m1.767s
sys     0m0.187s
markj@raichu> time /usr/local/bin/strip ghc-8.6.2/libraries/Cabal/Cabal/dist-install/build/libHSCabal-2.4.0.1.a

real    0m2.918s
user    0m2.662s
sys     0m0.166s



markj@raichu> time strip ghc-8.6.2/libraries/Cabal/Cabal/dist-install/build/libHSCabal-2.4.0.1_p.a

real    0m4.546s
user    0m4.109s
sys     0m0.204s
markj@raichu> time /usr/local/bin/strip ghc-8.6.2/libraries/Cabal/Cabal/dist-install/build/libHSCabal-2.4.0.1_p.a

real    0m4.670s
user    0m4.128s
sys     0m0.351s

Diff Detail

Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 24801
Build 23553: arc lint + arc unit

Event Timeline

markj edited the test plan for this revision. (Show Details)
markj added a reviewer: emaste.
  • Update libelftc_string_table to use size_t for the table size.
  • Don't error out if the input file does not have a shstrtab.

I plan to commit the libelftc change separately.

This revision is now accepted and ready to land.Jun 25 2019, 9:26 PM