X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=gas%2Fconfig%2Ftc-score7.c;h=c3b6e97d34ea8b79a1a95e086b3837c2ee558aff;hb=de54374205650be71237ce51ef7981d30ddd78dc;hp=367d09c0387340a68ba3f6c38f7c28bf537e50dd;hpb=8d1015a887c18c363d9bd707b13348daf4e5f556;p=deliverable%2Fbinutils-gdb.git diff --git a/gas/config/tc-score7.c b/gas/config/tc-score7.c index 367d09c038..c3b6e97d34 100644 --- a/gas/config/tc-score7.c +++ b/gas/config/tc-score7.c @@ -1,5 +1,5 @@ /* tc-score7.c -- Assembler for Score7 - Copyright (C) 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2009-2020 Free Software Foundation, Inc. Contributed by: Brain.lin (brain.lin@sunplusct.com) Mei Ligang (ligang@sunnorth.com.cn) @@ -142,7 +142,6 @@ static void s7_do_lw_pic (char *); #define s7_GET_INSN_SIZE(type) ((s7_GET_INSN_CLASS (type) == INSN_CLASS_16) \ ? s7_INSN16_SIZE : s7_INSN_SIZE) -#define s7_MAX_LITTLENUMS 6 #define s7_INSN_NAME_LEN 16 /* Relax will need some padding for alignment. */ @@ -5189,7 +5188,7 @@ s7_pic_need_relax (symbolS *sym, asection *segtype) linkonce = FALSE; if (symsec != segtype && ! S_IS_LOCAL (sym)) { - if ((bfd_get_section_flags (stdoutput, symsec) & SEC_LINK_ONCE) != 0) + if ((bfd_section_flags (symsec) & SEC_LINK_ONCE) != 0) linkonce = TRUE; /* The GNU toolchain uses an extension for ELF: a section @@ -5400,7 +5399,7 @@ static void s7_s_section (int ignore) { obj_elf_section (ignore); - if ((bfd_get_section_flags (stdoutput, now_seg) & SEC_CODE) != 0) + if ((bfd_section_flags (now_seg) & SEC_CODE) != 0) record_alignment (now_seg, 2); } @@ -5423,14 +5422,16 @@ s7_s_change_sec (int sec) { case 'r': seg = subseg_new (s7_RDATA_SECTION_NAME, (subsegT) get_absolute_expression ()); - bfd_set_section_flags (stdoutput, 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 (stdoutput, 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 (); @@ -5540,17 +5541,10 @@ s7_s_score_ent (int aent) if (ISDIGIT (*input_line_pointer) || *input_line_pointer == '-') s7_get_number (); -#ifdef BFD_ASSEMBLER - if ((bfd_get_section_flags (stdoutput, now_seg) & SEC_CODE) != 0) + 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 && s7_cur_proc_ptr) @@ -5650,17 +5644,10 @@ s7_s_score_end (int x ATTRIBUTE_UNUSED) else p = NULL; -#ifdef BFD_ASSEMBLER - if ((bfd_get_section_flags (stdoutput, now_seg) & SEC_CODE) != 0) - maybe_text = 1; - else - maybe_text = 0; -#else - if (now_seg != data_section && now_seg != bss_section) + if ((bfd_section_flags (now_seg) & SEC_CODE) != 0) maybe_text = 1; else maybe_text = 0; -#endif if (!maybe_text) as_warn (_(".end not in text section")); @@ -5990,14 +5977,13 @@ s7_s_score_lcomm (int bytes_p) { /* For Score and Alpha ECOFF or ELF, small objects are put in .sbss. */ if ((unsigned) temp <= bfd_get_gp_size (stdoutput)) - { - bss_seg = subseg_new (".sbss", 1); - seg_info (bss_seg)->bss = 1; -#ifdef BFD_ASSEMBLER - if (!bfd_set_section_flags (stdoutput, bss_seg, SEC_ALLOC)) - as_warn (_("error setting flags for \".sbss\": %s"), bfd_errmsg (bfd_get_error ())); -#endif - } + { + bss_seg = subseg_new (".sbss", 1); + seg_info (bss_seg)->bss = 1; + 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 @@ -6075,12 +6061,8 @@ s7_s_score_lcomm (int bytes_p) 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))) { @@ -6153,8 +6135,8 @@ s7_begin (void) seg = now_seg; subseg = now_subseg; s7_pdr_seg = subseg_new (".pdr", (subsegT) 0); - (void) bfd_set_section_flags (stdoutput, s7_pdr_seg, SEC_READONLY | SEC_RELOC | SEC_DEBUGGING); - (void) bfd_set_section_alignment (stdoutput, s7_pdr_seg, 2); + bfd_set_section_flags (s7_pdr_seg, SEC_READONLY | SEC_RELOC | SEC_DEBUGGING); + bfd_set_section_alignment (s7_pdr_seg, 2); subseg_set (seg, subseg); if (s7_USE_GLOBAL_POINTER_OPT) @@ -6209,7 +6191,7 @@ static const char * s7_atof (int type, char *litP, int *sizeP) { int prec; - LITTLENUM_TYPE words[s7_MAX_LITTLENUMS]; + LITTLENUM_TYPE words[MAX_LITTLENUMS]; char *t; int i; @@ -6562,8 +6544,8 @@ s7_convert_frag (bfd * abfd ATTRIBUTE_UNUSED, segT sec ATTRIBUTE_UNUSED, fragS * fragp) { - int r_old; - int r_new; + unsigned int r_old; + unsigned int r_new; char backup[20]; fixS *fixp; @@ -6629,7 +6611,7 @@ s7_pcrel_from (fixS * fixP) static valueT s7_section_align (segT segment, valueT size) { - int align = bfd_get_section_alignment (stdoutput, segment); + int align = bfd_section_alignment (segment); return ((size + (1 << align) - 1) & -(1 << align)); }