Skip to content

Assignments 14 objfiles

Mugundan edited this page Nov 27, 2026 · 1 revision

Stage 13: Object Files

Relevant source files

The following files were used as context for generating this wiki page:

Emit Toy ELF objects with correct encodings and relocations.

Purpose and Scope

Inst encodings in TableGen, ToyMCCodeEmitter, fixup kinds, ToyAsmBackend, ToyELFObjectWriter.

Read First

Tasks

  1. Fill Inst{31-26} etc. for every format from the overview.
  2. Fixups: fixup_toy_hi16, fixup_toy_lo16, fixup_toy_branch16, fixup_toy_call26; encoder methods for branch and call targets.
  3. applyFixup resolves local branches; others become relocations (pick an unused EM_ number and your own relocation numbers).

Tests

llc -filetype=obj on the stage-11 tests; llc -show-mc-encoding matches hand-encoded instructions; llvm-objdump -r shows relocations for global and external calls.

Done When

  • Every instruction encodes
  • Local branches resolved, external ones relocated

Stretch

Asm parser and disassembler (parser and disassembler) so llvm-mc and llvm-objdump -d work.

Next: stage 14. All Toy code and expected output on this page are illustrative, not LLVM source and not tool output; your exact output may differ.

Start here

Computer Organization & Architecture

Hexagon ISA

Operating Systems

C++ for LLVM Development

LLVM IR

SelectionDAG

Backend Assignments

Target Bring-up

Calling Conventions

Frame Lowering

MC Layer

Register Allocation

Scheduling

Clone this wiki locally