diff options
author | midipix <writeonce@midipix.org> | 2019-02-03 15:28:14 -0500 |
---|---|---|
committer | midipix <writeonce@midipix.org> | 2019-02-03 17:39:07 -0500 |
commit | 4455e16773b86eebb2700b010d99df8250d9f787 (patch) | |
tree | da6248616e3484e9d3daeb1366bb213699220d21 /gcc | |
parent | d02d06a6da4f4ec4224f3cc1f1a85f294139d4c6 (diff) | |
download | cbb-gcc-4.6.4-4455e16773b86eebb2700b010d99df8250d9f787.tar.bz2 cbb-gcc-4.6.4-4455e16773b86eebb2700b010d99df8250d9f787.tar.xz |
midipix target internals: provide midipix_asm_reestablish_section().
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/config/i386/midipix.c | 48 |
1 files changed, 28 insertions, 20 deletions
diff --git a/gcc/config/i386/midipix.c b/gcc/config/i386/midipix.c index 6ba5ee8b9..10ccaed2a 100644 --- a/gcc/config/i386/midipix.c +++ b/gcc/config/i386/midipix.c @@ -181,6 +181,32 @@ static void midipix_pe_create_got_entry(FILE * stream, const char * name, tree d } +static void midipix_asm_reestablish_section(FILE * asmout, section * sect) +{ + flag_got_established_section = 1; + + /* already in section? */ + if (in_section) + switch_to_section(in_section); + + /* re-establish .bss section */ + else if (sect == bss_noswitch_section) + switch_to_section(bss_section); + + /* re-establish .data section */ + else if (sect == data_section) + switch_to_section(data_section); + + /* re-establish named section */ + else if (sect) + switch_to_section(sect); + + /* re-establish .text section (default) */ + else + fputs("\t.text\n",asmout); +} + + void midipix_asm_output_got_entry( FILE * asmout, const char * name, @@ -193,26 +219,8 @@ void midipix_asm_output_got_entry( /* .got entry */ midipix_pe_create_got_entry(asmout,name,decl); - /* re-establish generic named section */ - if (in_section && in_section->common.flags & (SECTION_STYLE_MASK == SECTION_NAMED)) - targetm.asm_out.named_section( - in_section->named.name, - in_section->named.common.flags, - in_section->named.decl); - - /* re-establish .bss section */ - else if ((sect == bss_noswitch_section) || (in_section == bss_noswitch_section)) - fputs("\t.bss\n",asmout); - - /* re-establish .data section */ - else if ((sect == data_section) || (sect == data_section)) - fputs("\t.data\n",asmout); - - /* re-establish .text section (default) */ - else - fputs("\t.text\n",asmout); - - flag_got_established_section = 1; + /* re-establish current section */ + midipix_asm_reestablish_section(asmout,sect); } |