diff options
author | Alan Modra <amodra@gmail.com> | 2008-10-03 09:40:49 +0000 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2008-10-03 09:40:49 +0000 |
commit | bcacc0f587e22ba46333d9377e7e9e4576c90f74 (patch) | |
tree | 0035a6958c007460d3837b1e245b5f89edeb3661 /ld/ldlang.c | |
parent | 81ab4297b7f533d6750f073cad0fe6169f567e85 (diff) | |
download | gdb-bcacc0f587e22ba46333d9377e7e9e4576c90f74.zip gdb-bcacc0f587e22ba46333d9377e7e9e4576c90f74.tar.gz gdb-bcacc0f587e22ba46333d9377e7e9e4576c90f74.tar.bz2 |
bfd/
* elf.c (bfd_elf_set_group_contents): Assign sh_info for ld -r when
the signature symbol is global.
* elflink.c (elf_link_input_bfd): Ensure group signature symbol
is output when ld -r. Set group sh_info when local.
* linker.c (default_indirect_link_order): Handle group sections
specially.
ld/
* ldemul.c (ldemul_place_orphan): Add "name" param.
* ldemul.h (ldemul_place_orphan): Update prototype.
(struct ld_emulation_xfer_struct <place_orphan>): Likewise.
* ldlang.c (lang_place_orphans): Generate unique section names here..
* emultempl/elf32.em (place_orphan): ..rather than here. Don't
directly use an existing output section statement that has no
bfd section.
* emultempl/pe.em (place_orphan): Likewise.
* emultempl/pep.em (place_orphan): Likewise.
* emultempl/beos.em (place_orphan): Adjust.
* emultempl/spuelf.em (spu_place_special_section): Adjust
place_orphan call.
* emultempl/genelf.em (gld${EMULATION_NAME}_after_open): New function.
(LDEMUL_AFTER_OPEN): Define.
Diffstat (limited to 'ld/ldlang.c')
-rw-r--r-- | ld/ldlang.c | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/ld/ldlang.c b/ld/ldlang.c index b1b8806..44fb136 100644 --- a/ld/ldlang.c +++ b/ld/ldlang.c @@ -5652,14 +5652,29 @@ lang_place_orphans (void) default_common_section); } } - else if (ldemul_place_orphan (s)) - ; else { - lang_output_section_statement_type *os; + const char *name = s->name; - os = lang_output_section_statement_lookup (s->name, 0, TRUE); - lang_add_section (&os->children, s, os); + if ((config.unique_orphan_sections + || unique_section_p (s)) + && bfd_get_section_by_name (link_info.output_bfd, + name) != NULL) + { + static int count = 1; + name = bfd_get_unique_section_name (link_info.output_bfd, + name, &count); + if (name == NULL) + einfo ("%F%P: place_orphan failed: %E\n"); + } + + if (!ldemul_place_orphan (s, name)) + { + lang_output_section_statement_type *os; + os = lang_output_section_statement_lookup (name, 0, + TRUE); + lang_add_section (&os->children, s, os); + } } } } |