[PECOFF] Handle .drectve section.
authorRui Ueyama <ruiu@google.com>
Fri, 2 Aug 2013 21:26:14 +0000 (21:26 +0000)
committerRui Ueyama <ruiu@google.com>
Fri, 2 Aug 2013 21:26:14 +0000 (21:26 +0000)
commit4ecc59afce0c7004d149e1a25a89bd0372731404
treee2d0b36a5bda7a4ecdbb4debfc3d1124075ec6f5
parent1863e505ce36530596610f80934b86312aad3f63
[PECOFF] Handle .drectve section.

Summary:
The .drectve section contains linker command line options, and the linker is
expected to interpret them as if they were given via the command line. In this
patch, the command line parser in the driver is called from the object file
reader to parse the string.

I think this patch is important, because this is the first step towards mutable
TargetInfo. We had a discussion about that on llvm-commits mailing list before.
I haven't removed "const" from the function signature yet. Instead, I just use
cast to remove "const". This is a temporary aid for an experiment. If we don't
see any issue with this mutable TargetInfo appraoch, I'll change the function
signature, and rename the class LinkerContext from TargetInfo.

Reviewers: kledzik

CC: llvm-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D1246

llvm-svn: 187677
lld/lib/ReaderWriter/PECOFF/ReaderCOFF.cpp
lld/test/pecoff/Inputs/drectve.obj.yaml [new file with mode: 0644]
lld/test/pecoff/drectve.test [new file with mode: 0644]