diff options
-rw-r--r-- | gcc/opts.cc | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/live-patching-2.c | 4 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/live-patching-5.c | 8 |
3 files changed, 13 insertions, 4 deletions
diff --git a/gcc/opts.cc b/gcc/opts.cc index eb5db01..ae079fc 100644 --- a/gcc/opts.cc +++ b/gcc/opts.cc @@ -1288,8 +1288,9 @@ finish_options (struct gcc_options *opts, struct gcc_options *opts_set, "%<-fsanitize=kernel-address%>"); /* Currently live patching is not support for LTO. */ - if (opts->x_flag_live_patching && opts->x_flag_lto) - sorry ("live patching is not supported with LTO"); + if (opts->x_flag_live_patching == LIVE_PATCHING_INLINE_ONLY_STATIC && opts->x_flag_lto) + sorry ("live patching (with %qs) is not supported with LTO", + "inline-only-static"); /* Currently vtable verification is not supported for LTO */ if (opts->x_flag_vtable_verify && opts->x_flag_lto) diff --git a/gcc/testsuite/gcc.dg/live-patching-2.c b/gcc/testsuite/gcc.dg/live-patching-2.c index 0dde4e9..1c4f922 100644 --- a/gcc/testsuite/gcc.dg/live-patching-2.c +++ b/gcc/testsuite/gcc.dg/live-patching-2.c @@ -1,10 +1,10 @@ /* { dg-do compile } */ /* { dg-require-effective-target lto } */ -/* { dg-options "-O2 -flive-patching -flto" } */ +/* { dg-options "-O2 -flive-patching=inline-only-static -flto" } */ int main() { return 0; } -/* { dg-message "sorry, unimplemented: live patching is not supported with LTO" "-flive-patching and -flto together" { target *-*-* } 0 } */ +/* { dg-message "sorry, unimplemented: live patching \\(with 'inline-only-static'\\) is not supported with LTO" "-flive-patching and -flto together" { target *-*-* } 0 } */ diff --git a/gcc/testsuite/gcc.dg/live-patching-5.c b/gcc/testsuite/gcc.dg/live-patching-5.c new file mode 100644 index 0000000..098047a --- /dev/null +++ b/gcc/testsuite/gcc.dg/live-patching-5.c @@ -0,0 +1,8 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target lto } */ +/* { dg-options "-O2 -flive-patching -flto" } */ + +int main() +{ + return 0; +} |