aboutsummaryrefslogtreecommitdiff
path: root/binutils/objcopy.c
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2001-07-06 08:01:17 +0000
committerNick Clifton <nickc@redhat.com>2001-07-06 08:01:17 +0000
commitec5d57d5e84e23cd738bd45f393b66d61a46f6ae (patch)
tree6a2fdeb1ba58751534977bd7f4aafd13a1591a7e /binutils/objcopy.c
parent557debbaef77b05e3206d7bc6ae679e297182573 (diff)
downloadgdb-ec5d57d5e84e23cd738bd45f393b66d61a46f6ae.zip
gdb-ec5d57d5e84e23cd738bd45f393b66d61a46f6ae.tar.gz
gdb-ec5d57d5e84e23cd738bd45f393b66d61a46f6ae.tar.bz2
Remove patch accidentally checked in with readelf.c patch
Diffstat (limited to 'binutils/objcopy.c')
-rw-r--r--binutils/objcopy.c20
1 files changed, 6 insertions, 14 deletions
diff --git a/binutils/objcopy.c b/binutils/objcopy.c
index f412d38..b38d1e5 100644
--- a/binutils/objcopy.c
+++ b/binutils/objcopy.c
@@ -1777,22 +1777,14 @@ mark_symbols_used_in_relocations (ibfd, isection, symbolsarg)
if (relcount < 0)
bfd_fatal (bfd_get_filename (ibfd));
- /* Examine each symbol used in a relocation. */
+ /* Examine each symbol used in a relocation. If it's not one of the
+ special bfd section symbols, then mark it with BSF_KEEP. */
for (i = 0; i < relcount; i++)
{
- asymbol * sym = * relpp[i]->sym_ptr_ptr;
-
- /* If the symbol's output section does not exist (because it
- has been removed with -R) then do not keep the symbol. */
- if (bfd_get_output_section (sym) == NULL)
- continue;
-
- /* If the symbols is not one of the special bfd
- section symbols, then mark it with BSF_KEEP. */
- if (sym != bfd_com_section_ptr->symbol
- && sym != bfd_abs_section_ptr->symbol
- && sym != bfd_und_section_ptr->symbol)
- sym->flags |= BSF_KEEP;
+ if (*relpp[i]->sym_ptr_ptr != bfd_com_section_ptr->symbol
+ && *relpp[i]->sym_ptr_ptr != bfd_abs_section_ptr->symbol
+ && *relpp[i]->sym_ptr_ptr != bfd_und_section_ptr->symbol)
+ (*relpp[i]->sym_ptr_ptr)->flags |= BSF_KEEP;
}
if (relpp != NULL)