1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-18 18:42:46 +02:00
llvm-mirror/utils
Nico Weber 1aeeff713a lld-link: Reject more than one resource .obj file
Users are exepcted to pass all .res files to the linker, which then
merges all the resource in all .res files into a tree structure and then
converts the final tree structure to a .obj file with .rsrc$01 and
.rsrc$02 sections and then links that.

If the user instead passes several .obj files containing such resources,
the correct thing to do would be to have custom code to merge the trees
in the resource sections instead of doing normal section merging -- but
link.exe rejects if multiple resource obj files are passed in with
LNK4078, so let lld-link do that too instead of silently writing broken
.rsrc sections in that case.

The only real way to run into this is if users manually convert .res
files to .obj files by running cvtres and then handing the resulting
.obj files to lld-link instead, which in practice likely never happens.

(lld-link is slightly stricter than link.exe now: If link.exe is passed
one .obj file created by cvtres, and a .res file, for some reason it
just emits a warning instead of an error and outputs strange looking
data. lld-link now errors out on mixed input like this.)

One way users could accidentally run into this is the following
scenario: If a .res file is passed to lib.exe, then lib.exe calls
cvtres.exe on the .res file before putting it in the output .lib.
(llvm-lib currently doesn't do this.)
link.exe's /wholearchive seems to only add obj files referenced from the
static library index, but lld-link current really adds all files in the
archive. So if lld-link /wholearchive is used with .lib files produced
by lib.exe and .res files were among the files handed to lib.exe, we
previously silently produced invalid output, but now we error out.

link.exe's /wholearchive semantics on the other hand mean that it
wouldn't load the resource object files from the .lib file at all.
Since this scenario is probably still an unlikely corner case,
the difference in behavior here seems fine -- and lld-link might have to
change to use link.exe's /wholearchive semantics in the future anyways.

Vaguely related to PR42180.

Differential Revision: https://reviews.llvm.org/D63109

llvm-svn: 363078
2019-06-11 15:22:28 +00:00
..
benchmark Silence CMP0048 warning in the benchmark utility library 2018-12-14 00:17:12 +00:00
bugpoint
count Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
crosstool
docker [build] Rename clang-headers to clang-resource-headers 2019-03-04 21:19:53 +00:00
emacs IR: Add immarg attribute 2019-03-12 21:02:54 +00:00
FileCheck FileCheck: Improve FileCheck variable terminology 2019-05-23 00:10:14 +00:00
fpcmp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
gdb-scripts Fix GDB pretty printer for Optional after r354246 2019-05-28 20:22:16 +00:00
git
git-svn [git] Be more specific when looking for llvm-svn 2019-05-23 18:43:19 +00:00
gn lld-link: Reject more than one resource .obj file 2019-06-11 15:22:28 +00:00
jedit
kate [TableGen] Introduce !listsplat 'binary' operator 2019-04-10 18:26:36 +00:00
KillTheDoctor Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
lint Python compat - print statement 2019-01-03 14:11:33 +00:00
lit Fix string literals to avoid deprecation warnings in regexp patterns 2019-06-07 21:14:33 +00:00
llvm-build Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
llvm-lit [lit] llvm-lit.in: specify file encoding to UTF-8 2019-01-14 20:02:11 +00:00
LLVMVisualizers Visualizer for APInt and remove obsolete visualizer 2019-06-08 00:23:08 +00:00
Misc
not Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
PerfectShuffle Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
release merge-request.sh: Update 8.0 metabug for 8.0.1 2019-03-25 17:01:29 +00:00
Reviewing Python compat - iteritems() vs. items() 2019-01-03 14:12:23 +00:00
sanitizers Add a ubsan blacklist entry for libstdc++ 8.0.1. 2018-11-21 23:04:39 +00:00
TableGen [RISCV] Replace map with set in getReqFeatures 2019-06-10 17:15:45 +00:00
Target/ARM Python compat - print statement 2019-01-03 14:11:33 +00:00
testgen
textmate
unittest Revert CMake: Make most target symbols hidden by default 2019-06-11 03:21:13 +00:00
UpdateTestChecks UpdateTestChecks: hexagon support 2019-06-05 14:08:01 +00:00
valgrind
vim Line wrap README file 2019-03-14 21:09:14 +00:00
vscode
yaml-bench Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
abtest.py utils/abtest: Refactor and add bisection method 2018-09-07 17:08:44 +00:00
bisect
bisect-skip-count Document bisect-skip-count 2018-10-22 14:04:13 +00:00
bugpoint_gisel_reducer.py Add a utility to reduce GlobalISel tests 2018-01-23 19:47:10 +00:00
check-each-file
clang-parse-diagnostics-file
codegen-diff
collect_and_build_with_pgo.py [utils] collect_and_build_with_pgo.py: revert part already fixed in rL345461 2018-10-27 23:10:09 +00:00
countloc.sh Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
create_ladder_graph.py Pythran compat - range vs. xrange 2019-01-03 14:11:58 +00:00
demangle_tree.py Python compat - print statement 2019-01-03 14:11:33 +00:00
DSAclean.py Python compat - print statement 2019-01-03 14:11:33 +00:00
DSAextract.py Python compat - print statement 2019-01-03 14:11:33 +00:00
extract_symbols.py Fix some user facing typos 2018-03-17 17:30:08 +00:00
extract_vplan.py Python compat - print statement 2019-01-03 14:11:33 +00:00
findmisopt
findoptdiff
findsym.pl
GenLibDeps.pl
GetRepositoryPath
GetSourceVersion
getsrcs.sh Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
indirect_calls.py Python compat - print statement 2019-01-03 14:11:33 +00:00
lldbDataFormatters.py [utils] Add a lldb data formatter for llvm::SmallString. 2019-04-25 00:03:02 +00:00
llvm-compilers-check Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
llvm-gisel-cov.py Python compat - print statement 2019-01-03 14:11:33 +00:00
llvm-native-gxx
llvm.grm
LLVMBuild.txt Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
llvmdo Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
llvmgrep Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
prepare-code-coverage-artifact.py svn propset svn:executable on utils/prepare-code-coverage-artifact.py 2019-06-04 23:35:07 +00:00
schedcover.py Python compat - map/filter 2019-01-03 14:12:30 +00:00
shuffle_fuzz.py Pythran compat - range vs. xrange 2019-01-03 14:11:58 +00:00
shuffle_select_fuzz_tester.py Python compat - print statement 2019-01-03 14:11:33 +00:00
sort_includes.py
unicode-case-fold.py Python compat - urllib 2019-01-03 14:12:44 +00:00
update_analyze_test_checks.py Add wildcard support to all update_*_test_checks.py scripts (PR37500) 2019-03-05 10:44:37 +00:00
update_cc_test_checks.py Fix LLVM IR check lines in utils/update_cc_test_checks.py 2018-03-14 17:47:07 +00:00
update_llc_test_checks.py UpdateTestChecks: fix AMDGPU handling 2019-05-18 13:00:03 +00:00
update_mca_test_checks.py [utils] Fix update scripts output when run on python3. 2019-01-30 16:15:59 +00:00
update_mir_test_checks.py Add wildcard support to all update_*_test_checks.py scripts (PR37500) 2019-03-05 10:44:37 +00:00
update_test_checks.py [utils] update_test_checks.py: allow opt-8, opt-9 2019-05-12 04:55:09 +00:00
UpdateCMakeLists.pl
wciia.py Python compat - print statement 2019-01-03 14:11:33 +00:00