diff options
Diffstat (limited to 'bfd/linker.c')
-rw-r--r-- | bfd/linker.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/bfd/linker.c b/bfd/linker.c index 9e89c84..1b71fcf 100644 --- a/bfd/linker.c +++ b/bfd/linker.c @@ -2112,12 +2112,11 @@ _bfd_generic_link_output_symbols (bfd *output_bfd, } } - /* This switch is straight from the old code in - write_file_locals in ldsym.c. */ - if (info->strip == strip_all - || (info->strip == strip_some - && bfd_hash_lookup (info->keep_hash, bfd_asymbol_name (sym), - FALSE, FALSE) == NULL)) + if ((sym->flags & BSF_KEEP) == 0 + && (info->strip == strip_all + || (info->strip == strip_some + && bfd_hash_lookup (info->keep_hash, bfd_asymbol_name (sym), + FALSE, FALSE) == NULL))) output = FALSE; else if ((sym->flags & (BSF_GLOBAL | BSF_WEAK | BSF_GNU_UNIQUE)) != 0) { @@ -2131,6 +2130,8 @@ _bfd_generic_link_output_symbols (bfd *output_bfd, else output = FALSE; } + else if ((sym->flags & BSF_KEEP) != 0) + output = TRUE; else if (bfd_is_ind_section (sym->section)) output = FALSE; else if ((sym->flags & BSF_DEBUGGING) != 0) |