* scripttempl/elfd30v.sc: Place .gcc_except_table.
[deliverable/binutils-gdb.git] / ld / ldctor.c
index ab810cd096d2affca2974b609c194a1373155b93..0a434b812e1bd55f999a512566d4ed3ba9cf0c2f 100644 (file)
@@ -165,7 +165,6 @@ ctor_cmp (p1, p2)
   const char *n2;
   int prio1;
   int prio2;
-  int ret;
 
   n1 = (*pe1)->name;
   if (n1 == NULL)
@@ -295,8 +294,9 @@ ldctor_build_sets ()
 
          /* If this is not a relocateable link, all we need is the
             size, which we can get from the input BFD.  */
-         howto = bfd_reloc_type_lookup (p->elements->section->owner,
-                                        p->reloc);
+         if (p->elements->section->owner != NULL)
+           howto = bfd_reloc_type_lookup (p->elements->section->owner,
+                                          p->reloc);
          if (howto == NULL)
            {
              einfo (_("%P%X: %s does not support reloc %s for set %s\n"),
@@ -365,6 +365,10 @@ ldctor_build_sets ()
                minfo ("%G\n", e->section->owner, e->section, e->value);
            }
 
+          /* Need SEC_KEEP for --gc-sections */
+         if (! bfd_is_abs_section (e->section))
+           e->section->flags |= SEC_KEEP;
+
          if (link_info.relocateable)
            lang_add_reloc (p->reloc, howto, e->section, e->name,
                            exp_intop (e->value));
This page took 0.04411 seconds and 4 git commands to generate.