Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

For the code above, after the two object files above are linked together with th

ID: 3831466 • Letter: F

Question

For the code above, after the two object files above are linked together with the command line ld -o p main.o weight_sum.o, the sizes of .text and .data sections are list as below. Assume the object files are combined similar to the order shown in the lecture slides and the starting address of the unified executable object file starts at 0x08af3ef4. What is the relocated address of array[0]?

The relocated address of array[0]: 0x________

*The order referenced in the questions is that the first file listed in the command line statement has its text and data sections above the other.

File +Section    Size(Byte)    main.o's .text 24 main.o's .data 8 weight_sum.o's .text 32 weight_sum.o's .data 4 main.c extern int weight sum int array (4, 2 int main int total; total weight sum i return 0; weight sum c extern int *array; int weight int weight. 1-1; int weight sum int tempo 0; weight 2 weight 1 temp weigt ha 1 array (0 temp weight 2 array [1] return temp;

Explanation / Answer

THe address of the array[0] is : 0x 08af3ef4 + 32 +4 +24= 0x 08af3ef4+3d= 0x 08af3f31