[V4,05/14] gas: dw2gencfi: expose dot_cfi_sections for scfidw2gen

Message ID 20240103071526.3846985-6-indu.bhagat@oracle.com
State New
Headers
Series Synthesize CFI for hand-written asm |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_binutils_build--master-arm success Testing passed
linaro-tcwg-bot/tcwg_binutils_build--master-aarch64 success Testing passed
linaro-tcwg-bot/tcwg_binutils_check--master-aarch64 success Testing passed
linaro-tcwg-bot/tcwg_binutils_check--master-arm success Testing passed

Commit Message

Indu Bhagat Jan. 3, 2024, 7:15 a.m. UTC
  [No changes from V3 to V4]

[New patch in V3]

scfidw2gen will use this for processing the .cfi_sections directive.

gas/
        * dw2gencfi.c (dot_cfi_sections): Not static anymore.
        * dw2gencfi.h (dot_cfi_sections): Mark as extern.
---
 gas/dw2gencfi.c | 3 +--
 gas/dw2gencfi.h | 4 ++++
 2 files changed, 5 insertions(+), 2 deletions(-)
  

Patch

diff --git a/gas/dw2gencfi.c b/gas/dw2gencfi.c
index cdef8d09978..284691cd4c8 100644
--- a/gas/dw2gencfi.c
+++ b/gas/dw2gencfi.c
@@ -687,7 +687,6 @@  cfi_add_CFA_restore_state (void)
 
 static void dot_cfi (int);
 static void dot_cfi_escape (int);
-static void dot_cfi_sections (int);
 static void dot_cfi_startproc (int);
 static void dot_cfi_endproc (int);
 static void dot_cfi_fde_data (int);
@@ -1206,7 +1205,7 @@  dot_cfi_label (int ignored ATTRIBUTE_UNUSED)
   demand_empty_rest_of_line ();
 }
 
-static void
+void
 dot_cfi_sections (int ignored ATTRIBUTE_UNUSED)
 {
   int sections = 0;
diff --git a/gas/dw2gencfi.h b/gas/dw2gencfi.h
index f574826456a..9e29b55ace3 100644
--- a/gas/dw2gencfi.h
+++ b/gas/dw2gencfi.h
@@ -41,6 +41,10 @@  extern const pseudo_typeS cfi_pseudo_table[];
 # define tc_cfi_endproc(fde) ((void) (fde))
 #endif
 
+/* Parse CFI assembler directive .cfi_sections.  This is an external function
+   because SCFI functionality also uses the same implementation.  */
+extern void dot_cfi_sections (int);
+
 /* cfi_finish() is called at the end of file. It will complain if
    the last CFI wasn't properly closed by .cfi_endproc.  */
 extern void cfi_finish (void);