diff options
author | Davide Italiano <davide@freebsd.org> | 2016-04-01 00:35:29 +0000 |
---|---|---|
committer | Davide Italiano <davide@freebsd.org> | 2016-04-01 00:35:29 +0000 |
commit | 8eca282dc97698b98fd02636eaa260cea267ca31 (patch) | |
tree | a5bad730f531101fd59d5ac5feea45e0c118595a /lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp | |
parent | e9148dd62f42531703d8d7995549ec4cf4f9e363 (diff) | |
download | bcm5719-llvm-8eca282dc97698b98fd02636eaa260cea267ca31.tar.gz bcm5719-llvm-8eca282dc97698b98fd02636eaa260cea267ca31.zip |
[LTO] Inherit options from Codegen before initializing TargetMachine.
This fixes bootstrap of llvm-tblgen (with LTO) and PR27150.
Slightly longer explanation follows.
Emission of .init_array instead of .ctors is supported only on a
subset of the Target LLVM supports. Codegen needs to be conservative
and always emit .ctors unless instructed otherwise (based on target).
If the dynamic linker sees .init_array it completely ignores
what's inside .ctors and therefore some constructors are not called
(and this causes llvm-tblgen to crash on startup).
Teach LLD/LTO about the Codegen options so we end up always emitting
.init_array and avoid this issue.
In future, we might end up supporting mix of .ctors and .init_array
in different input files if this shows up as a real-world use case.
The way gold handles this case is mapping .ctors from input into
.init_array in output. There's also another caveat because
as far as I understand .ctors run in reverse order so when we do
the copy/mapping we need to reverse copy in the output if there's
more than one ctor. That's why I'd rather avoid this complicate logic
unless there's a real need.
An analogous reasoning holds for .dtors/.fini_array.
llvm-svn: 265085
Diffstat (limited to 'lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp')
0 files changed, 0 insertions, 0 deletions