Multifile/Linkers/Data sections Flashcards

(35 cards)

1
Q

ELF Data Sections

A

.text, .rodata, .data, .bss, .symtab, lreltext, .debug, .strtab

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

.text

A

Machine code

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

.rodata

A

String literals, switch/jump table

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

.data

A

initialized globals and static locals

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

.bss

A

uninitialized globals and static locals

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

.symtab

A

linker symbol table

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

.reltext

A

relocated code

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

.debug

A

complete symbol table

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

-fno-common

A

prevents weak name conflicts from compiling

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

.strtab

A

NULL-terminated strings of names of symbols in .symtab section

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

(Linker stage) Resolution

A

Check to make sure each symbol has one def only

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

(Linker stage) Relocation

A

Resolve symbol addresses for aggregated sections of of executable

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

Object Files (ROFs)

A

Produced by assembler, can be combined by linker

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

(Multifile coding) Include Guard

A

Prevents multiple inclusions

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

(ELF_Symbols) int name

A

byte offset in .strtab where name is found

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

(ELF_Symbols) int value

17
Q

(ELF_Symbols) int size

A

size in bytes

18
Q

(ELF_Symbols) char type

A

indicates type e.g Data means object, func means function

19
Q

(ELF_Symbols) char binding

A

indicates scope

20
Q

(ELF_Symbols) char section

A

indicates location, e.g. .text, .rodata, .data, .bss

21
Q

(Pseudo Sections) ABS

A

ABSolute, symbols that should not be relocated

22
Q

(Pseudo Sections) UND

A

UNDefined, symbols in this ROF defined elsewhere

23
Q

(Pseudo Sections) COM

A

COMmon, symbols in .bss which have not been allocated.

  • int value = alignment requirements
  • int size = minimum size
24
Q

(Needs Symbol?) static locals

25
(Needs Symbol?) locals
NO
26
(Needs Symbol?) params
NO
27
(Needs Symbol?) global vars
YES
28
(Needs Symbol?) static globals
YES
29
(Needs Symbol?) extern vars
YES
30
(Needs Symbol?) externally defined functions
YES
31
(Needs Symbol?) static functions
NO
32
(Needs Symbol?) non-static functions
YES
33
(Compiler or Linker) local vars
Compiler
34
(Compiler or Linker) static locals
Kind of both
35
(Compiler or Linker) globals
Linker