+2000-05-14 H.J. Lu (hjl@gnu.org)
+
+ * objcopy.c (filter_symbols): Don't strip global symbols in
+ relocatable object files.
+
2000-05-14 Alan Modra <alan@linuxcare.com.au>
* size.c (usage): Associate short options with corresponding long
{
register asymbol **from = isyms, **to = osyms;
long src_count = 0, dst_count = 0;
+ int relocatable = (abfd->flags & (HAS_RELOC | EXEC_P | DYNAMIC))
+ == HAS_RELOC;
for (; src_count < symcount; src_count++)
{
&& ((*bfd_get_section (sym)->symbol_ptr_ptr)->flags
& BSF_KEEP) != 0))
keep = 1;
+ else if (relocatable /* Relocatable file. */
+ && (flags & (BSF_GLOBAL | BSF_WEAK)) != 0)
+ keep = 1;
else if ((flags & BSF_GLOBAL) != 0 /* Global symbol. */
|| (flags & BSF_WEAK) != 0
|| bfd_is_und_section (bfd_get_section (sym))