]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
tests: Add section attribute to defeat -freorder-blocks-and-partition.
authorMark Wielaard <mark@klomp.org>
Tue, 11 Sep 2018 10:58:14 +0000 (12:58 +0200)
committerMark Wielaard <mark@klomp.org>
Tue, 11 Sep 2018 10:58:14 +0000 (12:58 +0200)
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 <mark@klomp.org>
tests/ChangeLog
tests/backtrace-dwarf.c

index 2a20ffa51e13042e0e70cf19fa0e0a73e54131bb..8d70891a4b66db057d59cdff3861fa738bbca939 100644 (file)
@@ -1,3 +1,7 @@
+2018-09-11  Mark Wielaard  <mark@klomp.org>
+
+       * backtrace-dwarf.c (main): Add section attribute.
+
 2018-07-24  Mark Wielaard  <mark@klomp.org>
 
        * run-annobingroup.sh: Add testfile-annobingroup-i386.o tests.
index e1eb49288abf1b1e73965a5ab9f675d35cce4ba2..35f25ed6afcd1bc60811d23d88d5f6c2d158d6a1 100644 (file)
@@ -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.  */