1.2.2.7 Linkers and Loaders Flashcards

1
Q

What is a library?

A

Ready-compiled and tested programs that can be run when needed.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What are dynamic link libraries (DLL)?

A

a module that contains functions and data that can be used by another module (application or DLL)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Positives of libraries

A

+ Quick and easy to use and hook into your own code

+ Pre-tested, so you can be relatively sure they are already free from errors.

+ Pre-compiled, so they are typically optimised to run quickly.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Negatives of libraries

A

-Adding functionality or making specific tweaks can be difficult – or impossible.

-Sometimes you are “black-boxed” from the actual implementation.

-You have to trust that the developers will continue to maintain the library.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What do linkers do?

A

The linker is responsible for putting the appropriate machine addresses in all the external call and return instructions so all modules and external call and return instructions so all modules and external library routines are linked correctly. It also links any separately compiled subroutines into the object code.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What are the two types of linking?

A

Static linking
Dynamic linking

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is static linking?

A

All the required code from the libraries is included directly in the finished machine code – this can result in large executable program files.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is dynamic linking?

A

The operating system links the required code from the library as the program is running. While this cuts down on the size of the compiled machine code, if the dynamic libraries change, the program may stop because it tries to call a subroutine in the wrong way.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is a loader?

A

The part of the operating system that loads the executable program file (machine code) into memory, ready to run. When using dynamic linking, it will also be responsible for loading the required libraries into memory.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly