aboutsummaryrefslogtreecommitdiff
path: root/gas/config/tc-score7.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2020-03-02 10:17:18 +1030
committerAlan Modra <amodra@gmail.com>2020-03-02 11:36:19 +1030
commita4dd6c97bd5c7e2cc58f4d2a0b83145646f67cc7 (patch)
treeb314e12987da768cf9289d0cf9272521cc8536d6 /gas/config/tc-score7.c
parentbf57746745ac0c0d2922de5af5f0d8527d7a585a (diff)
downloadfsf-binutils-gdb-a4dd6c97bd5c7e2cc58f4d2a0b83145646f67cc7.zip
fsf-binutils-gdb-a4dd6c97bd5c7e2cc58f4d2a0b83145646f67cc7.tar.gz
fsf-binutils-gdb-a4dd6c97bd5c7e2cc58f4d2a0b83145646f67cc7.tar.bz2
miscellaneous SEC_SMALL_DATA
This patch arranges for symbols defined in .sdata and .sbss to be reported by nm with 'g' and 's' flags, for coff targets that support .sdata and .sbss. The assembler changes regarding SEC_SMALL_DATA are really just documentation. As far as I'm aware, this won't change any assembler output. bfd/ * coff-alpha.c (alpha_ecoff_le_vec): Add SEC_SMALL_DATA to applicable section flags. * coff-mips.c (mips_ecoff_le_vec, mips_ecoff_be_vec): Likewise. (mips_ecoff_bele_vec): Likewise. * coffcode.h (sec_to_styp_flags): Set SEC_SMALL_DATA for .sdata and .sbss sections. * ecoff.c (_bfd_ecoff_new_section_hook): Likewise. (_bfd_ecoff_styp_to_sec_flags): Likewise. gas/ * config/tc-m32r.c (md_begin): Set SEC_SMALL_DATA on .scommon section. * config/tc-mips.c (s_change_sec): Set SEC_SMALL_DATA for .sdata and .sbss sections. * config/tc-score.c: Delete !BFD_ASSEMBLER code throughout. (s3_s_change_sec): Set SEC_SMALL_DATA for .sbss section. (s3_s_score_lcomm): Likewise. * config/tc-score7.c: Similarly. * read.c (bss_alloc): Set SEC_SMALL_DATA for .sbss section.
Diffstat (limited to 'gas/config/tc-score7.c')
-rw-r--r--gas/config/tc-score7.c39
1 files changed, 11 insertions, 28 deletions
diff --git a/gas/config/tc-score7.c b/gas/config/tc-score7.c
index 3b49f87..c3b6e97 100644
--- a/gas/config/tc-score7.c
+++ b/gas/config/tc-score7.c
@@ -5422,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 (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 ();
@@ -5539,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_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)
@@ -5649,17 +5644,10 @@ s7_s_score_end (int x ATTRIBUTE_UNUSED)
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"));
@@ -5989,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 (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
@@ -6074,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)))
{