X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=gas%2Fsubsegs.c;h=cb598e84bef8ac4e0d3aad8951cd0c160e3a5812;hb=025f768ffc3aeb5561bb60a9c8f3841faa53bd6f;hp=e07cef0595bdd9231766fda4ddccacabd6ae5b04;hpb=e01e1cee39777b6278ff01502742347247e8dfd7;p=binutils-gdb.git diff --git a/gas/subsegs.c b/gas/subsegs.c index e07cef0595b..cb598e84bef 100644 --- a/gas/subsegs.c +++ b/gas/subsegs.c @@ -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);