[PATCH] More aggressive --gc-sections

Eric Botcazou ebotcazou@act-europe.fr
Thu Mar 18 23:42:00 GMT 2004


> Have you tested this when building shared libs?

Yes.  GtkAda for example.

> I suspect that elf_gc_mark_dynamic_ref_symbol won't do the right thing for
> shared libs, specifically, that ELF_LINK_HASH_REF_DYNAMIC won't always be
> set.  You will probably want to disable gc-sections for shared libs.

Is that not already the case?

  if (!get_elf_backend_data (abfd)->can_gc_sections
      || info->relocatable
      || info->emitrelocations
      || !is_elf_hash_table (info->hash))
    {
      (*_bfd_error_handler)(_("Warning: gc-sections option ignored"));
      return TRUE;
    }

-- 
Eric Botcazou



More information about the Binutils mailing list