/* tc-score.c -- Assembler for Score
- Copyright (C) 2006-2019 Free Software Foundation, Inc.
+ Copyright (C) 2006-2020 Free Software Foundation, Inc.
Contributed by:
Brain.lin (brain.lin@sunplusct.com)
Mei Ligang (ligang@sunnorth.com.cn)
if (s3_append_insn (append_str, TRUE) == (int) s3_FAIL)
goto out;
if ((inst_main.instruction & 0x3e00007e) == 0x0000004c)
- sprintf (append_str, "beq %s", keep_data);
+ memcpy (append_str, "beq ", 4);
else
- sprintf (append_str, "bne %s", keep_data);
+ memcpy (append_str, "bne ", 4);
+ memmove (append_str + 4, keep_data, strlen (keep_data) + 1);
if (s3_append_insn (append_str, TRUE) == (int) s3_FAIL)
goto out;
}
memcpy (&inst_expand[0], &s3_inst, sizeof (struct s3_score_it));
if ((inst_main.instruction & 0x3e00007e) == 0x0000004c)
- sprintf (append_str, "beq %s", keep_data);
+ memcpy (append_str, "beq ", 4);
else
- sprintf (append_str, "bne %s", keep_data);
+ memcpy (append_str, "bne ", 4);
+ memmove (append_str + 4, keep_data, strlen (keep_data) + 1);
if (s3_append_insn (append_str, FALSE) == (int) s3_FAIL)
goto out;
memcpy (&inst_expand[1], &s3_inst, sizeof (struct s3_score_it));
if (s3_append_insn (append_str, TRUE) == (int) s3_FAIL)
goto out;
if ((inst_main.instruction & 0x3e00007e) == 0x0000004c)
- sprintf (append_str, "beq %s", keep_data);
+ memcpy (append_str, "beq ", 4);
else
- sprintf (append_str, "bne %s", keep_data);
+ memcpy (append_str, "bne ", 4);
+ memmove (append_str + 4, keep_data, strlen (keep_data) + 1);
if (s3_append_insn (append_str, TRUE) == (int) s3_FAIL)
goto out;
}
goto out;
memcpy (&inst_expand[0], &s3_inst, sizeof (struct s3_score_it));
if ((inst_main.instruction & 0x3e00007e) == 0x0000004c)
- sprintf (append_str, "beq %s", keep_data);
+ memcpy (append_str, "beq ", 4);
else
- sprintf (append_str, "bne %s", keep_data);
+ memcpy (append_str, "bne ", 4);
+ memmove (append_str + 4, keep_data, strlen (keep_data) + 1);
if (s3_append_insn (append_str, FALSE) == (int) s3_FAIL)
goto out;
memcpy (&inst_expand[1], &s3_inst, sizeof (struct s3_score_it));
{
case 'r':
seg = subseg_new (s3_RDATA_SECTION_NAME, (subsegT) get_absolute_expression ());
- bfd_set_section_flags (seg, (SEC_ALLOC | SEC_LOAD | SEC_READONLY | SEC_RELOC | SEC_DATA));
+ bfd_set_section_flags (seg, (SEC_ALLOC | SEC_LOAD | SEC_READONLY
+ | SEC_RELOC | SEC_DATA));
if (strcmp (TARGET_OS, "elf") != 0)
record_alignment (seg, 4);
demand_empty_rest_of_line ();
break;
case 's':
seg = subseg_new (".sdata", (subsegT) get_absolute_expression ());
- bfd_set_section_flags (seg, SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_DATA);
+ bfd_set_section_flags (seg, (SEC_ALLOC | SEC_LOAD | SEC_RELOC
+ | SEC_DATA | SEC_SMALL_DATA));
if (strcmp (TARGET_OS, "elf") != 0)
record_alignment (seg, 4);
demand_empty_rest_of_line ();
if (ISDIGIT (*input_line_pointer) || *input_line_pointer == '-')
s3_get_number ();
-#ifdef BFD_ASSEMBLER
if ((bfd_section_flags (now_seg) & SEC_CODE) != 0)
maybe_text = 1;
else
maybe_text = 0;
-#else
- if (now_seg != data_section && now_seg != bss_section)
- maybe_text = 1;
- else
- maybe_text = 0;
-#endif
if (!maybe_text)
as_warn (_(".ent or .aent not in text section."));
if (!aent && s3_cur_proc_ptr)
else
p = NULL;
-#ifdef BFD_ASSEMBLER
if ((bfd_section_flags (now_seg) & SEC_CODE) != 0)
maybe_text = 1;
else
maybe_text = 0;
-#else
- if (now_seg != data_section && now_seg != bss_section)
- maybe_text = 1;
- else
- maybe_text = 0;
-#endif
if (!maybe_text)
as_warn (_(".end not in text section"));
{
bss_seg = subseg_new (".sbss", 1);
seg_info (bss_seg)->bss = 1;
-#ifdef BFD_ASSEMBLER
- if (!bfd_set_section_flags (bss_seg, SEC_ALLOC))
+ if (!bfd_set_section_flags (bss_seg, SEC_ALLOC | SEC_SMALL_DATA))
as_warn (_("error setting flags for \".sbss\": %s"),
bfd_errmsg (bfd_get_error ()));
-#endif
}
}
#endif
if (
#if (defined (OBJ_AOUT) || defined (OBJ_MAYBE_AOUT))
-#ifdef BFD_ASSEMBLER
(OUTPUT_FLAVOR != bfd_target_aout_flavour
|| (S_GET_OTHER (symbolP) == 0 && S_GET_DESC (symbolP) == 0)) &&
-#else
- (S_GET_OTHER (symbolP) == 0 && S_GET_DESC (symbolP) == 0) &&
-#endif
#endif
(S_GET_SEGMENT (symbolP) == bss_seg || (!S_IS_DEFINED (symbolP) && S_GET_VALUE (symbolP) == 0)))
{