aboutsummaryrefslogtreecommitdiff
path: root/ld/ldlang.c
diff options
context:
space:
mode:
authorNathan Sidwell <nathan@codesourcery.com>2004-03-05 11:26:05 +0000
committerNathan Sidwell <nathan@codesourcery.com>2004-03-05 11:26:05 +0000
commite5caec89a06646ebc0324b1860fb3ff35c60f784 (patch)
tree570d52e83f0cc3deb8a7bc8f00e261adbf880b17 /ld/ldlang.c
parent52b5e991eec325c9ecea3229d584636b78b4a633 (diff)
downloadgdb-e5caec89a06646ebc0324b1860fb3ff35c60f784.zip
gdb-e5caec89a06646ebc0324b1860fb3ff35c60f784.tar.gz
gdb-e5caec89a06646ebc0324b1860fb3ff35c60f784.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.
Diffstat (limited to 'ld/ldlang.c')
-rw-r--r--ld/ldlang.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/ld/ldlang.c b/ld/ldlang.c
index 4244c92..3855998 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)