Report Template

# Answers to Questions for Assignment 0

Please provide short answers to the questions below and submit the file as part of 
your assignment submission as a file named `results/answers.md`.

## Preliminaries

If you have any preliminary comments on your submission, notes for the TAs, please 
give them here.

Please cite any offline or online sources you consulted while preparing your 
submission, other than the Pintos documentation, course text, lecture notes, and 
course staff.

## GDB basics

For context, please refer to [GDB Basics](/spring2025/csc4103/assignments/assignment0/gdb_basics.html).

### Q1: What memory address does `argv` store?

### Q2: Describe what's located at that memory address. (What does `argv` point to?)

### Q3: What is the memory address of the recur function?

### Q4: What values are in all the registers?

### Q5: Now go up the call stack until you reach main. What is the return address to the main function?

### Q6: Which instructions correspond to the return 0 in C?

## From Source Code to Executable

For context, please refer to [From Source Code to Executable](/spring2025/csc4103/assignments/assignment0/executable.html).

### Q1. Generate `recurse.S` and find which instruction(s) corresponds to the recursive call of `recur(i - 1)`. Copy those into your answer

### Q2. What do the `.text` and `.data` sections contain?

### Q3. What command do we use to view the symbols in an ELF file? (Hint: We can use `objdump` again, look at `man objdump` to find the right flag).

### Q4. What do the `g`, `O`, `F`, and `*UND*` flags mean?

### Q5. Where else can we find a symbol for recur? Which file is this in? Copy and paste the relevant portion of the symbol table.

### Q6. Examine the symbol table of the entire map program now. What has changed?

### Q7. What segment(s)/section(s) contains recur (the function)?

### Q8. What segment(s)/section(s) contains global variables?

### Q9. Do you see the stack segment anywhere? What about the heap? Explain.

### Q10. Based on the output of map, in which direction does the stack grow? Explain.