1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 19:23:23 +01:00
llvm-mirror/test/Instrumentation/SanitizerCoverage
Fangrui Song b632d8aff2 [IR][sanitizer] Set nounwind on module ctor/dtor, additionally set uwtable if -fasynchronous-unwind-tables
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
2021-04-21 15:58:20 -07:00
..
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 [SanitizerCoverage] Use External on Windows 2021-03-22 23:05:36 -07:00
coff-pc-table-inline-bool-flag.ll [SanitizerCoverage] Use External on Windows 2021-03-22 23:05:36 -07:00
coff-used-ctor.ll
const-cmp-tracing.ll
coverage2-dbg.ll
coverage-dbg.ll
coverage.ll
crit-edge-sancov.ll [SantizerCoverage] handle missing DBG MD when inserting libcalls 2021-04-12 15:55:58 -07:00
div-tracing.ll
gep-tracing.ll
inline-8bit-counters.ll [SanitizerCoverage] Make __start_/__stop_ symbols extern_weak 2021-03-18 16:46:04 -07:00
inline-bool-flag.ll [SanitizerCoverage] Make __start_/__stop_ symbols extern_weak 2021-03-18 16:46:04 -07:00
interposable-symbol.ll [SanitizerCoverage] Drop !associated on metadata sections 2021-02-25 11:59:23 -08:00
no-func.ll
pc-table.ll [SanitizerCoverage] Make __start_/__stop_ symbols extern_weak 2021-03-18 16:46:04 -07:00
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 [IR][sanitizer] Set nounwind on module ctor/dtor, additionally set uwtable if -fasynchronous-unwind-tables 2021-04-21 15:58:20 -07:00
trace-pc-guard-inline-bool-flag.ll [IR][sanitizer] Set nounwind on module ctor/dtor, additionally set uwtable if -fasynchronous-unwind-tables 2021-04-21 15:58:20 -07:00
trace-pc-guard.ll [IR][sanitizer] Set nounwind on module ctor/dtor, additionally set uwtable if -fasynchronous-unwind-tables 2021-04-21 15:58:20 -07:00
tracing-comdat.ll
tracing.ll
unreachable-critedge.ll
wineh.ll