SCC.131: Digital Systems - Compiler, Assembler, Linker, and Loader

0.0(0)
studied byStudied by 0 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/22

flashcard set

Earn XP

Description and Tags

Flashcards based on lecture notes covering the compilation process, object files, linking (static and dynamic), and loaders.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

23 Terms

1
New cards

What is the role of the preprocessor in creating an executable file?

Handles macros, #include directives, and #xxxx statements, outputting 'pure' C code.

2
New cards

What is the role of the compiler in creating an executable file?

Transforms C code into assembly code, which is human-readable and dependent on the machine architecture.

3
New cards

What is the role of the assembler in creating an executable file?

Creates machine code and stores it in an object file.

4
New cards

What is the role of the linker in creating an executable file?

Combines several object files together to create an executable.

5
New cards

Name the main formats of object files.

ELF (Executable and Linking Format), COFF (Common Object-File Format), and Mach-O.

6
New cards

What are the key sections within an object file?

Machine code ('text' section), global constant data ('data' section), uninitialized data space ('bss'), symbol tables, and relocation information.

7
New cards

What is the purpose of the symbol table in the context of object files?

To store the location of functions, facilitating linking with other object files.

8
New cards

What information does relocation information contain?

Information on what to modify during the linking process; helps resolve addresses in separate parts of a program.

9
New cards

What does the 'nm' command do when examining object files?

It is used to examine the symbols within an object file.

10
New cards

What is the role of the linker (ld) on Linux systems?

To perform the linking of object files and libraries.

11
New cards

What do relocation records do?

Help the linker to fill in all addresses by referencing each other's code and/or data.

12
New cards

What are the two ways libraries can be used in a system?

Statically linked (archives) and dynamically linked (shared objects).

13
New cards

What are the advantages of static linking?

Knowing which library version is used at compile time and ensuring all necessary components are present when copying programs.

14
New cards

What is a disadvantage of static linking?

Programs take more disk space and memory space.

15
New cards

What are the advantages of dynamic linking?

Smaller file sizes, libraries can be upgraded without re-assembling the program, and libraries can be shared in memory.

16
New cards

What is a disadvantage of dynamic linking?

Libraries may change, and the impact on the program is not always clear.

17
New cards

What command is used to find out the shared objects libraries that a program is dynamically linked to?

The 'ldd' (list dynamic dependencies) command.

18
New cards

Why is it important to separate the compiler from the linker?

Program elements can be compiled independently, and changes only require recompilation of the corresponding object, which is important for larger projects.

19
New cards

What is the role of the loader?

To load a process from a file (e.g., ELF format in Linux) into main memory and perform process setup.

20
New cards

What is the purpose of dynamic address translation?

To translate virtual addresses to physical addresses.

21
New cards

What does the statement '#include \"MicroBit.h\"' do in CODAL?

Prompts the preprocessor to include MicroBit.h found in the codal-microbit-v2 library.

22
New cards

Is static or dynamic linking supported for MICROBIT.hex?

Only static linking is supported.

23
New cards

Why does the micro:bit not require a loader to run?

Because it does not use an operating system for handling multiple processes and mapping virtual addresses to physical addresses; it runs one process loaded onto a specific memory area.