diff options
author | Alan Modra <amodra@gmail.com> | 2009-05-14 02:21:45 +0000 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2009-05-14 02:21:45 +0000 |
commit | 011aa75f625b8ef2fe1a8adb9498680410174d3c (patch) | |
tree | bd66045c39a7626699642bdb2f3f6e8b5d13e3b2 /ld/ldlang.c | |
parent | a8310e20c5a873ff257b07e4dc97acb935e869b4 (diff) | |
download | gdb-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.c | 23 |
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; |