Linker Example - How the linker combines object files.
Вставка
- Опубліковано 4 жов 2024
- As part of the translation process from a high-level language to a program running in memory, the linker program is responsible for combining assembled object files into a single executable.
It does this by figuring out what instructions go where and resolving memory addresses. For example, if there is a call to a function from object file A to a function in object file B, the linker has to sort this out.
In this video, I walk you through an example of how this is done in the context of a MIPS assembly program.
Small world, Hank tough me while I was doing my undergrad degree like 6 years ago. And now I am doing my graduate degree in a totally different school and needed to know a bit more about linker and here he is. Great person and great professor.
I like how you explained this! I wish there wasn't such a noise in the audio. Also, at 12:45 , you wrote 10 million instead of 1 million. Not a big deal, but my OCD made me mention it.
Thanks for the video.
My man. You are one shiny gem! Thank you SO much for your video!
Happy to help!
Great straightforward explanation.
You got the 2nd part of the SW address wrong. It's a twos compelemnt negative number meaning the "half-word" (size 16 bits) MSB should be set. Hence it must be $8020 not $7980. See page 111 or chapter 2 of the P&H book.
Thanks for the correction, I really appreciate it.
Great explanation!!
Glad you liked it
Ok awesome video, I just don't understand the use of the symbol table? I under how the linker used the relocation table to find out what dependencies it needed to fix but how did it use the symbol table?
Thanks, but is the steps include the Locator work or just the Linker ?
What about dynamic linking/
The background sounds like you recorded beside a huge pump
It's the 60Hz AC main frequency coupling with his mic.
Hey nice video- do you know what could cause a linker to run abnormally slowly? Like a 3 second link time for a simple hello world, for instance
Not without doing some troubleshooting. Off the top of my head, if the linker is linking files from a different hard drive maybe.
@@ProfessorHankStalica interesting. I'm using nim and in the compilation output it sources some of the config files from a D:\ drive that doesn't actually exist on the computer. It's like a virtual path or something.
@@drygordspellweaver8761 Well I would say after learning a bit of how the entire translation process happens my best guess would be it the #include or if you're using C/C++. Basically, when you do this your code goes from the simple hello world code, to all the code found in those header files AND your hello world code. Given that each of those files have several thousand lines of code each, it makes for a very large object file when it comes time to link them! I would recommend watching The Cherno video on compilers for an overview of how this works. Hope that helps!
I CAN'T HEAR YOU (great explanation though)
I know, the hardware quality I had on earlier videos wasn't so good. Hopefully, you'll notice it's better in later videos.