public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Fix possible alignment issue with dw2-dir-file-name test case
@ 2014-01-08 18:00 Andreas Arnez
  2014-01-10 11:29 ` Pedro Alves
  0 siblings, 1 reply; 15+ messages in thread
From: Andreas Arnez @ 2014-01-08 18:00 UTC (permalink / raw)
  To: gdb-patches; +Cc: Ulrich Weigand, Andreas Krebbel

Since upstream gcc has recently increased the function alignment on
S390, the dw2-dir-file-name test case fails in the first
gdb_continue_to_breakpoint.  Indeed, the breakpoint is now placed into
the alignment gap *before* the actual function.

This happens because the test case declares the respective "*_start"
symbol as a "loose" label before the function definition, and the
compiler inserts the alignment between that label and the function
itself.  The fix defines the "*_start" symbol as a global alias to the
function instead.

testsuite/
2014-01-08  Andreas Arnez  <arnez@linux.vnet.ibm.com>

	* gdb.dwarf2/dw2-dir-file-name.c (FUNC): Declare "*_start" symbol
	as an alias of the function instead of a label pointing before the
	function, to avoid possible alignment issues.
---
 gdb/testsuite/gdb.dwarf2/dw2-dir-file-name.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/gdb/testsuite/gdb.dwarf2/dw2-dir-file-name.c b/gdb/testsuite/gdb.dwarf2/dw2-dir-file-name.c
index 21a4d2a..a0a9731 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-dir-file-name.c
+++ b/gdb/testsuite/gdb.dwarf2/dw2-dir-file-name.c
@@ -63,13 +63,13 @@ FUNC (compdir_absolute_ldir_absolute_file_relative_different)	\
 FUNC (compdir_absolute_ldir_absolute_file_absolute_same)	\
 FUNC (compdir_absolute_ldir_absolute_file_absolute_different)
 
-#define FUNC(name)					\
-  asm (#name "_start: .globl " #name "_start\n");	\
-  static void						\
-  name (void)						\
-  {							\
-    v++;						\
-  }							\
+#define FUNC(name)						\
+  static void							\
+  name (void)							\
+  {								\
+    v++;							\
+  }								\
+  void name ## _start (void) __attribute__ ((alias (#name)));	\
   asm (#name "_end: .globl " #name "_end\n");
 FUNCBLOCK
 #undef FUNC
-- 
1.8.3.1

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2014-01-22 16:13 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-01-08 18:00 [PATCH] Fix possible alignment issue with dw2-dir-file-name test case Andreas Arnez
2014-01-10 11:29 ` Pedro Alves
2014-01-10 14:30   ` Andreas Arnez
2014-01-10 14:53     ` Jan Kratochvil
2014-01-10 16:39       ` Pedro Alves
2014-01-15 21:33         ` Edjunior Barbosa Machado
2014-01-16 14:37           ` Pedro Alves
2014-01-17 17:58             ` Andreas Arnez
2014-01-17 18:09               ` Pedro Alves
2014-01-17 18:20                 ` Pedro Alves
2014-01-20 19:47                   ` Andreas Arnez
2014-01-22 13:15                     ` Pedro Alves
2014-01-17 18:21               ` Edjunior Barbosa Machado
2014-01-22 16:13               ` Andreas Krebbel
2014-01-10 15:32     ` Pedro Alves

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).