diff options
| author | Andriy Gapon <avg@FreeBSD.org> | 2010-07-19 18:20:44 +0000 |
|---|---|---|
| committer | Andriy Gapon <avg@FreeBSD.org> | 2010-07-19 18:20:44 +0000 |
| commit | 517d9fc6536ef8bd5149ab72f52627f53dcea056 (patch) | |
| tree | b58a6cdee053dbcf76d5e75e8dc7e07ebfb27e05 /contrib/binutils/ld | |
| parent | 6c9a12e7b02de9d0c5020ad69eb640cf61b29852 (diff) | |
Notes
Diffstat (limited to 'contrib/binutils/ld')
| -rw-r--r-- | contrib/binutils/ld/emultempl/elf32.em | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/contrib/binutils/ld/emultempl/elf32.em b/contrib/binutils/ld/emultempl/elf32.em index 4a31b48f65986..b970e5679e0a0 100644 --- a/contrib/binutils/ld/emultempl/elf32.em +++ b/contrib/binutils/ld/emultempl/elf32.em @@ -1314,26 +1314,6 @@ gld${EMULATION_NAME}_place_orphan (lang_input_statement_type *file, asection *s) lang_list_init (stat_ptr); } - if (config.build_constructors) - { - /* If the name of the section is representable in C, then create - symbols to mark the start and the end of the section. */ - for (ps = secname; *ps != '\0'; ps++) - if (! ISALNUM (*ps) && *ps != '_') - break; - if (*ps == '\0') - { - char *symname; - etree_type *e_align; - - symname = (char *) xmalloc (ps - secname + sizeof "__start_"); - sprintf (symname, "__start_%s", secname); - e_align = exp_unop (ALIGN_K, - exp_intop ((bfd_vma) 1 << s->alignment_power)); - lang_add_assignment (exp_assop ('=', symname, e_align)); - } - } - address = NULL; if (link_info.relocatable || (s->flags & (SEC_LOAD | SEC_ALLOC)) == 0) address = exp_intop ((bfd_vma) 0); @@ -1354,6 +1334,26 @@ gld${EMULATION_NAME}_place_orphan (lang_input_statement_type *file, asection *s) (etree_type *) NULL, load_base); + if (config.build_constructors) + { + /* If the name of the section is representable in C, then create + symbols to mark the start and the end of the section. */ + for (ps = secname; *ps != '\0'; ps++) + if (! ISALNUM (*ps) && *ps != '_') + break; + if (*ps == '\0') + { + char *symname; + etree_type *e_align; + + symname = (char *) xmalloc (ps - secname + sizeof "__start_"); + sprintf (symname, "__start_%s", secname); + lang_add_assignment (exp_assop ('=', symname, + exp_unop (ABSOLUTE, + exp_nameop (NAME, ".")))); + } + } + lang_add_section (&os->children, s, os, file); lang_leave_output_section_statement |
