Multifile/Linkers/Data sections Flashcards

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

A

Symbol addr

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

A

YES

25
Q

(Needs Symbol?) locals

A

NO

26
Q

(Needs Symbol?) params

A

NO

27
Q

(Needs Symbol?) global vars

A

YES

28
Q

(Needs Symbol?) static globals

A

YES

29
Q

(Needs Symbol?) extern vars

A

YES

30
Q

(Needs Symbol?) externally defined functions

A

YES

31
Q

(Needs Symbol?) static functions

A

NO

32
Q

(Needs Symbol?) non-static functions

A

YES

33
Q

(Compiler or Linker) local vars

A

Compiler

34
Q

(Compiler or Linker) static locals

A

Kind of both

35
Q

(Compiler or Linker) globals

A

Linker