aboutsummaryrefslogtreecommitdiff
path: root/ld/ldlang.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2009-05-14 02:21:45 +0000
committerAlan Modra <amodra@gmail.com>2009-05-14 02:21:45 +0000
commit011aa75f625b8ef2fe1a8adb9498680410174d3c (patch)
treebd66045c39a7626699642bdb2f3f6e8b5d13e3b2 /ld/ldlang.c
parenta8310e20c5a873ff257b07e4dc97acb935e869b4 (diff)
downloadgdb-011aa75f625b8ef2fe1a8adb9498680410174d3c.zip
gdb-011aa75f625b8ef2fe1a8adb9498680410174d3c.tar.gz
gdb-011aa75f625b8ef2fe1a8adb9498680410174d3c.tar.bz2
* ldlang.c (lang_insert_orphan): Add __start_<section> symbol
assignment inside output section statement. Ensure only one set of symbols per output section. * emultempl/pe.em (gld_${EMULATION_NAME}_place_orphan): Add non- dollar sections before dollar sections. Correct add_child list insertion. * emultempl/pep.em (gld_${EMULATION_NAME}_place_orphan): Likewise.
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 230994a..65e092b 100644
--- a/ld/ldlang.c
+++ b/ld/ldlang.c
@@ -1668,8 +1668,16 @@ lang_insert_orphan (asection *s,
push_stat_ptr (&add);
}
+ if (link_info.relocatable || (s->flags & (SEC_LOAD | SEC_ALLOC)) == 0)
+ address = exp_intop (0);
+
+ os_tail = ((lang_output_section_statement_type **)
+ lang_output_section_statement.tail);
+ os = lang_enter_output_section_statement (secname, address, 0, NULL, NULL,
+ NULL, constraint);
+
ps = NULL;
- if (config.build_constructors)
+ if (config.build_constructors && *os_tail == os)
{
/* If the name of the section is representable in C, then create
symbols to mark the start and the end of the section. */
@@ -1688,26 +1696,19 @@ lang_insert_orphan (asection *s,
exp_intop ((bfd_vma) 1 << s->alignment_power));
lang_add_assignment (exp_assop ('=', ".", e_align));
lang_add_assignment (exp_provide (symname,
- exp_nameop (NAME, "."),
+ exp_unop (ABSOLUTE,
+ exp_nameop (NAME, ".")),
FALSE));
}
}
- if (link_info.relocatable || (s->flags & (SEC_LOAD | SEC_ALLOC)) == 0)
- address = exp_intop (0);
-
- os_tail = ((lang_output_section_statement_type **)
- lang_output_section_statement.tail);
- os = lang_enter_output_section_statement (secname, address, 0, NULL, NULL,
- NULL, constraint);
-
if (add_child == NULL)
add_child = &os->children;
lang_add_section (add_child, s, os);
lang_leave_output_section_statement (0, "*default*", NULL, NULL);
- if (config.build_constructors && *ps == '\0')
+ if (ps != NULL && *ps == '\0')
{
char *symname;