1. Submit a pdf of your typed or handwritten homework on Gradescope. You should have
received an email inviting you to the Gradescope course. If you have not, please go to
www.gradescope.com, register for an account
...
1. Submit a pdf of your typed or handwritten homework on Gradescope. You should have
received an email inviting you to the Gradescope course. If you have not, please go to
www.gradescope.com, register for an account using your university email address (if
necessary), then add yourself to this course using the entry code MZRKB3.
2. Your answers should be neat, clearly marked, and concise. Computer written work is
recommended (but not required). Show all your work, and state any special or non-obvious
assumptions you make.
3. You may discuss your solution methods or your answers with other students, but the
solutions you submit must be your own.Problem 1: Linking (20 points)
a) Complete the symbol and relocation tables for Main.o and Michigan.o below. Symbol
types are either Text (T), Data (D), or Undefined (U). Offset is the offset into the
appropriate section of the file for either the Text section or Data section. Undefined
symbols do not need an offset. Assume all loads and stores are 32-bit. (10 pts: -0.75 pt
for each incorrect row, maximum of -10 if mostly wrong)
Format of an entry in the symbol table:
Format of a relocation table entry:
Main.o Michigan.o
Header Size of Text 0x18 Size of Text 0x1C
Size of Data 0x8 Size of Data 0x8
Text Main: 0x00 store [A] = X1 Go: 0x00 load X4 = [D]
0x04 load X7 = [C] 0x04 bl Blue
0x08 bl Go 0x08 store [C] = X6
0x0C X2 = X3 + X4 0x0C return
0x10 bl Blue Blue: 0x10 load X7 = [B]
0x14 return 0x14 X6 = X7 + 1
0x18 0x18 return
Data A 0x0 4 C 0x0 3
B 0x4 5 D 0x4 -1
Symbol
tables
ABCM
ain
Go
Blue
DDUTUU
0x0
0x4
----
0x0
----
----
Go
DBCB
lue
TDUDT
0x0
0x4
----
0x0
0x10
Relocation
tables
0x00 store A 0x00 load D
0x04 load C 0x04 bl Blue
0x08 bl Go 0x08 store C
0x10 bl Blue 0x10 load Bb) Link Main.o and Michigan.o to create one executable. Make sure to resolve addresses of all
symbols and that all function calls branch to PC + offset + 4. There should be no symbols in
your machine code. (10 pts) (-0.75 pts for each incorrect row, maximum of -10 if mostly wrong)
Executable Fill in the right two columns as appropriate. We may have
provided more address space than necessary.
Header
Size of Text 0x34
Size of Data 0x10
Text 0x00 Main: Store [0x100] =
[Show More]