It seems at some point the .size hook was hijacked to emit some
machine-specific directives, and the actual .size directive was
forgotten.  This caused problems for split-stack support, since
linker couldn't scan the function body for non-split-stack calls.

gcc/ChangeLog:

        * config/s390/s390.c (s390_asm_declare_function_size): Add code
        to actually emit the .size directive.
---
 gcc/ChangeLog          | 5 +++++
 gcc/config/s390/s390.c | 4 +++-
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 2c572a7..6aef3f9 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,10 @@
 2016-01-02  Marcin Kościelnicki  <koria...@0x04.net>
 
+       * config/s390/s390.c (s390_asm_declare_function_size): Add code
+       to actually emit the .size directive.
+
+2016-01-02  Marcin Kościelnicki  <koria...@0x04.net>
+
        * config/s390/s390.md (pool_section_start): Use switch_to_section
        to select proper read-only data section instead of hardcoding .rodata.
        (pool_section_end): Use switch_to_section to match the above.
diff --git a/gcc/config/s390/s390.c b/gcc/config/s390/s390.c
index 16045f0..9dc8d1e 100644
--- a/gcc/config/s390/s390.c
+++ b/gcc/config/s390/s390.c
@@ -6834,8 +6834,10 @@ s390_asm_output_function_prefix (FILE *asm_out_file,
 
 void
 s390_asm_declare_function_size (FILE *asm_out_file,
-                               const char *fnname ATTRIBUTE_UNUSED, tree decl)
+                               const char *fnname, tree decl)
 {
+  if (!flag_inhibit_size_directive)
+    ASM_OUTPUT_MEASURED_SIZE (asm_out_file, fnname);
   if (DECL_FUNCTION_SPECIFIC_TARGET (decl) == NULL)
     return;
   fprintf (asm_out_file, "\t.machine pop\n");
-- 
2.6.4

Reply via email to