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)
Sat, Apr 6, 2:08 AM
Unknown Object (File)
Sat, Apr 6, 2:08 AM
Unknown Object (File)
Fri, Mar 29, 11:54 AM
Unknown Object (File)
Feb 12 2024, 8:15 AM
Unknown Object (File)
Jan 30 2024, 9:21 PM
Unknown Object (File)
Jan 30 2024, 9:21 PM
Unknown Object (File)
Jan 24 2024, 10:08 AM
Unknown Object (File)
Jan 13 2024, 10:37 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

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

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