summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMark Wielaard <[email protected]>2018-09-11 12:58:14 +0200
committerMark Wielaard <[email protected]>2018-09-11 12:58:14 +0200
commita1e892e920bbde60a9daa1f98c105c227ee7427d (patch)
tree85f4293de77f7e5f6377d54c75ad6788da1442b8 /tests
parent08ed26703d658b7ae57ab60b865d05c1cde777e3 (diff)
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 <[email protected]>
Diffstat (limited to 'tests')
-rw-r--r--tests/ChangeLog4
-rw-r--r--tests/backtrace-dwarf.c1
2 files changed, 5 insertions, 0 deletions
diff --git a/tests/ChangeLog b/tests/ChangeLog
index 2a20ffa5..8d70891a 100644
--- a/tests/ChangeLog
+++ b/tests/ChangeLog
@@ -1,3 +1,7 @@
+2018-09-11 Mark Wielaard <[email protected]>
+
+ * backtrace-dwarf.c (main): Add section attribute.
+
2018-07-24 Mark Wielaard <[email protected]>
* run-annobingroup.sh: Add testfile-annobingroup-i386.o tests.
diff --git a/tests/backtrace-dwarf.c b/tests/backtrace-dwarf.c
index e1eb4928..35f25ed6 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. */