Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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, 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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started