Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[lld/COFF] Improve handling of the /manifestdependency: flag
If multiple /manifestdependency: flags are passed, they are naively deduped, but after that each of them should have an effect, instead of just the last one. Also, /manifestdependency: flags are allowed in .drectve sections (from `#pragma comment(linker, ...`). To make the interaction between /manifestdependency: flags enabling manifest by default but /manifest:no overriding this work, add an explict ManifestKind::Default state to represent no explicit /manifest flag being passed. To make /manifestdependency: flags from input file .drectve sections work with /manifest:embed, delay embedded manifest emission until after input files have been read. Differential Revision: https://reviews.llvm.org/D108628
- Loading branch information
Showing
6 changed files
with
138 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--- !COFF | ||
header: | ||
Machine: IMAGE_FILE_MACHINE_AMD64 | ||
Characteristics: [] | ||
sections: | ||
- Name: .drectve | ||
Characteristics: [ IMAGE_SCN_LNK_INFO, IMAGE_SCN_LNK_REMOVE ] | ||
Alignment: 1 | ||
# "/manifestdependency:foo='bar'" "/manifestdependency:baz='quux'" | ||
# (pipe into `xxd -p -r` to recover raw contents; pipe into `xxd -p` to put | ||
# something new here.) | ||
SectionData: 222f6d616e6966657374646570656e64656e63793a666f6f3d27626172272220222f6d616e6966657374646570656e64656e63793a62617a3d27717575782722 | ||
symbols: | ||
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,15 @@ | ||
REQUIRES: x86, gnutar, manifest_tool | ||
|
||
manifest-related files are compiled to a .res file and the .res file is | ||
added to the repro archive, instead of adding the inputs. | ||
|
||
RUN: rm -rf %t && mkdir %t && cd %t | ||
RUN: lld-link -entry:__ImageBase -nodefaultlib -linkrepro:%t \ | ||
RUN: -manifest:embed %p/Inputs/std32.lib -subsystem:console \ | ||
RUN: -manifestinput:%p/Inputs/manifestinput.test | ||
|
||
RUN: tar tf repro.tar | FileCheck --check-prefix=LIST %s | ||
RUN: tar xOf repro.tar repro/response.txt | FileCheck %s | ||
RUN: tar xOf repro.tar repro/response.txt \ | ||
RUN: | FileCheck --implicit-check-not=.manifest.res %s | ||
|
||
LIST: manifest.res | ||
LIST: {{.*}}manifestinput.test | ||
|
||
CHECK-NOT: -manifest: | ||
CHECK: .manifest.res | ||
CHECK-NOT: -manifest: | ||
CHECK-DAG: -manifest:embed | ||
CHECK-DAG: -manifestinput:{{.*}}manifestinput.test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters