News for hackers. Stuff that matters.
Re:How statically linked programs run on Linux (2012) by daniel-levin on Saturday October 25, 2014 @05:40PM (#8509486)
Eli Bendersky's blog. It gets reposted on HN quite often and with very, very good reason. It's an absolute treasure trove of technicalia. I've spent many hours deep in his articles. On all sorts of cool technical topics, like parsers, debuggers, cool language features, abstract math...

And I'm sure I'm not the only frequenter of HN that loves this stuff.

Re:How statically linked programs run on Linux (2012) by lgeek on Sunday October 26, 2014 @08:43AM (#8510897)
The diagram showing the stack on program entry misses the auxiliary vector[0].

As a sidenote, I find stack diagrams more intuitive (for typical descending stacks) when the low address is drawn at the top. This way it looks like a real-world stack and if you need to represent some data or executable code in the same address space it will appear in natural order, from top to bottom.

[0] http://articles.manugarg.com/aboutelfauxiliaryvectors.html

Re:How statically linked programs run on Linux (2012) by eliben on Sunday October 26, 2014 @08:59AM (#8510913)
Yep, I omitted it for simplicity in the diagram, though I do mention it later on.
Re:How statically linked programs run on Linux (2012) by Animats on Saturday October 25, 2014 @01:39PM (#8508795)
Does Linux just map the executable into memory, and then let it load memory fault by memory fault? Or is the entire executable, or some large portion therof, loaded at startup?
Re:How statically linked programs run on Linux (2012) by cfallin on Saturday October 25, 2014 @03:36PM (#8509134)
The loader mmap()s the file and it's demand-paged in.
Re:How statically linked programs run on Linux (2012) by jbn on Tuesday October 28, 2014 @08:21PM (#8524671)
As I commented there: http://garrett.damore.org/2014/09/modernizing-less.html what's worse is that BSS and data pages are faulted in, so just to startup the OS has to page in multiple times, just to read/write those globals that people love so much... It would be much much better to make no use whatsoever of globals (i.e. put everything on the stack in main() )...
Re:How statically linked programs run on Linux (2012) by adm_hn on Saturday October 25, 2014 @12:26PM (#8508603)
Love the articles on linux internals, I wish there were more coming in HN