aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@suse.com>2022-05-19 12:44:08 +0200
committerJan Beulich <jbeulich@suse.com>2022-05-19 12:44:08 +0200
commitce462d043509df3f3384decdf2019a1c85051640 (patch)
treeb325d5a8616756b448877a1910ac2cb3f14f3aef /bfd
parentbc5baa9f13ffb3fd4c39f1a779062bfb3a980cea (diff)
downloadgdb-ce462d043509df3f3384decdf2019a1c85051640.zip
gdb-ce462d043509df3f3384decdf2019a1c85051640.tar.gz
gdb-ce462d043509df3f3384decdf2019a1c85051640.tar.bz2
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.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/coffcode.h10
1 files changed, 4 insertions, 6 deletions
diff --git a/bfd/coffcode.h b/bfd/coffcode.h
index 0a66051..1ffb603 100644
--- a/bfd/coffcode.h
+++ b/bfd/coffcode.h
@@ -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;