[RFC,2/9] gas: dw2gencfi: use all_cfi_sections instead of cfi_sections

Message ID 20230920230401.1739139-3-indu.bhagat@oracle.com
State New
Headers
Series SCFI implementation in GNU assembler |

Checks

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

Commit Message

Indu Bhagat Sept. 20, 2023, 11:03 p.m. UTC
  The code in dw2gencfi.c was checking variable cfi_sections and
all_cfi_sections seemingly randomly.  Accessing all_cfi_sections seems
to the correct variable to access.

The data in cfi_sections has already been propagated to all_cfi_sections
once cfi_dot_startproc () has been called.

gas/
        * dw2gencfi.c (dot_cfi_startproc): Use all_cfi_sections
	instead.
        (dot_cfi_endproc): Likewise.
        (dot_cfi_fde_data): Likewise.
---
 gas/dw2gencfi.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
  

Patch

diff --git a/gas/dw2gencfi.c b/gas/dw2gencfi.c
index cbfee0a0169..5fcfb373935 100644
--- a/gas/dw2gencfi.c
+++ b/gas/dw2gencfi.c
@@ -1316,7 +1316,7 @@  dot_cfi_startproc (int ignored ATTRIBUTE_UNUSED)
   if (!simple)
     tc_cfi_frame_initial_instructions ();
 
-  if ((cfi_sections & CFI_EMIT_target) != 0)
+  if ((all_cfi_sections & CFI_EMIT_target) != 0)
     tc_cfi_startproc ();
 }
 
@@ -1336,7 +1336,7 @@  dot_cfi_endproc (int ignored ATTRIBUTE_UNUSED)
 
   demand_empty_rest_of_line ();
 
-  if ((cfi_sections & CFI_EMIT_target) != 0)
+  if ((all_cfi_sections & CFI_EMIT_target) != 0)
     tc_cfi_endproc (last_fde);
 }
 
@@ -1417,8 +1417,8 @@  dot_cfi_fde_data (int ignored ATTRIBUTE_UNUSED)
 
   last_fde = frchain_now->frch_cfi_data->cur_fde_data;
 
-  if ((cfi_sections & CFI_EMIT_target) != 0
-      || (cfi_sections & CFI_EMIT_eh_frame_compact) != 0)
+  if ((all_cfi_sections & CFI_EMIT_target) != 0
+      || (all_cfi_sections & CFI_EMIT_eh_frame_compact) != 0)
     {
       struct cfi_escape_data *head, **tail, *e;
       int num_ops = 0;