Live data from Hacker News

Mold: A Modern Linker

github.com

121–125 of 125 posts

Re: Mold: A Modern Linker

#121
> the most important thing is to fix the layout of an output file as quickly as possible, so that we can start copying actual data from input object files to an output file as soon as possible.

Why do we need to copy data at all ?

Can't we just have an object file with pointers to other files ?

Like sure, if I ever want to ship my binary somewhere else, I'd like to do this. But for local interactive development, all the files are already in my local machine, so I don't know why we would need to create a second copy of them within some other file.

Re: Mold: A Modern Linker

#123
post #13

From a marketing perspective, "mold" meaning "a form used to cast an object from liquid" is a lot more appealing than "green fungus growing on bread." A mold for casting objects is also a lot closer, metaphorically speaking, to what a linker does. I honestly thought that was the meaning the author was trying to evoke before I saw the picture on the github page.

That's funny because BFD linker's original meaning was Big F**ing Deal. Linkers sure are marketable oddballs.

Re: Mold: A Modern Linker

#124

Earlier quoted context omitted.

Not caring amount memory leaks is not the same as not caring about memory consumption. The next line shows exactly why the choice is made. > It is because most objects that are allocated during an execution of mold are needed until the very end of the program. Using free would not affect that memory consumption much because most consumption would be freed at the end of the program.

Raymond Chen has an amusing story about this[1]: > Since the missile will explode when it hits its target or at the end of its flight, the ultimate in garbage collection is performed without programmer intervention. [1]: https://devblogs.microsoft.com/oldnewthing/20180228-00/?p=98...

I also submitted it here in 2017[0].

[0] https://news.ycombinator.com/item?id=14233542

Re: Mold: A Modern Linker

#125

> the most important thing is to fix the layout of an output file as quickly as possible, so that we can start copying actual data from input object files to an output file as soon as possible. Why do we need to copy data at all ? Can't we just have an object file with pointers to other files ? Like sure, if I ever want to ship my binary somewhere else, I'd like to do this. But for local interactive development, all…

Hm, well what happens when you execv a executable then? Everything needs to get copied into ram and then jumped to, so you would be putting a linker implementation into a syscall right? And if it's just as easy as concattening the files, them just do that in userspace.
Post reply on HN