]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
gas/dw2gencfi: correct .sframe section conditional
authorJan Beulich <jbeulich@suse.com>
Fri, 4 Oct 2024 07:36:56 +0000 (09:36 +0200)
committerJan Beulich <jbeulich@suse.com>
Fri, 4 Oct 2024 07:36:56 +0000 (09:36 +0200)
While originally this was in preparation of a subsequent change making
SUPPORT_FRAME_LINKONCE potentially dependent on a global variable, the
construct appears unlikely to have been correct in the first place: The
variable would have been passed reliably uninitialized when
SUPPORT_FRAME_LINKONCE is build-time true.

While there correct indentation of the parameters passed to
get_cfi_seg().

gas/dw2gencfi.c

index db0261dd18704544469077da9103a211cffe0f28..ca7605e7928e84ace20b13893134469f1db843cf 100644 (file)
@@ -2498,16 +2498,15 @@ cfi_finish (void)
        - .sframe in the .cfi_sections directive.  */
   if (flag_gen_sframe || (all_cfi_sections & CFI_EMIT_sframe) != 0)
     {
-      if (support_sframe_p ())
+      if (support_sframe_p () && !SUPPORT_FRAME_LINKONCE)
        {
          segT sframe_seg;
          int alignment = ffs (DWARF2_ADDR_SIZE (stdoutput)) - 1;
 
-         if (!SUPPORT_FRAME_LINKONCE)
-           sframe_seg = get_cfi_seg (NULL, ".sframe",
-                                        (SEC_ALLOC | SEC_LOAD | SEC_DATA
-                                         | DWARF2_EH_FRAME_READ_ONLY),
-                                        alignment);
+         sframe_seg = get_cfi_seg (NULL, ".sframe",
+                                   (SEC_ALLOC | SEC_LOAD | SEC_DATA
+                                    | DWARF2_EH_FRAME_READ_ONLY),
+                                   alignment);
          output_sframe (sframe_seg);
        }
       else