* ldlang.c (lang_do_assignments_1): Handle .tbss output section
authorJakub Jelinek <jakub@redhat.com>
Mon, 19 Apr 2004 07:35:12 +0000 (07:35 +0000)
committerJakub Jelinek <jakub@redhat.com>
Mon, 19 Apr 2004 07:35:12 +0000 (07:35 +0000)
specially.

ld/ChangeLog
ld/ldlang.c

index aee579a0a97203274f79769cea2ae4bec69c3f7a..86f4b2b21a621c7ac9e1af95c65fb94ef2ed9072 100644 (file)
@@ -1,3 +1,8 @@
+2004-04-19  Jakub Jelinek  <jakub@redhat.com>
+
+       * ldlang.c (lang_do_assignments_1): Handle .tbss output section
+       specially.
+
 2004-04-18  Danny Smith  <dannysmith@users.sourceforge.net>
 
        * scriptempl/pe.sc:  Put numbered .ctors.* after .ctors
index 0c086014e2a0ca0dfc354f532bddfcbe08e1be7f..6460c32ab6de24826358b29a92e28f50f7a90c7d 100644 (file)
@@ -3350,9 +3350,11 @@ lang_do_assignments_1
              {
                dot = os->bfd_section->vma;
                lang_do_assignments_1 (os->children.head, os, os->fill, dot);
-               dot = (os->bfd_section->vma
-                      + TO_ADDR (os->bfd_section->_raw_size));
-
+               /* .tbss sections effectively have zero size.  */
+               if ((os->bfd_section->flags & SEC_HAS_CONTENTS) != 0
+                   || (os->bfd_section->flags & SEC_THREAD_LOCAL) == 0
+                   || link_info.relocatable)
+                 dot += TO_ADDR (os->bfd_section->_raw_size);
              }
            if (os->load_base)
              {