From: Jan Beulich <jbeulich@suse.com>
To: Binutils <binutils@sourceware.org>
Cc: Dave Korn <dave.korn.cygwin@gmail.com>
Subject: [PATCH 2/5] COFF: make objcopy / strip honor --keep-file-symbols
Date: Fri, 6 May 2022 08:54:28 +0200 [thread overview]
Message-ID: <6bd19d40-311e-723f-b299-46b75ae25989@suse.com> (raw)
In-Reply-To: <4242b48a-f2c3-4af2-db1e-35dbbbdc1b2e@suse.com>
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.
--- 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;
next prev parent reply other threads:[~2022-05-06 6:54 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-06 6:53 [PATCH 0/5] PE/COFF: assorted adjustments Jan Beulich
2022-05-06 6:54 ` [PATCH 1/5] don't over-align file positions of PE executable sections Jan Beulich
2022-05-06 6:54 ` Jan Beulich [this message]
2022-05-06 6:54 ` [PATCH 3/5] COFF/PE: don't leave zero timestamp after objcopy / strip Jan Beulich
2022-05-06 6:55 ` [PATCH 4/5] COFF/PE: keep linker version during " Jan Beulich
2022-05-06 6:55 ` [PATCH 5/5] COFF: use hash for string table also when copying / stripping Jan Beulich
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=6bd19d40-311e-723f-b299-46b75ae25989@suse.com \
--to=jbeulich@suse.com \
--cc=binutils@sourceware.org \
--cc=dave.korn.cygwin@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).