COFF: Support base relocations.
authorRui Ueyama <ruiu@google.com>
Mon, 15 Jun 2015 01:23:58 +0000 (01:23 +0000)
committerRui Ueyama <ruiu@google.com>
Mon, 15 Jun 2015 01:23:58 +0000 (01:23 +0000)
commit588e832d0aa608ab5e8f6a30248fdc39207f2a84
tree7536feebb13ac0b22faa5df3d276eb212ce49b87
parent0bee1d7ff1e14fffbc6bbdf50e5324ea4c92aeef
COFF: Support base relocations.

PE/COFF executables/DLLs usually contain data which is called
base relocations. Base relocations are a list of addresses that
need to be fixed by the loader if load-time relocation is needed.

Base relocations are in .reloc section.

We emit one base relocation entry for each IMAGE_REL_AMD64_ADDR64
relocation.

In order to save disk space, base relocations are grouped by page.
Each group is called a block. A block starts with a 32-bit page
address followed by 16-bit offsets in the page. That is more
efficient representation of addresses than just an array of 32-bit
addresses.

llvm-svn: 239710
lld/COFF/Chunks.cpp
lld/COFF/Chunks.h
lld/COFF/Config.h
lld/COFF/Driver.cpp
lld/COFF/README.md
lld/COFF/Writer.cpp
lld/COFF/Writer.h
lld/test/COFF/Inputs/baserel.obj.yaml [new file with mode: 0644]
lld/test/COFF/baserel.test [new file with mode: 0644]