Thus the distance between any instruction in the code

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: of the buf array. The .text section in the swap.o module contains five absolute references that are relocated in a similar way (See Problem 7.12). Figure 7.10 shows the relocated .text and .data sections in the final executable object file. Practice Problem 7.4: This problem concerns the relocated program in Figure 7.10. A. What is the hex address of the relocated reference to swap in line 5? B. What is the hex value of the relocated reference to swap in line 5? C. Suppose the linker had decided for some reason to locate the .text section at 0x80483b8 instead of 0x80483b4. What would the hex value of the relocated reference in line 5 be in this case? 370 CHAPTER 7. LINKING code/link/p-exe.d 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 080483b4 <main>: 80483b4: 55 80483b5: 89 e5 80483b7: 83 ec 08 80483ba: e8 09 00 00 00 80483bf: 31 c0 80483c1: 89 ec 80483c3: 5d 80483c4: c3 80483c5: 90 80483c6: 90 80483c7: 90 080483c8 <swap>: 80483c8: 55 80483c9: 8b 15 80483cf: a1 58 80483d4: 89 e5 80483d6: c7 05 80483dd: 94 04 80483e0: 89 ec 80483e2: 8b 0a 80483e4: 89 02 80...
View Full Document

This note was uploaded on 09/02/2010 for the course ELECTRICAL 360 taught by Professor Schultz during the Spring '10 term at BYU.

Ask a homework question - tutors are online