From 5b69e3572d1ee8e8e6e1991fd07f87a96c48746d Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Mon, 13 Oct 2014 15:18:21 +1030 Subject: Run eh_frame optimisation for relocatable link The idea here is to drop .eh_frame FDEs corresponding to dropped comdat group sections or linkonce sections, but not perform changes in encoding. bfd/ PR 17467 * elf-eh-frame.c (ENSURE_NO_RELOCS): Don't stop at first NONE reloc. (_bfd_elf_parse_eh_frame): When relocatable output, don't set flags enabling conversion of CIEs and FDEs to use relative encoding. (find_merged_cie): Similarly. (_bfd_elf_write_section_eh_frame): Don't edit FDEs when relocatable, except for CIE pointer. * elflink.c (bfd_elf_reloc_symbol_deleted_p): Return true for relocs against symbols in dropped comdat group sections. (bfd_elf_discard_info): Do some eh_frame optimisation when relocatable. ld/ * ldlang.c (lang_add_section): Set up map_head.s and map_tail.s when relocatable. --- ld/ChangeLog | 5 +++++ ld/ldlang.c | 3 +-- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'ld') diff --git a/ld/ChangeLog b/ld/ChangeLog index ca27cc2..effacb0 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,8 @@ +2014-10-13 Alan Modra + + * ldlang.c (lang_add_section): Set up map_head.s and map_tail.s when + relocatable. + 2014-09-16 Kuan-Lin Chen * emultempl/nds32elf.em (nds32_elf_after_open): Do not keep diff --git a/ld/ldlang.c b/ld/ldlang.c index 899f710..5960e5c 100644 --- a/ld/ldlang.c +++ b/ld/ldlang.c @@ -2411,8 +2411,7 @@ lang_add_section (lang_statement_list_type *ptr, section->output_section = output->bfd_section; - if (!link_info.relocatable - && !map_head_is_link_order) + if (!map_head_is_link_order) { asection *s = output->bfd_section->map_tail.s; output->bfd_section->map_tail.s = section; -- cgit v1.1