# Section merging (ivss) **Section merging** concatenates same-named section contents from different objects. For example, two separately assembled inputs can contribute words to `my_data`: ```asm # first.s .section my_data first: .word 11 ``` ```asm # second.s .section my_data second: .word 22 ``` Linking `first.o` before `second.o` places the second contribution after the first. The combined data bytes are `0b 00 00 00 16 00 00 00`, and `second` moves from offset zero in its input to offset four in the combined section. For an incoming section-relative offset $o$ and existing output length $L$, the adjusted location is: $$ o'=L+o $$ The linker also adjusts relocation positions and maps their symbol indices to the combined symbol table. Simply copying bytes would leave those references pointing at the wrong records or offsets. This operation establishes positions within a section. [[ivss-section-placement|Section placement]] subsequently determines the section's runtime base address. Changing input order can therefore change symbol positions even when the section has the same final base. Source: [elf.c](https://github.com/yanevskiv/ivss/blob/main/src/elf.c).