OSDev.org

The Place to Start for Operating System Developers
It is currently Sat Apr 27, 2024 5:28 pm

All times are UTC - 6 hours




Post new topic Reply to topic  [ 17 posts ]  Go to page Previous  1, 2
Author Message
 Post subject: Re: My ELFs are so big
PostPosted: Mon Jan 22, 2024 8:31 am 
Online
Member
Member
User avatar

Joined: Mon May 22, 2017 5:56 am
Posts: 817
Location: Hyperspace
AndrewAPrice wrote:
GUI programs link with Skia which adds a dependency on libxml2, harfbuzz, freetype, libjpeg.

I woke up this morning recalling a 9front discussion in which a leading dev concluded that you need dynamic linking for GUI. (This was years ago now, opinions may have changed.) Some time after that discussion, a GUI server came to light. The concept was simple: The program (or even shell script) starts the GUI server, sending and receiving messages over the server's stdio. This certainly shrinks program binares. It's enough to save some memory on a statically-linked system; the text section of the GUI server is shared between all instances. Further savings could be made if the server were a single instance; font caching comes to mind.

_________________
Kaph — a modular OS intended to be easy and fun to administer and code for.
"May wisdom, fun, and the greater good shine forth in all your work." — Leo Brodie


Top
 Profile  
 
 Post subject: Re: My ELFs are so big
PostPosted: Wed Jan 24, 2024 9:13 am 
Offline
Member
Member
User avatar

Joined: Mon Jun 05, 2006 11:00 pm
Posts: 2293
Location: USA (and Australia)
thewrongchristian wrote:
Interesting. What made the difference in the end? Was it just recompiling with clang? Or did you end up stripping the resulting binaries?

I switched to Clang and got linked time optimization working.

the wrongchristian wrote:
Fair enough, but it's unlikely all of that 8MB is actually mapped in. You only need to map in the code that is executed (assuming demand paging), so if the bulk of the files was debug symbols that got removed, then you'll have saved little in the way of memory usage.

My ELF loading code doesn't do demand paging and copies any segment where p_type == PT_LOAD and p_filesz >= 0.

_________________
My OS is Perception.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 17 posts ]  Go to page Previous  1, 2

All times are UTC - 6 hours


Who is online

Users browsing this forum: Bing [Bot], DotBot [Bot], Majestic-12 [Bot] and 17 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group