diff mbox series

[Darwin] Use switch_to_section () in darwin_file_end.

Message ID 3D2F28A5-4956-416E-842E-C4C83D4C0436@sandoe.co.uk
State New
Headers show
Series [Darwin] Use switch_to_section () in darwin_file_end. | expand

Commit Message

Iain Sandoe May 18, 2019, 8:10 a.m. UTC
One I’ve had hanging around in my local trees for a long time.

We have been emitting two section switches in the Darwin's
file end function by outputting the asm directly.  This means that
varasm’s tracking of the section switched  is not updated
which could matter if we elect to reorder some of the file
end operations in support of LTO actions.

tested on powerpc-darwin9, x86_64-darwin18
applied to mainline
Iain

gcc/

2019-05-18  Iain Sandoe  <iain@sandoe.co.uk>

        * config/darwin.c (darwin_file_end): Use switch_to_section ()
        instead of direct output of the asm.
diff mbox series

Patch

diff --git a/gcc/config/darwin.c b/gcc/config/darwin.c
index f62f1c7..17e1801 100644
--- a/gcc/config/darwin.c
+++ b/gcc/config/darwin.c
@@ -2939,12 +2939,10 @@  darwin_file_end (void)
       if (flag_objc_abi >= 2)
        {
          flags = 16;
-         output_section_asm_op
-           (darwin_sections[objc2_image_info_section]->unnamed.data);
+          switch_to_section (darwin_sections[objc2_image_info_section]);
        }
       else
-       output_section_asm_op
-         (darwin_sections[objc_image_info_section]->unnamed.data);
+       switch_to_section (darwin_sections[objc_image_info_section]);
 
       ASM_OUTPUT_ALIGN (asm_out_file, 2);
       fputs ("L_OBJC_ImageInfo:\n", asm_out_file);