Page MenuHomeFreeBSD

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

Authored by markj on Jun 6 2019, 9:21 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Dec 26, 9:08 AM
Unknown Object (File)
Sat, Dec 21, 2:45 PM
Unknown Object (File)
Sat, Dec 21, 11:16 AM
Unknown Object (File)
Sun, Dec 15, 1:10 AM
Unknown Object (File)
Wed, Dec 4, 8:38 PM
Unknown Object (File)
Wed, Dec 4, 1:30 AM
Unknown Object (File)
Nov 29 2024, 9:58 AM
Unknown Object (File)
Nov 28 2024, 5:54 AM
Subscribers

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 Lint Coverage
Unit
No 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