Comments (8)
Linker is indeed an area that needs more good documentations. "Linkers & Loaders" gives an overview as to what linker is doing, but it lacks enough details to precisely understand how real Unix linker works. And details matter here, because if you for example forget to implement one feature, it often results in a mysterious crash of a generated executable rather than a friendly error message reported by the loader.
I'm writing a paper about mold, so stay tuned.
I found this is a good read. https://www.repository.cam.ac.uk/bitstream/handle/1810/260771/p607-kell.pdf The paper attempts to formalize the link process. I guess you don't actually want to understand the linker at that level (at least I don't need a formal proof), but still the paper seems a good starting point to understand how actual linker works.
from mold.
FWIW, perhaps some of these may be of use: https://github.com/MattPD/cpplinks/blob/master/executables.linking_loading.md
from mold.
Thanks, that looks good, and some of the references at the end might also help.
I'll look around to see if the paper has any interesting reverse-dependencies later.
from mold.
I came here to ask more or less the same question, but you people have answered my question(s), especially @MattPD's link came just in time.
@rui314 Do you have any email I could keep in touch with you? I have some questions that I would like to ask in private, if possible.
from mold.
This is exactly why I asked this publicly, and oh wow @MattPD . Super cool when people keep bibliographies. Maybe rui will find a key paper one week before needing to publish the thesis. :P
from mold.
@rui314 regards to the use of fork
, I have read an article you might be interested in studying it https://www.microsoft.com/en-us/research/uploads/prod/2019/04/fork-hotos19.pdf
It basically suggests to deprecate fork
and choose either posix_spawn()
on any POSIX-compliant operating system or CreateProcess()
on Windows.
from mold.
@stefanos82 Here is my email: [email protected]
As to fork
, my linker does not depend on it too much. If necessary, mold can spawn itself as a child process instead of forking. I kind of agree that fork might not be an ideal mechanism to create a new process, and I believe if we redesign Unix, fork would be replaced by something else. But the system call is there for 50 years and will stay here until Unix dies out.
from mold.
It basically suggests to deprecate fork and choose either posix_spawn() on any POSIX-compliant operating system or CreateProcess() on Windows.
posix_spawn has the same class of issues: ziglang/zig@22690ef, explained here golang/go#22315
with these necessary hacks workarounds: pantsbuild/pants#10507
from mold.
Related Issues (20)
- `mold/third-party/mimalloc` can be bumped to `v2.1.6`
- Dependency file has references to temporary file HOT 8
- mold: fatal: unknown command line option: -arch HOT 1
- ninja error "FindFirstFileExA" during build on windows with vs2022 HOT 1
- Error with `cargo build --release` on PPC64LE: Missing `R_PPC64_TPREL16_LO_DS` HOT 2
- Is -z x86-64-vX supported? HOT 2
- Fails to build LLVM 18.1.6 with mold HOT 3
- Corrupts the `DWARF` section when relocating multiple objects into a single one HOT 3
- Feature request: Warn about reverse or cyclic dependencies
- MSYS2/UCRT64: LINKER_TYPE 'MOLD' is unknown or not supported by this toolchain. HOT 6
- Build mold from source with -march or -mcpu in the build script HOT 2
- mold support for Fortran HOT 1
- Segmentation fault when compiling ROOT HOT 4
- /usr/lib/mold/mold-wrapper.so: unsupported relocation type 1026 HOT 3
- Binary linked with mold segfaults immediately HOT 5
- [FEATURE REQ/BUG REP] SH4 endianas HOT 7
- x86_64-exception-multiple-ehframe test failure HOT 2
- corrupted .riscv.attributes ISA string
- Very slow symbol lookup speed with gdb HOT 3
- mold fails to build on Debian sid on most of the archs (`error: implicit declaration of function`)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mold.