Question: main.c extern int weight_sum( ) ; int array[ ] = {4, 2}; int main( ){ int total; total = weight_sum( ) ; return 0; }
![main.c extern int weight_sum( ) ; int array[ ] = {4,](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66fa22b420232_91566fa22b38be92.jpg)
main.c extern int weight_sum( ) ; int array[ ] = {4, 2}; int main( ){ int total; total = weight_sum( ) ; return 0; } weight_sum.c extern int *array; int *weight2; int weight1 = 1; int weight_sum( ){ int temp = 0; weight2 = &weight1; temp += weigth1*array[0] ; temp += *weight2*array[1] ; return temp; } For the code above, after the two object files above are linked together with the command line Id -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
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
