COMPSCI 61C Lecture Notes - Lecture 13: Data Segment, Object Code, Call Stack

50 views2 pages

Document Summary

Combines several object les (. o) into a single executable (linking) Linking process: take text segment from each . o le and put them together, take data segment from each . o le, put them together, and concatenate this onto end of text segments, resolve references. Pc-relative (beq, bne) never relocate preserved even if code moves. Static data reference (lui and ori): always relocate. Linker assumes word of rst text segment is at address 0x04000000. Linker knows: length of each text and data segment order of text and data segments. Linker calculates absolute address of each label being jumped to (internal / external) and each piece of data being referenced. To resolve references search for reference (data / label) in all user symbol tables if not found, search library les (ex. printf) once absolute address is determined, ll in machine code appropriately. Output of linker: executable le containing text and data (plus header)

Get access

Grade+
$40 USD/m
Billed monthly
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
10 Verified Answers
Class+
$30 USD/m
Billed monthly
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
7 Verified Answers

Related Documents