From: Mark Wielaard Date: Tue, 11 Sep 2018 10:58:14 +0000 (+0200) Subject: tests: Add section attribute to defeat -freorder-blocks-and-partition. X-Git-Tag: elfutils-0.174~12 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a1e892e920bbde60a9daa1f98c105c227ee7427d;p=platform%2Fupstream%2Felfutils.git tests: Add section attribute to defeat -freorder-blocks-and-partition. GCC could partition main into an cold and hot block causing our symbol lookup to fail in the backtrace-dwarf testcase. Add a section attribute on "main" so that it will be kept together. Signed-off-by: Mark Wielaard --- diff --git a/tests/ChangeLog b/tests/ChangeLog index 2a20ffa..8d70891 100644 --- a/tests/ChangeLog +++ b/tests/ChangeLog @@ -1,3 +1,7 @@ +2018-09-11 Mark Wielaard + + * backtrace-dwarf.c (main): Add section attribute. + 2018-07-24 Mark Wielaard * run-annobingroup.sh: Add testfile-annobingroup-i386.o tests. diff --git a/tests/backtrace-dwarf.c b/tests/backtrace-dwarf.c index e1eb492..35f25ed 100644 --- a/tests/backtrace-dwarf.c +++ b/tests/backtrace-dwarf.c @@ -124,6 +124,7 @@ thread_callback (Dwfl_Thread *thread, void *thread_arg) } int +__attribute__((section(".main"))) /* Defeat -freorder-blocks-and-partition */ main (int argc __attribute__ ((unused)), char **argv) { /* We use no threads here which can interfere with handling a stream. */