mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-23 19:23:23 +01:00
b632d8aff2
On ELF targets, if a function has uwtable or personality, or does not have nounwind (`needsUnwindTableEntry`), it marks that `.eh_frame` is needed in the module. Then, a function gets `.eh_frame` if `needsUnwindTableEntry` or `-g[123]` is specified. (i.e. If -g[123], every function gets `.eh_frame`. This behavior is strange but that is the status quo on GCC and Clang.) Let's take asan as an example. Other sanitizers are similar. `asan.module_[cd]tor` has no attribute. `needsUnwindTableEntry` returns true, so every function gets `.eh_frame` if `-g[123]` is specified. This is the root cause that `-fno-exceptions -fno-asynchronous-unwind-tables -g` produces .debug_frame while `-fno-exceptions -fno-asynchronous-unwind-tables -g -fsanitize=address` produces .eh_frame. This patch * sets the nounwind attribute on sanitizer module ctor/dtor. * let Clang emit a module flag metadata "uwtable" for -fasynchronous-unwind-tables. If "uwtable" is set, sanitizer module ctor/dtor additionally get the uwtable attribute. The "uwtable" mechanism is generic: synthesized functions not cloned/specialized from existing ones should consider `Function::createWithDefaultAttr` instead of `Function::create` if they want to get some default attributes which have more of module semantics. Other candidates: "frame-pointer" (https://github.com/ClangBuiltLinux/linux/issues/955 https://github.com/ClangBuiltLinux/linux/issues/1238), dso_local, etc. Differential Revision: https://reviews.llvm.org/D100251 |
||
---|---|---|
.. | ||
abort-in-entry-block.ll | ||
backedge-pruning.ll | ||
chains.ll | ||
cmp-tracing-api-x86_32.ll | ||
cmp-tracing-api-x86_64.ll | ||
cmp-tracing.ll | ||
coff-comdat.ll | ||
coff-pc-table-inline-8bit-counters.ll | ||
coff-pc-table-inline-bool-flag.ll | ||
coff-used-ctor.ll | ||
const-cmp-tracing.ll | ||
coverage2-dbg.ll | ||
coverage-dbg.ll | ||
coverage.ll | ||
crit-edge-sancov.ll | ||
div-tracing.ll | ||
gep-tracing.ll | ||
inline-8bit-counters.ll | ||
inline-bool-flag.ll | ||
interposable-symbol.ll | ||
no-func.ll | ||
pc-table.ll | ||
postdominator_check.ll | ||
seh.ll | ||
stack-depth-variable-declared-by-user.ll | ||
stack-depth.ll | ||
switch-tracing.ll | ||
trace-pc-guard-inline-8bit-counters.ll | ||
trace-pc-guard-inline-bool-flag.ll | ||
trace-pc-guard.ll | ||
tracing-comdat.ll | ||
tracing.ll | ||
unreachable-critedge.ll | ||
wineh.ll |