Bug 1315476 - glibc: save around 600 KiB by making sln and ldconfig the same binary
Summary: glibc: save around 600 KiB by making sln and ldconfig the same binary
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: glibc
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Florian Weimer
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: 1338879
TreeView+ depends on / blocked
 
Reported: 2016-03-07 20:51 UTC by Florian Weimer
Modified: 2016-07-14 07:34 UTC (History)
10 users (show)

Fixed In Version: glibc-2.23.90-28.fc25
Doc Type: Enhancement
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-07-14 07:34:21 UTC
Type: Bug


Attachments (Terms of Use)

Description Florian Weimer 2016-03-07 20:51:58 UTC
Both are statically linked:

$ ls -l /sbin/ldconfig /sbin/sln
-rwxr-xr-x. 1 root root 976264 Feb 19 22:25 /sbin/ldconfig
-rwxr-xr-x. 1 root root 767128 Feb 19 22:25 /sbin/sln

We can use the same binary for both and dispatch on argv[0].  The common core between is around 600 KiB, so that's the saving we can expect.

(Alternatively, we could get rid of sln completely.  Perhaps it is even possible to link ldconfig dynamically.)

Comment 1 Florian Weimer 2016-07-14 07:34:21 UTC
Before:

$ rpmdir /tmp/glibc-2.23.90-27.fc25.x86_64.rpm | grep -E 'ldconfig|sln'
-rwxr-xr-x () 52:1 {(none)} root root 1092656 1468043294 /sbin/ldconfig
-rwxr-xr-x () 53:1 {(none)} root root 895944 1468043295 /sbin/sln

1941 KiB.

After:

-rwxr-xr-x () 52:2 {(none)} root root 1092784 1468434014 /sbin/ldconfig
-rwxr-xr-x () 52:2 {(none)} root root 1092784 1468434014 /sbin/sln

1067 KiB.

Total savings are 874 KiB, slightly larger than predicted.  The minuscule increase in ldconfig size despite the added sln functionality seems to be a result of a alignment constraints, the size tool reports somewhat more realistic numbers:

   text	   data	    bss	    dec	    hex	filename
 982470	   7568	   6760	 996798	  f35be	ldconfig.old
 984310	   7568	   6760	 998638	  f3cee	sln.new


Note You need to log in before you can comment on or make changes to this bug.