From: Iain Sandoe Date: Tue, 3 Sep 2019 19:13:23 +0000 (+0000) Subject: [Darwin, Objective-C] Switch Objective-C meta-data sections properly. X-Git-Tag: releases/gcc-7.5.0~178 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=825c1d10fa2314bc86a0ce01b0b1ad587ef451c2;p=thirdparty%2Fgcc.git [Darwin, Objective-C] Switch Objective-C meta-data sections properly. We were emitting the directives to switch, but not recording the change in varasm. This means that subsequent switches might be omitted (since varasm incorrectly concludes that the wrong section is current). 2019-09-03 Iain Sandoe Backport from mainline 2019-05-18 Iain Sandoe * config/darwin.c (darwin_file_end): Use switch_to_section () instead of direct output of the asm. From-SVN: r275349 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 0b1ff3181ac3..1057a3b29812 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2019-09-03 Iain Sandoe + + Backport from mainline + 2019-05-18 Iain Sandoe + + * config/darwin.c (darwin_file_end): Use switch_to_section () + instead of direct output of the asm. + 2019-09-03 Iain Sandoe Backport from mainline diff --git a/gcc/config/darwin.c b/gcc/config/darwin.c index bafb1c541cdf..7e413104f28b 100644 --- a/gcc/config/darwin.c +++ b/gcc/config/darwin.c @@ -2908,12 +2908,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);