binutils221: Fix missing section start/end label generation
authorMatthew Dillon <dillon@apollo.backplane.com>
Sun, 3 Apr 2011 07:23:42 +0000 (00:23 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Sun, 3 Apr 2011 07:23:42 +0000 (00:23 -0700)
* The code to generate section __start_set and __end_set symbols
  was using exp_provide() instead of exp_assign(), and exp_provide()
  appears to silently discard the symbol due to being assigned to '.'
  (the origin).

  This resulted in the symbols not being generated in the output file.

* Change to using exp_assign() and pray.

contrib/binutils-2.21/ld/ldlang.c

index 7256495..4d5d199 100644 (file)
@@ -1757,10 +1757,9 @@ lang_insert_orphan (asection *s,
          e_align = exp_unop (ALIGN_K,
                              exp_intop ((bfd_vma) 1 << s->alignment_power));
          lang_add_assignment (exp_assign (".", e_align));
-         lang_add_assignment (exp_provide (symname,
+         lang_add_assignment (exp_assign (symname,
                                            exp_unop (ABSOLUTE,
-                                                     exp_nameop (NAME, ".")),
-                                           FALSE));
+                                                 exp_nameop (NAME, "."))));
        }
     }
 
@@ -1790,9 +1789,8 @@ lang_insert_orphan (asection *s,
       symname = (char *) xmalloc (ps - secname + sizeof "__stop_" + 1);
       symname[0] = bfd_get_symbol_leading_char (link_info.output_bfd);
       sprintf (symname + (symname[0] != 0), "__stop_%s", secname);
-      lang_add_assignment (exp_provide (symname,
-                                       exp_nameop (NAME, "."),
-                                       FALSE));
+      lang_add_assignment (exp_assign (symname,
+                                       exp_nameop (NAME, ".")));
     }
 
   /* Restore the global list pointer.  */