From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22971 invoked by alias); 5 Aug 2011 19:34:04 -0000 Mailing-List: contact archer-commits-help@sourceware.org; run by ezmlm Sender: Precedence: bulk List-Post: List-Help: List-Subscribe: Received: (qmail 22521 invoked by uid 9674); 5 Aug 2011 19:34:04 -0000 Date: Fri, 05 Aug 2011 19:34:00 -0000 Message-ID: <20110805193404.22481.qmail@sourceware.org> From: jkratoch@sourceware.org To: archer-commits@sourceware.org Subject: [SCM] archer-jankratochvil-entryval: Merge branch 'commands-funcstuff-basic-tailread-tailframe-selftail-printarg-entrybt-lvalnull-dispref-entryexp-entrybtref' into commands-funcstuff-basic-tailread-tailframe-selftail-printarg-entrybt-lvalnull-dispref-entryexp-entrybtref-final X-Git-Refname: refs/heads/archer-jankratochvil-entryval X-Git-Reftype: branch X-Git-Oldrev: 924f4d13c1cb817aadc5472e4123ed4562664397 X-Git-Newrev: 354629c024cc23ca9efb9d6941a4196ac1c78606 X-SW-Source: 2011-q3/txt/msg00083.txt.bz2 List-Id: The branch, archer-jankratochvil-entryval has been updated via 354629c024cc23ca9efb9d6941a4196ac1c78606 (commit) via f53f69030a5748235d45dca1f88659e66c4350d8 (commit) via e691f511eb51e220a79afc72ee514a3697f555c9 (commit) via d9790ef444f59d34a72f56024ad38ca8bcbd71fe (commit) via fa49639ca539a93315e280faaaf045f8a456d703 (commit) via 61b6a2c7e365f070e15ab9ed5ecae21327daba0b (commit) via 20f03875a951f1f7d7be7d8559486674da7ff1e9 (commit) via 238b648c64628acc453f01e77b6994c33a771714 (commit) via 560c5bf676cd5aa079458d243aeb9b8f5188ff75 (commit) via be4d9189571cfd0064d61be9d52b03e6736539a6 (commit) via e755f18c455547dd07352d0391f8912b5617cfb7 (commit) via aeef8260ef92baed1903cdda9e5104f123ef6c3e (commit) via 550ae347746af5a2a3b2847ff6da3f331aef52cd (commit) via 66e2c5800431861dd71cb0ea8adf135d84a68b6e (commit) via c5fce18816c49d91c06c0bd9a4e5d6726af5c508 (commit) via 7c9202cb57f8395f8149ea27583145555facef10 (commit) via 101154f1453bae9d106d16d2370abc4654bc8f35 (commit) via f1474dc4749ecf868dc8353c7563f899ba47b47b (commit) via d98d69f90da424d4ca4edea77e38cd13488af5ce (commit) via 1716dce74927cbfc06d27862c2ac3e9335ce9b4d (commit) via 1ee5d2481d40c42da16347b1d129de8dc54f6340 (commit) via ac307d43f7a779d054d0a28ca5ad9490ef4d1728 (commit) via 2d5f0b2d9e6e25c526ce4596139c74708d0f024d (commit) via f6811c1f3ff7de0e03270d7f88ba2c82b14c309a (commit) via 622270636fb94cf9b066d61a0778f733d9a2953d (commit) from 924f4d13c1cb817aadc5472e4123ed4562664397 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email. - Log ----------------------------------------------------------------- commit 354629c024cc23ca9efb9d6941a4196ac1c78606 Merge: 924f4d1 f53f690 Author: Jan Kratochvil Date: Fri Aug 5 21:32:36 2011 +0200 Merge branch 'commands-funcstuff-basic-tailread-tailframe-selftail-printarg-entrybt-lvalnull-dispref-entryexp-entrybtref' into commands-funcstuff-basic-tailread-tailframe-selftail-printarg-entrybt-lvalnull-dispref-entryexp-entrybtref-final commit f53f69030a5748235d45dca1f88659e66c4350d8 Merge: 860bbef e691f51 Author: Jan Kratochvil Date: Fri Aug 5 21:32:32 2011 +0200 Merge branch 'commands-funcstuff-basic-tailread-tailframe-selftail-printarg-entrybt-lvalnull-dispref-entryexp' into commands-funcstuff-basic-tailread-tailframe-selftail-printarg-entrybt-lvalnull-dispref-entryexp-entrybtref commit e691f511eb51e220a79afc72ee514a3697f555c9 Merge: 5c485a9 d9790ef Author: Jan Kratochvil Date: Fri Aug 5 21:32:31 2011 +0200 Merge branch 'commands-funcstuff-basic-tailread-tailframe-selftail-printarg-entrybt-lvalnull-dispref' into commands-funcstuff-basic-tailread-tailframe-selftail-printarg-entrybt-lvalnull-dispref-entryexp commit d9790ef444f59d34a72f56024ad38ca8bcbd71fe Merge: 99fc08e fa49639 Author: Jan Kratochvil Date: Fri Aug 5 21:32:27 2011 +0200 Merge branch 'commands-funcstuff-basic-tailread-tailframe-selftail-printarg-entrybt-lvalnull' into commands-funcstuff-basic-tailread-tailframe-selftail-printarg-entrybt-lvalnull-dispref commit fa49639ca539a93315e280faaaf045f8a456d703 Merge: b116ee6 61b6a2c Author: Jan Kratochvil Date: Fri Aug 5 21:32:26 2011 +0200 Merge branch 'commands-funcstuff-basic-tailread-tailframe-selftail-printarg-entrybt' into commands-funcstuff-basic-tailread-tailframe-selftail-printarg-entrybt-lvalnull commit 61b6a2c7e365f070e15ab9ed5ecae21327daba0b Merge: 203d514 20f0387 Author: Jan Kratochvil Date: Fri Aug 5 21:32:23 2011 +0200 Merge branch 'commands-funcstuff-basic-tailread-tailframe-selftail-printarg' into commands-funcstuff-basic-tailread-tailframe-selftail-printarg-entrybt commit 20f03875a951f1f7d7be7d8559486674da7ff1e9 Merge: 664bd11 238b648 Author: Jan Kratochvil Date: Fri Aug 5 21:32:22 2011 +0200 Merge branch 'commands-funcstuff-basic-tailread-tailframe-selftail' into commands-funcstuff-basic-tailread-tailframe-selftail-printarg commit 238b648c64628acc453f01e77b6994c33a771714 Merge: f2ebbd0 560c5bf Author: Jan Kratochvil Date: Fri Aug 5 21:32:21 2011 +0200 Merge branch 'commands-funcstuff-basic-tailread-tailframe' into commands-funcstuff-basic-tailread-tailframe-selftail commit 560c5bf676cd5aa079458d243aeb9b8f5188ff75 Merge: 173d43e be4d918 Author: Jan Kratochvil Date: Fri Aug 5 21:32:19 2011 +0200 Merge branch 'commands-funcstuff-basic-tailread' into commands-funcstuff-basic-tailread-tailframe commit be4d9189571cfd0064d61be9d52b03e6736539a6 Merge: f89661a e755f18 Author: Jan Kratochvil Date: Fri Aug 5 21:32:16 2011 +0200 Merge branch 'commands-funcstuff-basic' into commands-funcstuff-basic-tailread commit e755f18c455547dd07352d0391f8912b5617cfb7 Merge: 617b61a aeef826 Author: Jan Kratochvil Date: Fri Aug 5 21:32:15 2011 +0200 Merge branch 'commands-funcstuff' into commands-funcstuff-basic commit aeef8260ef92baed1903cdda9e5104f123ef6c3e Merge: a7118fd 550ae34 Author: Jan Kratochvil Date: Fri Aug 5 21:32:14 2011 +0200 Merge branch 'commands' into commands-funcstuff commit 550ae347746af5a2a3b2847ff6da3f331aef52cd Merge: 66e2c58 c5fce18 Author: Jan Kratochvil Date: Fri Aug 5 21:31:58 2011 +0200 Merge remote-tracking branch 'gdb/master' into commands Conflicts: gdb/exceptions.c commit 66e2c5800431861dd71cb0ea8adf135d84a68b6e Author: Jan Kratochvil Date: Fri Aug 5 21:31:31 2011 +0200 commands2 commit c5fce18816c49d91c06c0bd9a4e5d6726af5c508 Author: David S. Miller Date: Fri Aug 5 16:52:48 2011 +0000 include/opcode/ * sparc.h: Document new format codes '4', '5', and '('. (OPF_LOW4, RS3): New macros. opcodes/ * sparc-dis.c (v9a_ast_reg_names): Add "cps". (X_RS3): New macro. (print_insn_sparc): Handle '4', '5', and '(' format codes. Accept %asr numbers below 28. * sparc-opc.c (sparc_opcodes): Add entries for HPC and VIS3 instructions. gas/ * config/tc-sparc.c (v9a_asr_table): Add "cps". (sparc_ip): Handle '4', '5' and '(' format codes. gas/testsuite * gas/sparc/hpcvis3.d: New test. * gas/sparc/hpcvis3.s: New test source. * gas/sparc/sparc.exp: Run new test. commit 7c9202cb57f8395f8149ea27583145555facef10 Author: Paul Pluzhnikov Date: Fri Aug 5 16:38:34 2011 +0000 2011-08-05 Paul Pluzhnikov * solib-target.c (segment_attributes): Make them static. (section_attributes, library_children, library_attributes): Likewise. (library_list_children, library_list_attributes): Likesise. (library_list_elements): Likewise. commit 101154f1453bae9d106d16d2370abc4654bc8f35 Author: Pedro Alves Date: Fri Aug 5 15:17:53 2011 +0000 gdb/ * exceptions.c (throw_exception): Don't disable the current display. * printcmd.c (disable_current_display_cleanup): New function. (do_one_display): Install a cleanup to disable the current display if doing the display throws. gdb/testsuite/ * gdb.trace/unavailable.exp (test_maybe_regvar_display): New procedure. (gdb_collect_args_test, gdb_collect_locals_test): Use it. commit f1474dc4749ecf868dc8353c7563f899ba47b47b Author: Paul Pluzhnikov Date: Fri Aug 5 15:17:23 2011 +0000 Clean up trailing white space commit d98d69f90da424d4ca4edea77e38cd13488af5ce Author: Eli Zaretskii Date: Fri Aug 5 14:24:06 2011 +0000 * python/py-breakpoint.c (gdbpy_initialize_breakpoints): Move the initialization of the tp_new member to the corresponding gdbpy_initialize_* function. * python/py-cmd.c (gdbpy_initialize_commands): Likewise. * python/py-frame.c (gdbpy_initialize_frames): Likewise. * python/py-function.c (gdbpy_initialize_functions): Likewise. * python/py-inferior.c (gdbpy_initialize_inferior): Likewise. * python/py-param.c (gdbpy_initialize_parameters): Likewise. commit 1716dce74927cbfc06d27862c2ac3e9335ce9b4d Author: Eli Zaretskii Date: Fri Aug 5 14:21:06 2011 +0000 win32-low.c: Include . commit 1ee5d2481d40c42da16347b1d129de8dc54f6340 Author: Mark Kettenis Date: Fri Aug 5 12:37:24 2011 +0000 * netbsd-core.c (netbsd_core_vec): Init match_priority field. commit ac307d43f7a779d054d0a28ca5ad9490ef4d1728 Author: qiyao Date: Fri Aug 5 09:41:26 2011 +0000 gdb/testsuite/ * gdb.base/callfuncs.exp: Set language after main. * gdb.cp/cplusfuncs.exp: Likewise. * gdb.cp/inherit.exp: Likewise. commit 2d5f0b2d9e6e25c526ce4596139c74708d0f024d Author: Alan Modra Date: Fri Aug 5 06:22:21 2011 +0000 bfd/ * elf64-ppc.c (maybe_strip_output): New function. (ppc64_elf_size_stubs): Use it to strip .branch_lt and .eh_frame. ld/testsuite/ * ld-powerpc/tlsexe.r: Update for stripped .branch_lt. * ld-powerpc/tlsexetoc.r: Likewise. * ld-powerpc/tlsso.r: Likewise. * ld-powerpc/tlstocso.r: Likewise. commit f6811c1f3ff7de0e03270d7f88ba2c82b14c309a Author: Alan Modra Date: Fri Aug 5 03:17:09 2011 +0000 PR ld/12762 bfd/ * elflink.c (_bfd_elf_section_already_linked): Return matched status. Remove COFF comdat section handling. * linker.c (_bfd_generic_section_already_linked): Return matched status. Don't set SEC_GROUP in l_flags for plugin entries. (bfd_section_already_linked): Update prototype. * targets.c (_section_already_linked): Likewise. * elf-bfd.h (_bfd_elf_section_already_linked): Likewise. * libbfd-in.h (_bfd_generic_section_already_linked): Likewise. (_bfd_nolink_section_already_linked): Update. * libbfd.h: Regenerate. * bfd-in2.h: Regenerate. ld/ * plugin.c (add_symbols): Exclude comdat_key symbols from symbol table if already seen. commit 622270636fb94cf9b066d61a0778f733d9a2953d Author: Alan Modra Date: Fri Aug 5 02:24:08 2011 +0000 * elf32-ppc.c: Include dwarf2.h. (struct ppc_elf_link_hash_table): Add glink_eh_frame. (ppc_elf_create_glink): Create .eh_frame section. (glink_eh_frame_cie): New array. (ppc_elf_size_dynamic_sections): Size glink_eh_frame. (ppc_elf_finish_dynamic_sections): Write glink_eh_frame. ----------------------------------------------------------------------- Summary of changes: bfd/ChangeLog | 41 +++++++++-- bfd/bfd-in2.h | 6 +- bfd/elf-bfd.h | 2 +- bfd/elf32-ppc.c | 115 +++++++++++++++++++++++++++++++ bfd/elf64-ppc.c | 27 ++++++- bfd/elflink.c | 29 ++++---- bfd/libbfd-in.h | 6 +- bfd/libbfd.h | 6 +- bfd/linker.c | 23 +++--- bfd/netbsd-core.c | 1 + bfd/targets.c | 4 +- gdb/ChangeLog | 26 +++++++ gdb/event-loop.c | 3 - gdb/event-top.c | 1 - gdb/exceptions.c | 3 + gdb/gdbserver/ChangeLog | 4 + gdb/gdbserver/win32-low.c | 1 + gdb/main.c | 3 - gdb/printcmd.c | 11 ++-- gdb/python/py-breakpoint.c | 2 +- gdb/python/py-cmd.c | 2 +- gdb/python/py-frame.c | 2 +- gdb/python/py-function.c | 2 +- gdb/python/py-inferior.c | 2 +- gdb/python/py-param.c | 2 +- gdb/solib-svr4.c | 12 ++-- gdb/solib-target.c | 14 ++-- gdb/testsuite/ChangeLog | 12 +++ gdb/testsuite/gdb.base/callfuncs.exp | 2 +- gdb/testsuite/gdb.cp/cplusfuncs.exp | 2 +- gdb/testsuite/gdb.cp/inherit.exp | 2 +- gdb/testsuite/gdb.trace/unavailable.exp | 34 +++++++++ gdb/top.c | 1 - include/opcode/ChangeLog | 5 ++ include/opcode/sparc.h | 8 ++- opcodes/ChangeLog | 9 +++ opcodes/sparc-dis.c | 19 ++++- opcodes/sparc-opc.c | 88 +++++++++++++++++++++++ 38 files changed, 443 insertions(+), 89 deletions(-) First 500 lines of diff: diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 85ef260..673f96a 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,36 @@ +2011-08-05 Mark Kettenis + + * netbsd-core.c (netbsd_core_vec): Init match_priority field. + +2011-08-05 Alan Modra + + * elf64-ppc.c (maybe_strip_output): New function. + (ppc64_elf_size_stubs): Use it to strip .branch_lt and .eh_frame. + +2011-08-05 Alan Modra + + PR ld/12762 + * elflink.c (_bfd_elf_section_already_linked): Return matched + status. Remove COFF comdat section handling. + * linker.c (_bfd_generic_section_already_linked): Return matched + status. Don't set SEC_GROUP in l_flags for plugin entries. + (bfd_section_already_linked): Update prototype. + * targets.c (_section_already_linked): Likewise. + * elf-bfd.h (_bfd_elf_section_already_linked): Likewise. + * libbfd-in.h (_bfd_generic_section_already_linked): Likewise. + (_bfd_nolink_section_already_linked): Update. + * libbfd.h: Regenerate. + * bfd-in2.h: Regenerate. + +2011-08-05 Alan Modra + + * elf32-ppc.c: Include dwarf2.h. + (struct ppc_elf_link_hash_table): Add glink_eh_frame. + (ppc_elf_create_glink): Create .eh_frame section. + (glink_eh_frame_cie): New array. + (ppc_elf_size_dynamic_sections): Size glink_eh_frame. + (ppc_elf_finish_dynamic_sections): Write glink_eh_frame. + 2011-08-04 Tristan Gingold * vms-alpha.c (_bfd_vms_write_eeom): Round vms_linkage_index. @@ -135,13 +168,7 @@ 2011-07-26 Alan Modra - * elf32-ppc.c: Include dwarf2.h. - (struct ppc_elf_link_hash_table): Add glink_eh_frame. - (ppc_elf_create_glink): Create .eh_frame section. - (glink_eh_frame_cie): New array. - (ppc_elf_size_dynamic_sections): Size glink_eh_frame. - (ppc_elf_finish_dynamic_sections): Write glink_eh_frame. - * elf64-ppc.c: Include dwarg2.h. + * elf64-ppc.c: Include dwarf2.h. (struct ppc_link_hash_table): Add glink_eh_frame. (create_linkage_sections): Create .eh_frame section. (ppc64_elf_size_dynamic_sections): Arrange to drop unneeded diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h index ac8145d..af13ca4 100644 --- a/bfd/bfd-in2.h +++ b/bfd/bfd-in2.h @@ -6107,8 +6107,8 @@ typedef struct bfd_target /* Check if SEC has been already linked during a reloceatable or final link. */ - void (*_section_already_linked) (bfd *, struct already_linked *, - struct bfd_link_info *); + bfd_boolean (*_section_already_linked) (bfd *, struct already_linked *, + struct bfd_link_info *); /* Define a common symbol. */ bfd_boolean (*_bfd_define_common_symbol) (bfd *, struct bfd_link_info *, @@ -6177,7 +6177,7 @@ bfd_boolean bfd_link_split_section (bfd *abfd, asection *sec); #define bfd_link_split_section(abfd, sec) \ BFD_SEND (abfd, _bfd_link_split_section, (abfd, sec)) -void bfd_section_already_linked (bfd *abfd, +bfd_boolean bfd_section_already_linked (bfd *abfd, struct already_linked *data, struct bfd_link_info *info); diff --git a/bfd/elf-bfd.h b/bfd/elf-bfd.h index e6ea580..2c80f67 100644 --- a/bfd/elf-bfd.h +++ b/bfd/elf-bfd.h @@ -1802,7 +1802,7 @@ extern bfd_boolean _bfd_elf_match_sections_by_type extern bfd_boolean bfd_elf_is_group_section (bfd *, const struct bfd_section *); struct already_linked; -extern void _bfd_elf_section_already_linked +extern bfd_boolean _bfd_elf_section_already_linked (bfd *, struct already_linked *, struct bfd_link_info *); extern void bfd_elf_set_group_contents (bfd *, asection *, void *); diff --git a/bfd/elf32-ppc.c b/bfd/elf32-ppc.c index 4dd193a..7e66134 100644 --- a/bfd/elf32-ppc.c +++ b/bfd/elf32-ppc.c @@ -36,6 +36,7 @@ #include "elf/ppc.h" #include "elf32-ppc.h" #include "elf-vxworks.h" +#include "dwarf2.h" /* RELA relocations are used here. */ @@ -2679,6 +2680,7 @@ struct ppc_elf_link_hash_table asection *relsbss; elf_linker_section_t sdata[2]; asection *sbss; + asection *glink_eh_frame; /* The (unloaded but important) .rela.plt.unloaded on VxWorks. */ asection *srelplt2; @@ -2869,6 +2871,17 @@ ppc_elf_create_glink (bfd *abfd, struct bfd_link_info *info) || !bfd_set_section_alignment (abfd, s, 4)) return FALSE; + if (!info->no_ld_generated_unwind_info) + { + flags = (SEC_ALLOC | SEC_LOAD | SEC_READONLY | SEC_HAS_CONTENTS + | SEC_IN_MEMORY | SEC_LINKER_CREATED); + s = bfd_make_section_anyway_with_flags (abfd, ".eh_frame", flags); + htab->glink_eh_frame = s; + if (s == NULL + || !bfd_set_section_alignment (abfd, s, 2)) + return FALSE; + } + flags = SEC_ALLOC | SEC_LINKER_CREATED; s = bfd_make_section_anyway_with_flags (abfd, ".iplt", flags); htab->iplt = s; @@ -5508,6 +5521,20 @@ maybe_set_textrel (struct elf_link_hash_entry *h, void *info) return TRUE; } +static const unsigned char glink_eh_frame_cie[] = +{ + 0, 0, 0, 16, /* length. */ + 0, 0, 0, 0, /* id. */ + 1, /* CIE version. */ + 'z', 'R', 0, /* Augmentation string. */ + 4, /* Code alignment. */ + 0x7c, /* Data alignment. */ + 65, /* RA reg. */ + 1, /* Augmentation size. */ + DW_EH_PE_pcrel | DW_EH_PE_sdata4, /* FDE encoding. */ + DW_CFA_def_cfa, 1, 0 /* def_cfa: r1 offset 0. */ +}; + /* Set the sizes of the dynamic sections. */ static bfd_boolean @@ -5768,6 +5795,21 @@ ppc_elf_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, } } + if (htab->glink != NULL + && htab->glink->size != 0 + && htab->glink_eh_frame != NULL + && !bfd_is_abs_section (htab->glink_eh_frame->output_section)) + { + s = htab->glink_eh_frame; + s->size = sizeof (glink_eh_frame_cie) + 20; + if (info->shared) + { + s->size += 4; + if (htab->glink->size - GLINK_PLTRESOLVE + 8 >= 256) + s->size += 4; + } + } + /* We've now determined the sizes of the various dynamic sections. Allocate memory for them. */ relocs = FALSE; @@ -5791,6 +5833,7 @@ ppc_elf_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, } else if (s == htab->iplt || s == htab->glink + || s == htab->glink_eh_frame || s == htab->sgotplt || s == htab->sbss || s == htab->dynbss @@ -8915,6 +8958,78 @@ ppc_elf_finish_dynamic_sections (bfd *output_bfd, } } + if (htab->glink_eh_frame != NULL + && htab->glink_eh_frame->contents != NULL) + { + unsigned char *p = htab->glink_eh_frame->contents; + bfd_vma val; + + memcpy (p, glink_eh_frame_cie, sizeof (glink_eh_frame_cie)); + /* CIE length (rewrite in case little-endian). */ + bfd_put_32 (htab->elf.dynobj, sizeof (glink_eh_frame_cie) - 4, p); + p += sizeof (glink_eh_frame_cie); + /* FDE length. */ + val = htab->glink_eh_frame->size - 4 - sizeof (glink_eh_frame_cie); + bfd_put_32 (htab->elf.dynobj, val, p); + p += 4; + /* CIE pointer. */ + val = p - htab->glink_eh_frame->contents; + bfd_put_32 (htab->elf.dynobj, val, p); + p += 4; + /* Offset to .glink. */ + val = (htab->glink->output_section->vma + + htab->glink->output_offset); + val -= (htab->glink_eh_frame->output_section->vma + + htab->glink_eh_frame->output_offset); + val -= p - htab->glink_eh_frame->contents; + bfd_put_32 (htab->elf.dynobj, val, p); + p += 4; + /* .glink size. */ + bfd_put_32 (htab->elf.dynobj, htab->glink->size, p); + p += 4; + /* Augmentation. */ + p += 1; + + if (info->shared + && htab->elf.dynamic_sections_created) + { + bfd_vma adv = (htab->glink->size - GLINK_PLTRESOLVE + 8) >> 2; + if (adv < 64) + *p++ = DW_CFA_advance_loc + adv; + else if (adv < 256) + { + *p++ = DW_CFA_advance_loc1; + *p++ = adv; + } + else if (adv < 65536) + { + *p++ = DW_CFA_advance_loc2; + bfd_put_16 (htab->elf.dynobj, adv, p); + p += 2; + } + else + { + *p++ = DW_CFA_advance_loc4; + bfd_put_32 (htab->elf.dynobj, adv, p); + p += 4; + } + *p++ = DW_CFA_register; + *p++ = 65; + p++; + *p++ = DW_CFA_advance_loc + 4; + *p++ = DW_CFA_restore_extended; + *p++ = 65; + } + BFD_ASSERT ((bfd_vma) ((p + 3 - htab->glink_eh_frame->contents) & -4) + == htab->glink_eh_frame->size); + + if (htab->glink_eh_frame->sec_info_type == ELF_INFO_TYPE_EH_FRAME + && !_bfd_elf_write_section_eh_frame (output_bfd, info, + htab->glink_eh_frame, + htab->glink_eh_frame->contents)) + return FALSE; + } + return ret; } diff --git a/bfd/elf64-ppc.c b/bfd/elf64-ppc.c index d13447e..e942a7a 100644 --- a/bfd/elf64-ppc.c +++ b/bfd/elf64-ppc.c @@ -10871,6 +10871,26 @@ static const unsigned char glink_eh_frame_cie[] = DW_CFA_def_cfa, 1, 0 /* def_cfa: r1 offset 0. */ }; +/* Stripping output sections is normally done before dynamic section + symbols have been allocated. This function is called later, and + handles cases like htab->brlt which is mapped to its own output + section. */ + +static void +maybe_strip_output (struct bfd_link_info *info, asection *isec) +{ + if (isec->size == 0 + && isec->output_section->size == 0 + && !bfd_section_removed_from_list (info->output_bfd, + isec->output_section) + && elf_section_data (isec->output_section)->dynindx == 0) + { + isec->output_section->flags |= SEC_EXCLUDE; + bfd_section_list_remove (info->output_bfd, isec->output_section); + info->output_bfd->section_count--; + } +} + /* Determine and set the size of the stub section for a final link. The basic idea here is to examine all the relocations looking for @@ -11251,10 +11271,9 @@ ppc64_elf_size_stubs (struct bfd_link_info *info, bfd_signed_vma group_size, (*htab->layout_sections_again) (); } - /* It would be nice to strip htab->brlt from the output if the - section is empty, but it's too late. If we strip sections here, - the dynamic symbol table is corrupted since the section symbol - for the stripped section isn't written. */ + maybe_strip_output (info, htab->brlt); + if (htab->glink_eh_frame != NULL) + maybe_strip_output (info, htab->glink_eh_frame); return TRUE; } diff --git a/bfd/elflink.c b/bfd/elflink.c index 2e592f5..53765b6 100644 --- a/bfd/elflink.c +++ b/bfd/elflink.c @@ -12515,7 +12515,7 @@ section_signature (asection *sec) return sec->name; } -void +bfd_boolean _bfd_elf_section_already_linked (bfd *abfd, struct already_linked *linked, struct bfd_link_info *info) @@ -12525,6 +12525,7 @@ _bfd_elf_section_already_linked (bfd *abfd, struct bfd_section_already_linked *l; struct bfd_section_already_linked_hash_entry *already_linked_list; asection *sec, *l_sec; + bfd_boolean matched; p = name = linked->comdat_key; if (name) @@ -12536,20 +12537,20 @@ _bfd_elf_section_already_linked (bfd *abfd, { sec = linked->u.sec; if (sec->output_section == bfd_abs_section_ptr) - return; + return FALSE; flags = sec->flags; /* Return if it isn't a linkonce section. A comdat group section also has SEC_LINK_ONCE set. */ if ((flags & SEC_LINK_ONCE) == 0) - return; + return FALSE; /* Don't put group member sections on our list of already linked sections. They are handled as a group via their group section. */ if (elf_sec_group (sec) != NULL) - return; + return FALSE; /* FIXME: When doing a relocatable link, we may have trouble copying relocations in other sections that refer to local symbols @@ -12582,7 +12583,6 @@ _bfd_elf_section_already_linked (bfd *abfd, for (l = already_linked_list->entry; l != NULL; l = l->next) { - bfd_boolean l_coff_comdat_sec; flagword l_flags; bfd *l_owner; const char *l_name = l->linked.comdat_key; @@ -12593,23 +12593,19 @@ _bfd_elf_section_already_linked (bfd *abfd, l_flags = (SEC_GROUP | SEC_LINK_ONCE | SEC_LINK_DUPLICATES_DISCARD); - l_coff_comdat_sec = FALSE; } else { l_sec = l->linked.u.sec; l_owner = l_sec->owner; l_flags = l_sec->flags; - l_coff_comdat_sec - = !!bfd_coff_get_comdat_section (l_sec->owner, l_sec); l_name = section_signature (l_sec); } /* We may have 2 different types of sections on the list: group sections and linkonce sections. Match like sections. */ if ((flags & SEC_GROUP) == (l_flags & SEC_GROUP) - && strcmp (name, l_name) == 0 - && !l_coff_comdat_sec) + && strcmp (name, l_name) == 0) { /* The section has already been linked. See if we should issue a warning. */ @@ -12629,7 +12625,7 @@ _bfd_elf_section_already_linked (bfd *abfd, && (l_owner->flags & BFD_PLUGIN) != 0) { l->linked = *linked; - return; + return FALSE; } break; @@ -12711,10 +12707,11 @@ _bfd_elf_section_already_linked (bfd *abfd, } } - return; + return TRUE; } } + matched = FALSE; if (sec) { /* A single member comdat group section may be discarded by a @@ -12742,6 +12739,7 @@ _bfd_elf_section_already_linked (bfd *abfd, first->output_section = bfd_abs_section_ptr; first->kept_section = l_sec; sec->output_section = bfd_abs_section_ptr; + matched = TRUE; break; } } @@ -12767,6 +12765,7 @@ _bfd_elf_section_already_linked (bfd *abfd, { sec->output_section = bfd_abs_section_ptr; sec->kept_section = first; + matched = TRUE; break; } } @@ -12799,7 +12798,10 @@ _bfd_elf_section_already_linked (bfd *abfd, && CONST_STRNEQ (l_sec->name, ".gnu.linkonce.t.")) { if (abfd != l_sec->owner) - sec->output_section = bfd_abs_section_ptr; + { + sec->output_section = bfd_abs_section_ptr; + matched = TRUE; + } break; } } @@ -12810,6 +12812,7 @@ _bfd_elf_section_already_linked (bfd *abfd, if (! bfd_section_already_linked_table_insert (already_linked_list, linked)) info->callbacks->einfo (_("%F%P: already_linked_table: %E\n")); + return matched; } bfd_boolean diff --git a/bfd/libbfd-in.h b/bfd/libbfd-in.h index 0c98b47..db39f3c 100644 --- a/bfd/libbfd-in.h +++ b/bfd/libbfd-in.h @@ -481,8 +481,8 @@ extern bfd_boolean _bfd_generic_set_section_contents #define _bfd_nolink_bfd_link_split_section \ ((bfd_boolean (*) (bfd *, struct bfd_section *)) bfd_false) #define _bfd_nolink_section_already_linked \ - ((void (*) (bfd *, struct already_linked*, \ - struct bfd_link_info *)) bfd_void) + ((bfd_boolean (*) (bfd *, struct already_linked*, \ + struct bfd_link_info *)) bfd_false) #define _bfd_nolink_bfd_define_common_symbol \ ((bfd_boolean (*) (bfd *, struct bfd_link_info *, \ struct bfd_link_hash_entry *)) bfd_false) @@ -602,7 +602,7 @@ extern bfd_boolean _bfd_generic_final_link extern bfd_boolean _bfd_generic_link_split_section (bfd *, struct bfd_section *); -extern void _bfd_generic_section_already_linked +extern bfd_boolean _bfd_generic_section_already_linked (bfd *, struct already_linked *, struct bfd_link_info *); /* Generic reloc_link_order processing routine. */ diff --git a/bfd/libbfd.h b/bfd/libbfd.h index 33069b0..71188dc 100644 --- a/bfd/libbfd.h +++ b/bfd/libbfd.h @@ -486,8 +486,8 @@ extern bfd_boolean _bfd_generic_set_section_contents #define _bfd_nolink_bfd_link_split_section \ ((bfd_boolean (*) (bfd *, struct bfd_section *)) bfd_false) #define _bfd_nolink_section_already_linked \ - ((void (*) (bfd *, struct already_linked*, \ - struct bfd_link_info *)) bfd_void) + ((bfd_boolean (*) (bfd *, struct already_linked*, \ + struct bfd_link_info *)) bfd_false) #define _bfd_nolink_bfd_define_common_symbol \ ((bfd_boolean (*) (bfd *, struct bfd_link_info *, \ struct bfd_link_hash_entry *)) bfd_false) @@ -607,7 +607,7 @@ extern bfd_boolean _bfd_generic_final_link extern bfd_boolean _bfd_generic_link_split_section (bfd *, struct bfd_section *); -extern void _bfd_generic_section_already_linked +extern bfd_boolean _bfd_generic_section_already_linked (bfd *, struct already_linked *, struct bfd_link_info *); /* Generic reloc_link_order processing routine. */ diff --git a/bfd/linker.c b/bfd/linker.c index 8700c05..b3ccefd 100644 --- a/bfd/linker.c +++ b/bfd/linker.c @@ -2888,13 +2888,13 @@ FUNCTION bfd_section_already_linked SYNOPSIS - void bfd_section_already_linked (bfd *abfd, - struct already_linked *data, hooks/post-receive -- Repository for Project Archer.