Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

main.c extern int weight_sum( ) ; int array[ ] = {4, 2}; int main( ){ int total; total = weight_sum( ) ; return 0; }

image text in transcribed

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Modern Database Management

Authors: Jeff Hoffer, Ramesh Venkataraman, Heikki Topi

12th edition

133544613, 978-0133544619

More Books

Students also viewed these Databases questions

Question

How well do we currently work together?

Answered: 1 week ago