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.

КОМЕНТАРІ • 20

  • @zaidlaffta
    @zaidlaffta 4 роки тому +13

    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.

  • @marksladen2901
    @marksladen2901 4 роки тому +8

    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.

  • @rbt-0007
    @rbt-0007 11 місяців тому

    My man. You are one shiny gem! Thank you SO much for your video!

  • @abrahamrodriguez6462
    @abrahamrodriguez6462 4 роки тому +1

    Great straightforward explanation.

  • @sussus4914
    @sussus4914 2 роки тому +3

    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.

  • @PabloGonzalez-io6pq
    @PabloGonzalez-io6pq 4 роки тому +1

    Great explanation!!

  • @abcbenjy6998
    @abcbenjy6998 8 місяців тому

    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?

  • @mohamedalhossiny3190
    @mohamedalhossiny3190 11 місяців тому

    Thanks, but is the steps include the Locator work or just the Linker ?

  • @bobweiram6321
    @bobweiram6321 Рік тому

    What about dynamic linking/

  • @edwardtang3585
    @edwardtang3585 4 роки тому +1

    The background sounds like you recorded beside a huge pump

    • @jamesm6951
      @jamesm6951 4 роки тому +5

      It's the 60Hz AC main frequency coupling with his mic.

  • @drygordspellweaver8761
    @drygordspellweaver8761 Рік тому

    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

    • @ProfessorHankStalica
      @ProfessorHankStalica  Рік тому

      Not without doing some troubleshooting. Off the top of my head, if the linker is linking files from a different hard drive maybe.

    • @drygordspellweaver8761
      @drygordspellweaver8761 Рік тому

      @@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.

    • @GriffinPenn
      @GriffinPenn 10 місяців тому

      @@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!

  • @schwaartz
    @schwaartz 4 місяці тому

    I CAN'T HEAR YOU (great explanation though)

    • @ProfessorHankStalica
      @ProfessorHankStalica  4 місяці тому

      I know, the hardware quality I had on earlier videos wasn't so good. Hopefully, you'll notice it's better in later videos.