aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathan Sidwell <nathan@codesourcery.com>2004-03-05 11:42:01 +0000
committerNathan Sidwell <nathan@codesourcery.com>2004-03-05 11:42:01 +0000
commitb81f31611baef657c2143e271fd2b521acacf761 (patch)
tree16f22bfed1a9716726fb54187c3d1f2f4efefac5
parentf796a8e93e21ed242db123322e45517c262677d7 (diff)
downloadgdb-b81f31611baef657c2143e271fd2b521acacf761.zip
gdb-b81f31611baef657c2143e271fd2b521acacf761.tar.gz
gdb-b81f31611baef657c2143e271fd2b521acacf761.tar.bz2
* elf.c (map_sections_to_segments): Ignore .tbss sections for
layout purposes. * ldlang.c (lang_add_section): Don't force SEC_LOAD on SEC_THREAD_LOCAL. (IGNORE_SECTION): Ignore .tbss sections too. (lang_size_sections_1): .tbss sections do not advance dot. * ld-scripts/size.exp: New. * ld-scripts/size-[12].{d,s,t}: New.
-rw-r--r--bfd/ChangeLog5
-rw-r--r--bfd/elf.c4
-rw-r--r--ld/ChangeLog7
-rw-r--r--ld/ldlang.c23
-rw-r--r--ld/testsuite/ChangeLog5
5 files changed, 32 insertions, 12 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 753a0f7..e23c52d 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,8 @@
+2004-03-05 Nathan Sidwell <nathan@codesourcery.com>
+
+ * elf.c (map_sections_to_segments): Ignore .tbss sections for
+ layout purposes.
+
2004-02-17 Daniel Jacobowitz <drow@mvista.com>
Richard Sandiford <rsandifo@redhat.com>
diff --git a/bfd/elf.c b/bfd/elf.c
index 5e31f89..33b58f5 100644
--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -3360,7 +3360,9 @@ map_sections_to_segments (bfd *abfd)
{
if ((hdr->flags & SEC_READONLY) == 0)
writable = TRUE;
- last_hdr = hdr;
+ /* Ignore .tbss section for segment layout purposes. */
+ if ((hdr->flags & (SEC_THREAD_LOCAL | SEC_LOAD)) != SEC_THREAD_LOCAL)
+ last_hdr = hdr;
continue;
}
diff --git a/ld/ChangeLog b/ld/ChangeLog
index 391292e..52f91f7 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,3 +1,10 @@
+2004-03-05 Nathan Sidwell <nathan@codesourcery.com>
+
+ * ldlang.c (lang_add_section): Don't force SEC_LOAD on
+ SEC_THREAD_LOCAL.
+ (IGNORE_SECTION): Ignore .tbss sections too.
+ (lang_size_sections_1): .tbss sections do not advance dot.
+
2004-02-23 Nathan Sidwell <nathan@codesourcery.com>
* ldlang.h (struct lang_output_section_state): Change processed
diff --git a/ld/ldlang.c b/ld/ldlang.c
index 0f5c630..9a6feb2 100644
--- a/ld/ldlang.c
+++ b/ld/ldlang.c
@@ -1101,10 +1101,6 @@ lang_add_section (lang_statement_list_type *ptr,
flags &= ~ (SEC_MERGE | SEC_STRINGS);
}
- /* For now make .tbss normal section. */
- if ((flags & SEC_THREAD_LOCAL) && ! link_info.relocatable)
- flags |= SEC_LOAD;
-
section->output_section->flags |= flags;
if (flags & SEC_MERGE)
@@ -2770,8 +2766,11 @@ size_input_section (lang_statement_union_type **this_ptr,
}
#define IGNORE_SECTION(bfd, s) \
- (((bfd_get_section_flags (bfd, s) & (SEC_ALLOC | SEC_NEVER_LOAD)) \
- != SEC_ALLOC) \
+ (((bfd_get_section_flags (bfd, s) & SEC_THREAD_LOCAL) \
+ ? ((bfd_get_section_flags (bfd, s) & (SEC_LOAD | SEC_NEVER_LOAD)) \
+ != SEC_LOAD) \
+ : ((bfd_get_section_flags (bfd, s) & (SEC_ALLOC | SEC_NEVER_LOAD)) \
+ != SEC_ALLOC)) \
|| bfd_section_size (bfd, s) == 0)
/* Check to see if any allocated sections overlap with other allocated
@@ -3021,15 +3020,17 @@ lang_size_sections_1
if (bfd_is_abs_section (os->bfd_section))
ASSERT (after == os->bfd_section->vma);
- else if ((os->bfd_section->flags & SEC_HAS_CONTENTS) == 0
- && (os->bfd_section->flags & SEC_THREAD_LOCAL)
- && ! link_info.relocatable)
- os->bfd_section->_raw_size = 0;
else
os->bfd_section->_raw_size
= TO_SIZE (after - os->bfd_section->vma);
- dot = os->bfd_section->vma + TO_ADDR (os->bfd_section->_raw_size);
+ dot = os->bfd_section->vma;
+ /* .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);
+
os->processed = 1;
if (os->update_dot_tree != 0)
diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog
index 7d6344c..5358d33 100644
--- a/ld/testsuite/ChangeLog
+++ b/ld/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2004-03-05 Nathan Sidwell <nathan@codesourcery.com>
+
+ * ld-scripts/size.exp: New.
+ * ld-scripts/size-[12].{d,s,t}: New.
+
2004-02-23 Nathan Sidwell <nathan@codesourcery.com>
* ld-scripts/provide.exp: New.