make --mac-strip-macsbug (mostly) work again, see #32

This commit is contained in:
Wolfgang Thaller 2018-05-01 19:31:43 +02:00
parent 2283f16fa1
commit bb894a87c5
3 changed files with 9 additions and 7 deletions

View File

@ -101,4 +101,4 @@ extern rtx m68k_legitimize_call_address (rtx);
extern rtx m68k_legitimize_sibcall_address (rtx);
extern int m68k_hard_regno_rename_ok(unsigned int, unsigned int);
extern void m68k_write_macsbug_name(FILE *, const char *);
extern void m68k_write_macsbug_name(FILE *, const char *, tree decl);

View File

@ -6770,13 +6770,15 @@ m68k_excess_precision (enum excess_precision_type type)
extern int retro68_hack_asm_rts_counter;
void
m68k_write_macsbug_name(FILE *file, const char *name)
m68k_write_macsbug_name(FILE *file, const char *name, tree decl)
{
int len = strlen(name);
if(len > 255)
len = 255;
//if(flag_function_sections)
// fprintf(file, "\t.section .text.%s.macsbug,\"ax\",@progbits\n",name);
const char *section_name = DECL_SECTION_NAME (decl);
if(flag_function_sections)
fprintf(file, "\t.section %s.macsbug,\"ax\",@progbits\n", section_name);
fprintf(file, "# macsbug symbol\n");
if(!retro68_hack_asm_rts_counter)
fprintf(file, "\trts\n");
@ -6787,8 +6789,8 @@ m68k_write_macsbug_name(FILE *file, const char *name)
ASM_OUTPUT_ASCII(file, name, len);
fprintf(file, "\t.align 2,0\n\t.short 0\n");
//if(flag_function_sections)
// fprintf(file, "\t.section .text.%s,\"ax\",@progbits\n",name);
if(flag_function_sections && section_name)
fprintf(file, "\t.section %s,\"ax\",@progbits\n", section_name);
}
static tree

View File

@ -995,7 +995,7 @@ extern int m68k_sched_indexed_address_bypass_p (rtx_insn *, rtx_insn *);
{ \
if (!flag_inhibit_size_directive) \
ASM_OUTPUT_MEASURED_SIZE (FILE, FNAME); \
m68k_write_macsbug_name(FILE, FNAME); \
m68k_write_macsbug_name(FILE, FNAME, DECL); \
} \
while (0)