aarch64: Relax check for RNG system registers
[binutils-gdb.git] / gas / subsegs.c
index e07cef0595bdd9231766fda4ddccacabd6ae5b04..cb598e84bef8ac4e0d3aad8951cd0c160e3a5812 100644 (file)
@@ -1,5 +1,5 @@
 /* subsegs.c - subsegments -
-   Copyright (C) 1987-2020 Free Software Foundation, Inc.
+   Copyright (C) 1987-2022 Free Software Foundation, Inc.
 
    This file is part of GAS, the GNU Assembler.
 
@@ -89,6 +89,10 @@ subseg_set_rest (segT seg, subsegT subseg)
 
   seginfo = seg_info (seg);
 
+  /* Should the section symbol be kept?  */
+  if (bfd_keep_unused_section_symbols (stdoutput))
+    seg->symbol->flags |= BSF_SECTION_SYM_USED;
+
   /* Attempt to find or make a frchain for that subsection.
      We keep the list sorted by subsection number.  */
   for (frcP = *(lastPP = &seginfo->frchainP);