Describe one possible structure (e.g. ELF) of an object file

The allocation and recovery of records stored in a heap
March 22, 2023
Explain a possible run-time data structure
March 22, 2023

Describe one possible structure (e.g. ELF) of an object file

2001 Paper 6 Question 6
Compiler Construction
(a) Describe one possible structure (e.g. ELF) of an object file. Illustrate your
answer by considering the form of object file which might result from the
following C program.
int a = 1, b = -1;
extern int g(int);
extern int c;
int f() { return g(a-b) + c; }
It is not necessary to consider the exact instruction sequence, just issues
concerning its interaction with the object file format. [10 marks]
(b) Describe how a linker takes a sequence of such programs and produces an
executable file. [4 marks]
(c) Compare and contrast static and dynamic linking in a system using your object
file format. [6 marks]