Site Tools


ivss-section-placement

Table of Contents

Section placement (ivss)

Section placement assigns runtime base addresses to combined sections. ivss accepts explicit linker requests using -place=name@address:

$ ./linker -hex \
    -place=my_code@0x40000000 \
    -place=my_data@0x50000000 \
    -o program.hex \
    main.o data.o

The code placement matches the emulator's initial program counter. The data placement gives symbols in my_data a base of 0x50000000. Their section-relative offsets are added when the loader resolves relocation values.

The linker stores requested bases in section headers. Sections without explicit nonzero placement are assigned linearly using the implementation's running offset. This is a simple placement mechanism, not a general linker-script language.

Placement does not insert branches between sections or change the processor's entry address. Code must actually exist where execution begins, and data references must use valid symbol relationships.

Use distinct, nonoverlapping ranges for deliberately placed sections. Inspect the linker's descriptive dump when checking layouts, then use -hex to produce the serialized representation expected by program loading.

Source: linker.c.

ivss-section-placement.md · Last modified: by 127.0.0.1