COFF: make objcopy / strip honor --keep-file-symbols

So far this option had no effect when used together with e.g.
--strip-debug. Set BSF_FILE on these symbols to change that.

While altering this also join two adjacent blocks of case labeled
statements with identical code.
This commit is contained in:
Jan Beulich
2022-05-19 12:44:08 +02:00
parent bc5baa9f13
commit ce462d0435

View File

@@ -4755,6 +4755,9 @@ coff_slurp_symbol_table (bfd * abfd)
dst->symbol.value = src->u.syment.n_value;
break;
case C_FILE: /* File name. */
dst->symbol.flags = BSF_FILE;
/* Fall through. */
case C_MOS: /* Member of structure. */
case C_EOS: /* End of structure. */
case C_REGPARM: /* Register parameter. */
@@ -4768,11 +4771,6 @@ coff_slurp_symbol_table (bfd * abfd)
case C_MOE: /* Member of enumeration. */
case C_MOU: /* Member of union. */
case C_UNTAG: /* Union tag. */
dst->symbol.flags = BSF_DEBUGGING;
dst->symbol.value = (src->u.syment.n_value);
break;
case C_FILE: /* File name. */
case C_STRTAG: /* Structure tag. */
#ifdef RS6000COFF_C
case C_GSYM:
@@ -4790,7 +4788,7 @@ coff_slurp_symbol_table (bfd * abfd)
case C_FUN:
case C_ESTAT:
#endif
dst->symbol.flags = BSF_DEBUGGING;
dst->symbol.flags |= BSF_DEBUGGING;
dst->symbol.value = (src->u.syment.n_value);
break;