Commit Graph

4 Commits

Author SHA1 Message Date
David Majnemer 22dff0aafc [COFF] Don't hard-code the load configuration size
The load configuration directory is a structure whose size varies as the
OS gains additional functionality.  To account for this, the structure's
layout begins with a size field; this allows loaders to know which
fields are available.

However, LLD hard-coded the sizes (112 bytes for 64-bit and 64 for
32-bit).  This means that we might not inform the loader of all the
pertinent fields or we might claim that there are more fields than are
actually present.

To correctly account for this, the size field must be loaded from the
_load_config_used symbol.

N.B.  The COFF spec is either wrong or out of date, the load
configuration directory is not correctly documented in the
specification: it omits the size field.

llvm-svn: 263543
2016-03-15 09:48:27 +00:00
Rui Ueyama 6872455c6d COFF: Make test commands shorter. NFC.
llvm-svn: 244227
2015-08-06 16:47:46 +00:00
Rui Ueyama 251b0e268b COFF: Remove the old COFF linker and make link an alias to link2.
It's time to remove old COFF linker because the new one is now complete.

llvm-svn: 244226
2015-08-06 16:19:35 +00:00
Rui Ueyama afad42f9ea COFF: Set Load Configuration entry in Data Directory.
Load Configuration field points to a structure containing information
for SEH. That data strucutre is not created by the linker but provided
by an external file. What we have to do is just to set __load_config_used
address to the header.

llvm-svn: 242427
2015-07-16 18:30:35 +00:00