[PATCH] D70163: Warn on /align if used without /driver
Rui Ueyama via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Nov 13 20:18:20 PST 2019
This revision was automatically updated to reflect the committed changes.
Closed by commit rG000ff301e74b: Warn on /align if used without /driver (authored by ruiu).
Changed prior to commit:
https://reviews.llvm.org/D70163?vs=229006&id=229221#toc
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D70163/new/
https://reviews.llvm.org/D70163
Files:
lld/COFF/Driver.cpp
lld/test/COFF/align.s
Index: lld/test/COFF/align.s
===================================================================
--- lld/test/COFF/align.s
+++ lld/test/COFF/align.s
@@ -4,6 +4,19 @@
# CHECK: SectionAlignment: 32
+# RUN: lld-link /out:%t.exe /entry:main /align:32 %t.obj 2>&1 \
+# RUN: | FileCheck -check-prefix=WARN1 %s
+
+# WARN1: /align specified without /driver; image may not run
+
+# RUN: lld-link /out:%t.exe /entry:main /align:32 %t.obj /driver 2>&1 \
+# RUN: | FileCheck -check-prefix=WARN2 --allow-empty %s
+
+# RUN: lld-link /out:%t.exe /entry:main %t.obj /driver 2>&1 \
+# RUN: | FileCheck -check-prefix=WARN2 --allow-empty %s
+
+# WARN2-NOT: /align specified without /driver; image may not run
+
--- !COFF
header:
Machine: IMAGE_FILE_MACHINE_AMD64
Index: lld/COFF/Driver.cpp
===================================================================
--- lld/COFF/Driver.cpp
+++ lld/COFF/Driver.cpp
@@ -1479,6 +1479,8 @@
parseNumbers(arg->getValue(), &config->align);
if (!isPowerOf2_64(config->align))
error("/align: not a power of two: " + StringRef(arg->getValue()));
+ if (!args.hasArg(OPT_driver))
+ warn("/align specified without /driver; image may not run");
}
// Handle /aligncomm
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D70163.229221.patch
Type: text/x-patch
Size: 1234 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191114/22a76489/attachment.bin>
More information about the llvm-commits
mailing list