Computer Systems: A Programmer's Perspective (3rd Edition)
Computer Systems: A Programmer's Perspective (3rd Edition)
3rd Edition
ISBN: 9780134092997
Author: Bryant
Publisher: PEARSON
Expert Solution & Answer
Book Icon
Chapter 7, Problem 7.12HW

A.

Explanation of Solution

Computing the value of the relocated reference to “swap” in the “callq” instruction:

From the given question, the function “swap” in object file “m.o” is

9: e8 00 00 00 00callqe<main+oxe>

From the given question,

r.offset=0xar.symbol=swapr.type=R_X86_64_PC32r.addend=-4

And then value of “ADDR(.text)” is “0x4004e0” and value of “ADDR(swap)” is “0x4004f8”.

  • ADDR(s)=ADDR(.text)=0x4004e0
    • Here “ADDR” means run-time addresses for each section.
  • ADDR(r.symbol)=ADDR(swap)=0x4004f8

Compute the run time address of the references using the formula of “refaddr = ADDR(s) + r.offset”

refaddr=ADDR(s)+r

B.

Explanation of Solution

Computing the value of the relocated reference to “swap” in the “callq” instruction:

From the given question, the function “swap” in object file “m.o” is

9: e8 00 00 00 00callqe<main+oxe>

From the given question,

From the given question,

r.offset=0xar.symbol=swapr.type=R_X86_64_PC32r.addend=-4

And then value of “ADDR(.text)” is “0x4004d0” and value of “ADDR(swap)” is “0x400500”.

  • ADDR(s)=ADDR(.text)=0x4004d0
    • Here “ADDR” means run-time addresses for each section.
  • ADDR(r.symbol)=ADDR(swap)=0x400500

Compute the run time address of the references using the formula of “refaddr = ADDR(s) + r.offset”

refaddr=ADDR(s)+r

Blurred answer
Students have asked these similar questions
Do execution paths 3 and 4 encompass the first three conditions for a deadlock to occur?
1. In a certain device, the disk rotates at 5000rpm. a) how long does one revolution take? b) what is the average rotational delay of this disk drive 2. Consider a disk dirve with 1000 tracks, numbered 0 to 999. The request queue has the following composition: 300 740 150 940 200 850 145 555 775 695. The current position is 197 and the previous request was served at 100. For each of the following disk scheduling algorithsm, compute the total distance (in tracks) that the disk arm would move. Include the calculation steps in your answers. 2.1 First - In-First-Out (FIFO) 2.2 Shortest - Service-Time - First (SSTF) 2.3 SCAN (no LOOK variation) 2.4 C-SCAN (No C-LOOK variation)
Input file sample.txt contains a hex dump of some data in the following format:<address> <byte1> <byte2> ... <byte16>Example Input File:00000000 54 68 69 73 20 69 73 20 61 6e 20 65 78 61 6d00000010 70 6c 65 20 6f 66 20 68 65 78 20 64 75 6d 70...Construct a pipeline using Ubuntu bash to discard the first column (address) and to reformat bytesinto a single column:
Knowledge Booster
Background pattern image
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Text book image
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Text book image
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
Text book image
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Text book image
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Text book image
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education