Hello all,
I am handling a special architecture’s relocation in COFF. Such relocation (IMAGE_REL_RELSEC) is used specifically in static linked executables:
$ llvm-objdump -d -r foo1.obj:
Disassembly of section .text:
00: mov 04, r2
00000002: IMAGE_REL_RELSEC .text
04: …
$ llvm-objdump -d -r foo2.obj:
Disassembly of section .text:
00: mov 04, r2
00000002: IMAGE_REL_RELSEC .text
04: …
And the expected output will be:
$ lld-link /out:foo.exe foo1.obj foo2.obj
$ llvm-objdump -d foo.exe:
40000000: mov 40000004, r2
40000004: …
40000008: mov 4000000c, r2
4000000c: …
PS. 40000004 = Addend (4) + Image Base (40000000) + Instruction RVA (0)
4000000c = Addend (4) + Image Base (40000000) + Instruction RVA (8)
In Summary, such relocation stores addend that relative to .text section. Linker is expected to fix the relocation of the instruction by image base and the instruction RVA. I am wondering whether there is other relocation like IMAGE_REL_RELSEC therefore I can take a look of it.
Thanks for you reply