From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20311 invoked by alias); 21 Feb 2009 00:31:58 -0000 Mailing-List: contact archer-commits-help@sourceware.org; run by ezmlm Sender: Precedence: bulk List-Post: List-Help: List-Subscribe: Received: (qmail 20159 invoked by uid 9674); 21 Feb 2009 00:31:52 -0000 Date: Sat, 21 Feb 2009 00:31:00 -0000 Message-ID: <20090221003151.20130.qmail@sourceware.org> From: jkratoch@sourceware.org To: archer-commits@sourceware.org Subject: [SCM] archer-jankratochvil-type-refcount: Merge commit 'origin/master' into archer-jankratochvil-type-refcount X-Git-Refname: refs/heads/archer-jankratochvil-type-refcount X-Git-Reftype: branch X-Git-Oldrev: 30cac77f8975ae7b16030107d938808e5debed8b X-Git-Newrev: 48c30cb6b9c943fd4ab69d552b8f51f8e67b99f2 X-SW-Source: 2009-q1/txt/msg00174.txt.bz2 List-Id: The branch, archer-jankratochvil-type-refcount has been updated via 48c30cb6b9c943fd4ab69d552b8f51f8e67b99f2 (commit) via 53089be36d7fcfd62e8eb40bd4fdf3f0631fe3ac (commit) via a860804364cd916d40273cce19c02f05e6540f0f (commit) via 6d96804441519abea1126232640d2f82e987335b (commit) via 2ec6dc173a50f318ea0865c7b9543ff723c6bfd3 (commit) via 9509403af9755d5334454c20d1504a567c5d9b3a (commit) via 597f03241f93b1a73ab394469992309f93e4bc8e (commit) via bdd55903c84984eccaa5345b36415cd767728190 (commit) via 677bfa8d5bc34ed302193271a439268c1cfeb632 (commit) via 36c5624bebf012aa7dec40b20d5e7712d9e0b33b (commit) via b8be230d6d076d3466492b0a6e1877e26150783a (commit) via a74dbf1be8a84bff333571954e220837deb3ddc9 (commit) via 98272542add82fe113c4d3bea888a7a40019eaa1 (commit) via 5f0501477fc6332075673ad425979103423c74be (commit) via 566ddf642553ba473040430f751004389ed44fff (commit) via 2504a910747bad8ae1076430a07b0acdaf6d2613 (commit) via 3a289b5e696442abc63ccde975ded195c94f70a1 (commit) via 38d8413dc193b820586777e11a11716fbcdfed30 (commit) via 3af29a91e1f67cf94009f6fa9473553fac7b83c8 (commit) via 5214df495a03ce68a6f9fd5944e2a70ad5b39db2 (commit) via 011557197e75c477dc9d97281aa6708db5986566 (commit) via 1f30768d8c6b06a25638a3ee42bfce87b6ff195c (commit) via 92997fd6efe086fa0e9a2e9118298b5eefbbcee2 (commit) via 68e6cb94bcedea41f1e31dc9c338c1ec4471b2aa (commit) via fa48e67a600b2550c9811795a6faecc44414db82 (commit) via 3d8a30832b60b9cd4b3fdc46bb799162e85e0907 (commit) via 85ced7552f6c186be0cdc574a4e7bf13f996ca88 (commit) via 58f069edbd6baf1fe200ab72de2e423429dba100 (commit) via fabdb985649e3590f792033892b2df4f9a83b91a (commit) via 58622c3c6ef0f90ffa81d03a34d1ffd93cd89c97 (commit) via 33547c8d8624410894b32cb5f29dea127737176a (commit) via 850e80a0786263242e89a78810b858a9cac464f9 (commit) via dc234f38592e3c58e599d1c638e18bc9cddd9c64 (commit) via 024503abcd82b2736f3e0f9b0acb0889b7d173b5 (commit) via 451c4b94b450503affd3a40a9f821b6fe70c3376 (commit) via 26d086d741fb1bb0eee9d50e0bafa7c5e388023f (commit) via 28dd1034e2e511306a371575fcec79b4c1b19349 (commit) via 1f12e11d4dad9dec64f93e53284fe871e29481c2 (commit) via 719a65d44b030937c4e74b1bbfd6319654a2fffc (commit) via fb2b554031acf2106a1fc2a5e68940c0e53aa64d (commit) via 9e852fd7a0bbbe9b2dd89b6e44431f00fcc23d57 (commit) via 5a5d549b6d6d6751957d87349678e121e614a372 (commit) via 50c4065f0b670f31eeea906899a6672df004cf67 (commit) via a1c1682668b751806ccb515b48fdfe58d1df9192 (commit) via 64c26b89439dd0a74591fb5700fbd230e364feeb (commit) via 126b3fb801f7acfa0f414c3e95896de59566adbd (commit) via e947ab663936483dc67424c153f67e78a910b96b (commit) via ad88187efac2686ec0b15c558e05262a003ba504 (commit) via 57f9b3e3aca4b09da7dee45bba37a60653de27ee (commit) via 8daf1989a99b49fb00fa475a10337916ec418ce2 (commit) via a861ee310e073105e393e0f4353c6bd12f2dcdc9 (commit) via 7c2608818db4dc98bbbd9429b4530a8a8c191c4a (commit) via 9dc7f9a502f63c04302c19f5ae7c5d24953bb4c6 (commit) via 1424a5757dc0468db2f20be1ab9945a67da23931 (commit) via 206dd726511502c477ae435f0f0c2d8a253be064 (commit) via a2359259373fcc5b393843c24bdfd03f5cfc6dff (commit) via 948311e2382e7a427f7f8d77e584e421c2c4ad52 (commit) via 1e702ec6c22c9ad145ae87d8073fc853973cc512 (commit) via 66d3e97f76138f50c5954b9f104c1a831bbf6932 (commit) via 3466f1a4bb94676a9305361bfd61e667315bff79 (commit) via c953f5544c9e1769eaea18ef4326de7b872dd10f (commit) via bd772e2cfac951fff4635f88316503f358186d8a (commit) via 23815d11dce4e80177e1bd1a0831c6d0b749eaaf (commit) from 30cac77f8975ae7b16030107d938808e5debed8b (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email. - Log ----------------------------------------------------------------- commit 48c30cb6b9c943fd4ab69d552b8f51f8e67b99f2 Merge: 30cac77f8975ae7b16030107d938808e5debed8b 53089be36d7fcfd62e8eb40bd4fdf3f0631fe3ac Author: Jan Kratochvil Date: Sat Feb 21 01:30:40 2009 +0100 Merge commit 'origin/master' into archer-jankratochvil-type-refcount ----------------------------------------------------------------------- Summary of changes: bfd/ChangeLog | 157 +++++++++++++++++ bfd/coff-alpha.c | 5 +- bfd/coff-mips.c | 5 +- bfd/coff-rs6000.c | 6 +- bfd/coff-sh.c | 10 +- bfd/coff64-rs6000.c | 8 +- bfd/coffcode.h | 181 ++++++++++++++++---- bfd/coffgen.c | 11 +- bfd/ecoff.c | 12 ++- bfd/efi-app-ia32.c | 5 +- bfd/efi-app-ia64.c | 5 +- bfd/efi-app-x86_64.c | 5 +- bfd/efi-bsdrv-ia32.c | 5 +- bfd/efi-bsdrv-ia64.c | 5 +- bfd/efi-bsdrv-x86_64.c | 5 +- bfd/efi-rtdrv-ia32.c | 5 +- bfd/efi-rtdrv-ia64.c | 5 +- bfd/efi-rtdrv-x86_64.c | 5 +- bfd/elf-hppa.h | 5 +- bfd/elf32-arm.c | 172 ++++++++++--------- bfd/elf32-avr.c | 19 ++- bfd/elf32-mips.c | 2 +- bfd/elf32-ppc.c | 82 +++++---- bfd/elf32-spu.c | 22 ++- bfd/elf64-ppc.c | 247 +++++++++++++-------------- bfd/elflink.c | 9 +- bfd/libcoff-in.h | 4 +- bfd/libcoff.h | 10 +- bfd/libecoff.h | 9 +- bfd/libxcoff.h | 2 + bfd/pe-mips.c | 8 +- bfd/pei-arm.c | 5 +- bfd/pei-i386.c | 5 +- bfd/pei-mcore.c | 5 +- bfd/pei-mips.c | 5 +- bfd/pei-ppc.c | 5 +- bfd/pei-sh.c | 5 +- bfd/pei-x86_64.c | 5 +- bfd/ticoff.h | 17 +-- bfd/version.h | 2 +- bfd/vmsutil.c | 5 +- gdb/ChangeLog | 137 +++++++++++++++- gdb/Makefile.in | 9 +- gdb/NEWS | 1 + gdb/ada-tasks.c | 2 +- gdb/ada-typeprint.c | 16 -- gdb/amd64-dicos-tdep.c | 82 +++++++++ gdb/amd64-sol2-tdep.c | 4 + gdb/amd64-tdep.c | 43 ++--- gdb/breakpoint.c | 8 + gdb/config/i386/nm-cygwin.h | 1 + gdb/config/i386/nm-cygwin64.h | 1 + gdb/config/i386/nm-fbsd.h | 1 + gdb/config/i386/nm-go32.h | 1 + gdb/configure.tgt | 4 +- gdb/corelow.c | 32 +++- gdb/dicos-tdep.c | 113 ++++++++++++ gdb/{config/i386/nm-go32.h => dicos-tdep.h} | 25 +-- gdb/doc/ChangeLog | 19 ++ gdb/doc/gdb.texinfo | 16 ++ gdb/doc/observer.texi | 12 +- gdb/dwarf2read.c | 48 +++++- gdb/gdbarch.c | 27 +++- gdb/gdbarch.h | 11 +- gdb/gdbarch.sh | 7 + gdb/gdbserver/ChangeLog | 5 + gdb/gdbserver/remote-utils.c | 8 + gdb/go32-nat.c | 3 + gdb/i386-dicos-tdep.c | 83 +--------- gdb/i386-sol2-tdep.c | 4 + gdb/i386-tdep.c | 89 +++++++--- gdb/i386fbsd-nat.c | 1 + gdb/infcmd.c | 2 +- gdb/infrun.c | 21 +-- gdb/mi/mi-interp.c | 69 +++++++- gdb/observer.c | 6 +- gdb/p-lang.c | 33 +++-- gdb/p-valprint.c | 20 ++- gdb/solib.c | 1 + gdb/sparc-sol2-tdep.c | 4 + gdb/sparc64-sol2-tdep.c | 4 + gdb/stack.c | 11 +- gdb/testsuite/ChangeLog | 76 ++++++++ gdb/testsuite/gdb.arch/amd64-disp-step.S | 28 +++ gdb/testsuite/gdb.arch/amd64-disp-step.exp | 20 +++ gdb/testsuite/gdb.arch/i386-disp-step.S | 65 +++++++- gdb/testsuite/gdb.arch/i386-disp-step.exp | 58 +++++++ gdb/testsuite/gdb.base/dfp-test.exp | 20 --- gdb/testsuite/gdb.base/long_long.exp | 20 --- gdb/testsuite/gdb.base/macscp.exp | 10 +- gdb/testsuite/gdb.base/pc-fp.exp | 19 +-- gdb/testsuite/gdb.base/remote.exp | 16 -- gdb/testsuite/gdb.base/sizeof.exp | 26 +--- gdb/testsuite/gdb.cp/pr9594.cc | 1 + gdb/testsuite/gdb.fortran/module.exp | 35 ++++ gdb/testsuite/gdb.fortran/module.f90 | 22 +++ gdb/testsuite/gdb.gdb/observer.exp | 48 +++--- gdb/testsuite/gdb.mi/mi-cli.exp | 3 + gdb/testsuite/gdb.mi/mi-nonstop.exp | 2 +- gdb/testsuite/gdb.mi/mi-nsintrall.exp | 2 +- gdb/testsuite/gdb.mi/mi-nsmoribund.exp | 2 +- gdb/testsuite/gdb.pascal/floats.exp | 8 +- gdb/testsuite/gdb.python/python-cmd.exp | 107 ++++++++++++ gdb/testsuite/lib/gdb.exp | 56 ++++++ gdb/testsuite/lib/mi-support.exp | 17 +- gdb/version.in | 2 +- gdb/windows-nat.c | 2 + gdb/xtensa-tdep.c | 7 +- libdecnumber/ChangeLog | 4 + libdecnumber/Makefile.in | 4 +- opcodes/ChangeLog | 30 ++++ opcodes/fr30-opc.c | 5 +- opcodes/frv-opc.c | 5 +- opcodes/ip2k-opc.c | 5 +- opcodes/iq2000-opc.c | 5 +- opcodes/lm32-opc.c | 5 +- opcodes/m32c-opc.c | 5 +- opcodes/m32r-opc.c | 5 +- opcodes/m68k-opc.c | 4 +- opcodes/mep-opc.c | 5 +- opcodes/mips-opc.c | 4 +- opcodes/mt-opc.c | 5 +- opcodes/ppc-opc.c | 4 +- opcodes/tic54x-dis.c | 5 +- opcodes/xc16x-opc.c | 5 +- opcodes/xstormy16-opc.c | 5 +- 126 files changed, 2089 insertions(+), 767 deletions(-) create mode 100644 gdb/amd64-dicos-tdep.c create mode 100644 gdb/dicos-tdep.c copy gdb/{config/i386/nm-go32.h => dicos-tdep.h} (53%) create mode 100644 gdb/testsuite/gdb.fortran/module.exp create mode 100644 gdb/testsuite/gdb.fortran/module.f90 create mode 100644 gdb/testsuite/gdb.python/python-cmd.exp First 500 lines of diff: diff --git a/bfd/ChangeLog b/bfd/ChangeLog index ecc442f..32ae0d8 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,160 @@ +2009-02-20 Cary Coutant + + * vmsutil.c (vms_file_stats_name): Fix incorrect use of st_mtime + in struct stat. + +2009-18-02 Dave Korn + + PR gas/7059 + * coffcode.h (coff_write_object_contents): Don't let the string + table offset overflow the s_name field when using long section names. + +2009-18-02 Dave Korn + + * coff-alpha.c (alpha_ecoff_backend_data): Initialise fields which + control long section name handling with ECOFF_NO_LONG_SECTION_NAMES. + * coff-mips.c (mips_ecoff_backend_data): Likewise. + * coff-rs6000.c (bfd_xcoff_backend_data): Initialise fields which + control long section name handling with XCOFF_NO_LONG_SECTION_NAMES. + (bfd_pmac_xcoff_backend_data): Likewise. + * coff64-rs6000.c (bfd_xcoff_backend_data): Likewise. + (bfd_xcoff_aix5_backend_data): Likewise. + (xcoff64_write_object_contents): Delete unused long_section_names + local variable. + * coff-sh.c (bfd_coff_small_swap_table): Initialise long section + name members using COFF_DEFAULT_LONG_SECTION_NAMES and make entire + struct non-const. + * coffcode.h (documentation): Update to describe long section names. + (COFFLONGSECTIONCATHELPER): New helper macro. + (BLANKOR1TOODD): Likewise. + (COFF_ENABLE_LONG_SECTION_NAMES): Likewise. + (COFF_LONG_SECTION_NAMES_SETTER): Likewise. + (COFF_DEFAULT_LONG_SECTION_NAMES): Likewise. + (bfd_coff_set_long_section_names_allowed): New function. + (bfd_coff_set_long_section_names_disallowed): Likewise. + (struct bfd_coff_backend_data): Add new backend hook function + pointer _bfd_coff_set_long_section_names. + (bfd_coff_set_long_section_names): New backend hook. + (coff_write_object_contents): Only generate long section names if + bfd_coff_long_section_names() indicates they are currently enabled. + (bfd_coff_std_swap_table): Make non-const, and initialise long + section name fields using COFF_DEFAULT_LONG_SECTION_NAMES. + (ticoff0_swap_table): Likewise to both. + (ticoff1_swap_table): Again, likewise to both. + * coffgen.c (make_a_section_from_file): Allow long section names + as inputs even if not currently allowed for outputs. + * ecoff.c (_bfd_ecoff_no_long_sections): New function. + * efi-app-ia32.c (COFF_LONG_SECTION_NAMES): Define to 0, not blank. + * efi-app-ia64.c (COFF_LONG_SECTION_NAMES): Likewise. + * efi-app-x86_64.c (COFF_LONG_SECTION_NAMES): Likewise. + * efi-bsdrv-ia32.c (COFF_LONG_SECTION_NAMES): Likewise. + * efi-bsdrv-ia64.c (COFF_LONG_SECTION_NAMES): Likewise. + * efi-bsdrv-x86_64.c (COFF_LONG_SECTION_NAMES): Likewise. + * efi-rtdrv-ia32.c (COFF_LONG_SECTION_NAMES): Likewise. + * efi-rtdrv-ia64.c (COFF_LONG_SECTION_NAMES): Likewise. + * efi-rtdrv-x86_64.c (COFF_LONG_SECTION_NAMES): Likewise. + * pei-arm.c (COFF_LONG_SECTION_NAMES): Likewise. + * pei-i386.c (COFF_LONG_SECTION_NAMES): Likewise. + * pei-mcore.c (COFF_LONG_SECTION_NAMES): Likewise. + * pei-mips.c (COFF_LONG_SECTION_NAMES): Likewise. + * pei-ppc.c (COFF_LONG_SECTION_NAMES): Likewise. + * pei-sh.c (COFF_LONG_SECTION_NAMES): Likewise. + * pei-x86_64.c (COFF_LONG_SECTION_NAMES): Likewise. + * libcoff-in.h: Update copyright year to cause updated copyright + year in generated libcoff.h, and fix typo. + * libcoff.h: Regenerated. + * libecoff.h (ECOFF_NO_LONG_SECTION_NAMES): New macro. + (_bfd_ecoff_no_long_sections): Add prototype. + * libxcoff.h (XCOFF_NO_LONG_SECTION_NAMES): New macro. + * pe-mips.c (COFF_LONG_SECTION_NAMES): Define empty if not already + defined by an including .c file. + * ticoff.h (ticoff0_swap_table): Make non-const, and initialise + long section name fields using COFF_DEFAULT_LONG_SECTION_NAMES. + (ticoff1_swap_table): Likewise to both. + +2009-02-18 Christophe Lyon + + * elf32-arm.c (arm_build_one_stub): Fix relocation target for pic + stub. Catch default case error. + (arm_map_one_stub): Add missing Thumb mapping symbol. + +2009-02-18 Bjoern Haase + + PR 9841 + * elf32-avr.c: Handle case where no local symbos exist correctly. + +2009-02-16 Christophe Lyon + + bfd/ + * elf32-arm.c (arm_long_branch_stub, + arm_thumb_v4t_long_branch_stub, + arm_thumb_thumb_long_branch_stub, + arm_thumb_arm_v4t_long_branch_stub, + arm_thumb_arm_v4t_short_branch_stub, + arm_pic_long_branch_stub): + Renamed to elf32_arm_stub_long_branch_any_any, + elf32_arm_stub_long_branch_v4t_arm_thumb, + elf32_arm_stub_long_branch_thumb_only, + elf32_arm_stub_long_branch_v4t_thumb_arm, + elf32_arm_stub_short_branch_v4t_thumb_arm, + elf32_arm_stub_long_branch_any_any_pic. + (arm_stub_long_branch, arm_thumb_v4t_stub_long_branch, + arm_thumb_thumb_stub_long_branch, + arm_thumb_arm_v4t_stub_long_branch, + arm_thumb_arm_v4t_stub_short_branch, arm_stub_pic_long_branch): + Renamed to arm_stub_long_branch_any_any, + arm_stub_long_branch_v4t_arm_thumb, + arm_stub_long_branch_thumb_only, + arm_stub_long_branch_v4t_thumb_arm, + arm_stub_short_branch_v4t_thumb_arm, + arm_stub_long_branch_any_any_pic. + +2009-02-15 John David Anglin + + * elf-hppa.h (elf_hppa_final_link_relocate): Correct addend value used + in branch offset check. + +2009-02-15 Alan Modra + + * elf64-ppc.c (struct _ppc64_elf_section_data): Delete t_symndx, + add toc.symndx and toc.add. + (ppc64_elf_check_relocs): Don't set htab->tls_get_addr here. + Set up toc.add. + (get_tls_mask): Add toc_addend param, set from toc.add. Adjust all + callers. + (ppc64_elf_tls_setup): Set htab->tls_get_addr and tls_get_addr_fd. + (branch_reloc_hash_match): New function, extracted from.. + (ppc64_elf_tls_optimize): ..here. + (ppc64_elf_relocate_section): Properly set addends when optimizing + tls sequences. Avoid unnecessary reading and writing of insns. + Only redo reloc when symbol changed. Bypass symbol checks when + using tlsld_got. + * elf32-ppc.c (ppc_elf_tls_setup): Correct comment. + (branch_reloc_hash_match): New function, extracted from.. + (ppc_elf_tls_optimize): ..here. + (ppc_elf_relocate_section): Avoid unnecessary reading of insns. + Don't clear addend on zapped __tls_get_addr reloc. + +2009-02-12 Nick Clifton + + PR 9827 + * elflink.c (bfd_elf_final_link): When counting the relocations, + if the header size has not been set yet then assume that it will + match the output section's reloc type. + +2009-02-12 Nathan Sidwell + + * elf32-mips.c (mips_elf_final_gp): Don't add 0x4000 offset for + relocatable link. + +2009-02-09 Alan Modra + + * elf32-spu.c (spu_elf_find_overlays): Call bfd_set_error on errors. + (find_function): Likewise. + (pasted_function): Don't error if no prior function found. + (discover_functions): Revert 2008-12-10 change. Extend first + function range to start of section. + 2009-02-08 John David Anglin * elf64-hppa.c: Remove PARAMS macro. Replace PTR with void *. Convert diff --git a/bfd/coff-alpha.c b/bfd/coff-alpha.c index 98bed84..efe2dd3 100644 --- a/bfd/coff-alpha.c +++ b/bfd/coff-alpha.c @@ -1,6 +1,6 @@ /* BFD back-end for ALPHA Extended-Coff files. Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, - 2003, 2004, 2005, 2007, 2008 Free Software Foundation, Inc. + 2003, 2004, 2005, 2007, 2008, 2009 Free Software Foundation, Inc. Modified from coff-mips.c by Steve Chamberlain and Ian Lance Taylor . @@ -2297,7 +2297,8 @@ static const struct ecoff_backend_data alpha_ecoff_backend_data = (unsigned (*) PARAMS ((bfd *,PTR,PTR))) bfd_void, /* reloc_out */ alpha_ecoff_swap_filehdr_out, alpha_ecoff_swap_aouthdr_out, alpha_ecoff_swap_scnhdr_out, - FILHSZ, AOUTSZ, SCNHSZ, 0, 0, 0, 0, FILNMLEN, TRUE, FALSE, 4, FALSE, 2, + FILHSZ, AOUTSZ, SCNHSZ, 0, 0, 0, 0, FILNMLEN, TRUE, + ECOFF_NO_LONG_SECTION_NAMES, 4, FALSE, 2, alpha_ecoff_swap_filehdr_in, alpha_ecoff_swap_aouthdr_in, alpha_ecoff_swap_scnhdr_in, NULL, alpha_ecoff_bad_format_hook, _bfd_ecoff_set_arch_mach_hook, diff --git a/bfd/coff-mips.c b/bfd/coff-mips.c index 929b3c1..f82c52d 100644 --- a/bfd/coff-mips.c +++ b/bfd/coff-mips.c @@ -1,6 +1,6 @@ /* BFD back-end for MIPS Extended-Coff files. Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001, 2002, 2003, 2004, 2007, 2008 + 2000, 2001, 2002, 2003, 2004, 2007, 2008, 2009 Free Software Foundation, Inc. Original version by Per Bothner. Full support added by Ian Lance Taylor, ian@cygnus.com. @@ -1312,7 +1312,8 @@ static const struct ecoff_backend_data mips_ecoff_backend_data = (unsigned (*) PARAMS ((bfd *,PTR,PTR))) bfd_void, /* reloc_out */ mips_ecoff_swap_filehdr_out, mips_ecoff_swap_aouthdr_out, mips_ecoff_swap_scnhdr_out, - FILHSZ, AOUTSZ, SCNHSZ, 0, 0, 0, 0, FILNMLEN, TRUE, FALSE, 4, FALSE, 2, + FILHSZ, AOUTSZ, SCNHSZ, 0, 0, 0, 0, FILNMLEN, TRUE, + ECOFF_NO_LONG_SECTION_NAMES, 4, FALSE, 2, mips_ecoff_swap_filehdr_in, mips_ecoff_swap_aouthdr_in, mips_ecoff_swap_scnhdr_in, NULL, mips_ecoff_bad_format_hook, _bfd_ecoff_set_arch_mach_hook, diff --git a/bfd/coff-rs6000.c b/bfd/coff-rs6000.c index 17c6907..1db66e7 100644 --- a/bfd/coff-rs6000.c +++ b/bfd/coff-rs6000.c @@ -1,6 +1,6 @@ /* BFD back-end for IBM RS/6000 "XCOFF" files. Copyright 1990-1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, - 2008 Free Software Foundation, Inc. + 2008, 2009 Free Software Foundation, Inc. Written by Metin G. Ozisik, Mimi Phuong-Thao Vo, and John Gilmore. Archive support from Damon A. Permezel. Contributed by IBM Corporation and Cygnus Support. @@ -4011,7 +4011,7 @@ static const struct xcoff_backend_data_rec bfd_xcoff_backend_data = LINESZ, FILNMLEN, TRUE, /* _bfd_coff_long_filenames */ - FALSE, /* _bfd_coff_long_section_names */ + XCOFF_NO_LONG_SECTION_NAMES, /* _bfd_coff_long_section_names */ 3, /* _bfd_coff_default_section_alignment_power */ FALSE, /* _bfd_coff_force_symnames_in_strings */ 2, /* _bfd_coff_debug_string_prefix_length */ @@ -4263,7 +4263,7 @@ static const struct xcoff_backend_data_rec bfd_pmac_xcoff_backend_data = LINESZ, FILNMLEN, TRUE, /* _bfd_coff_long_filenames */ - FALSE, /* _bfd_coff_long_section_names */ + XCOFF_NO_LONG_SECTION_NAMES, /* _bfd_coff_long_section_names */ 3, /* _bfd_coff_default_section_alignment_power */ FALSE, /* _bfd_coff_force_symnames_in_strings */ 2, /* _bfd_coff_debug_string_prefix_length */ diff --git a/bfd/coff-sh.c b/bfd/coff-sh.c index 1a5d63d..05d99d4 100644 --- a/bfd/coff-sh.c +++ b/bfd/coff-sh.c @@ -1,6 +1,6 @@ /* BFD back-end for Renesas Super-H COFF binaries. Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, - 2003, 2004, 2005, 2007, 2008 Free Software Foundation, Inc. + 2003, 2004, 2005, 2007, 2008, 2009 Free Software Foundation, Inc. Contributed by Cygnus Support. Written by Steve Chamberlain, . Relaxing code written by Ian Lance Taylor, . @@ -3121,7 +3121,7 @@ coff_small_new_section_hook (abfd, section) /* This is copied from bfd_coff_std_swap_table so that we can change the default section alignment power. */ -static const bfd_coff_backend_data bfd_coff_small_swap_table = +static bfd_coff_backend_data bfd_coff_small_swap_table = { coff_swap_aux_in, coff_swap_sym_in, coff_swap_lineno_in, coff_swap_aux_out, coff_swap_sym_out, @@ -3134,11 +3134,7 @@ static const bfd_coff_backend_data bfd_coff_small_swap_table = #else FALSE, #endif -#ifdef COFF_LONG_SECTION_NAMES - TRUE, -#else - FALSE, -#endif + COFF_DEFAULT_LONG_SECTION_NAMES, 2, #ifdef COFF_FORCE_SYMBOLS_IN_STRINGS TRUE, diff --git a/bfd/coff64-rs6000.c b/bfd/coff64-rs6000.c index ee797ed..776b6a2 100644 --- a/bfd/coff64-rs6000.c +++ b/bfd/coff64-rs6000.c @@ -1,5 +1,5 @@ /* BFD back-end for IBM RS/6000 "XCOFF64" files. - Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 + Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. Written Clinton Popetz. Contributed by Cygnus Support. @@ -767,7 +767,6 @@ xcoff64_write_object_contents (abfd) file_ptr sym_base; unsigned long reloc_size = 0; unsigned long lnno_size = 0; - bfd_boolean long_section_names; asection *text_sec = ((void *) 0); asection *data_sec = ((void *) 0); asection *bss_sec = ((void *) 0); @@ -837,7 +836,6 @@ xcoff64_write_object_contents (abfd) if (bfd_seek (abfd, scn_base, SEEK_SET) != 0) return FALSE; - long_section_names = FALSE; for (current = abfd->sections; current != NULL; current = current->next) { struct internal_scnhdr section; @@ -2561,7 +2559,7 @@ static const struct xcoff_backend_data_rec bfd_xcoff_backend_data = LINESZ, FILNMLEN, TRUE, /* _bfd_coff_long_filenames */ - FALSE, /* _bfd_coff_long_section_names */ + XCOFF_NO_LONG_SECTION_NAMES, /* _bfd_coff_long_section_names */ 3, /* _bfd_coff_default_section_alignment_power */ TRUE, /* _bfd_coff_force_symnames_in_strings */ 4, /* _bfd_coff_debug_string_prefix_length */ @@ -2815,7 +2813,7 @@ static const struct xcoff_backend_data_rec bfd_xcoff_aix5_backend_data = LINESZ, FILNMLEN, TRUE, /* _bfd_coff_long_filenames */ - FALSE, /* _bfd_coff_long_section_names */ + XCOFF_NO_LONG_SECTION_NAMES, /* _bfd_coff_long_section_names */ 3, /* _bfd_coff_default_section_alignment_power */ TRUE, /* _bfd_coff_force_symnames_in_strings */ 4, /* _bfd_coff_debug_string_prefix_length */ diff --git a/bfd/coffcode.h b/bfd/coffcode.h index db0b2e9..59bb223 100644 --- a/bfd/coffcode.h +++ b/bfd/coffcode.h @@ -1,6 +1,6 @@ /* Support for the generic parts of most COFF variants, for BFD. Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 + 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. Written by Cygnus Support. @@ -109,6 +109,60 @@ SUBSUBSECTION target. SUBSUBSECTION + Coff long section names + + In the standard Coff object format, section names are limited to + the eight bytes available in the @code{s_name} field of the + @code{SCNHDR} section header structure. The format requires the + field to be NUL-padded, but not necessarily NUL-terminated, so + the longest section names permitted are a full eight characters. + + The Microsoft PE variants of the Coff object file format add + an extension to support the use of long section names. This + extension is defined in section 4 of the Microsoft PE/COFF + specification (rev 8.1). If a section name is too long to fit + into the section header's @code{s_name} field, it is instead + placed into the string table, and the @code{s_name} field is + filled with a slash ("/") followed by the ASCII decimal + representation of the offset of the full name relative to the + string table base. + + Note that this implies that the extension can only be used in object + files, as executables do not contain a string table. The standard + specifies that long section names from objects emitted into executable + images are to be truncated. + + However, as a GNU extension, BFD can generate executable images + that contain a string table and long section names. This + would appear to be technically valid, as the standard only says + that Coff debugging information is deprecated, not forbidden, + and in practice it works, although some tools that parse PE files + expecting the MS standard format may become confused; @file{PEview} is + one known example. + + The functionality is supported in BFD by code implemented under + the control of the macro @code{COFF_LONG_SECTION_NAMES}. If not + defined, the format does not support long section names in any way. + If defined, it is used to initialise a flag, + @code{_bfd_coff_long_section_names}, and a hook function pointer, + @code{_bfd_coff_set_long_section_names}, in the Coff backend data + structure. The flag controls the generation of long section names + in output BFDs at runtime; if it is false, as it will be by default + when generating an executable image, long section names are truncated; + if true, the long section names extension is employed. The hook + points to a function that allows the value of the flag to be altered + at runtime, on formats that support long section names at all; on + other formats it points to a stub that returns an error indication. + + If @code{COFF_LONG_SECTION_NAMES} is simply defined (blank), or is + defined to the value "1", then long section names are enabled by + default; if it is defined to the value zero, they are disabled by + default (but still accepted in input BFDs). The header @file{coffcode.h} + defines a macro, @code{COFF_DEFAULT_LONG_SECTION_NAMES}, which is + used in the backends to initialise the backend data structure fields + appropriately; see the comments for further detail. + +SUBSUBSECTION Bit twiddling Each flavour of coff supported in BFD has its own header file @@ -310,6 +364,40 @@ CODE_FRAGMENT #define DOT_DEBUG ".debug" #define GNU_LINKONCE_WI ".gnu.linkonce.wi." +#if defined (COFF_LONG_SECTION_NAMES) +/* Needed to expand the inputs to BLANKOR1TOODD. */ +#define COFFLONGSECTIONCATHELPER(x,y) x ## y +/* If the input macro Y is blank or '1', return an odd number; if it is + '0', return an even number. Result undefined in all other cases. */ +#define BLANKOR1TOODD(y) COFFLONGSECTIONCATHELPER(1,y) +/* Defined to numerical 0 or 1 according to whether generation of long + section names is disabled or enabled by default. */ +#define COFF_ENABLE_LONG_SECTION_NAMES (BLANKOR1TOODD(COFF_LONG_SECTION_NAMES) & 1) +/* Where long section names are supported, we allow them to be enabled + and disabled at runtime, so select an appropriate hook function for + _bfd_coff_set_long_section_names. */ +#define COFF_LONG_SECTION_NAMES_SETTER bfd_coff_set_long_section_names_allowed +#else /* !defined (COFF_LONG_SECTION_NAMES) */ +/* If long section names are not supported, this stub disallows any + attempt to enable them at run-time. */ +#define COFF_LONG_SECTION_NAMES_SETTER bfd_coff_set_long_section_names_disallowed +#endif /* defined (COFF_LONG_SECTION_NAMES) */ + +/* Define a macro that can be used to initialise both the fields relating + to long section names in the backend data struct simultaneously. */ +#if COFF_ENABLE_LONG_SECTION_NAMES +#define COFF_DEFAULT_LONG_SECTION_NAMES (TRUE), COFF_LONG_SECTION_NAMES_SETTER +#else /* !COFF_ENABLE_LONG_SECTION_NAMES */ +#define COFF_DEFAULT_LONG_SECTION_NAMES (FALSE), COFF_LONG_SECTION_NAMES_SETTER +#endif /* COFF_ENABLE_LONG_SECTION_NAMES */ + +#if defined (COFF_LONG_SECTION_NAMES) +static bfd_boolean bfd_coff_set_long_section_names_allowed + (bfd *, int); +#else /* !defined (COFF_LONG_SECTION_NAMES) */ +static bfd_boolean bfd_coff_set_long_section_names_disallowed + (bfd *, int); +#endif /* defined (COFF_LONG_SECTION_NAMES) */ static long sec_to_styp_flags (const char *, flagword); static bfd_boolean styp_to_sec_flags @@ -372,6 +460,23 @@ static bfd_boolean ticoff1_bad_format_hook /* void warning(); */ +#if defined (COFF_LONG_SECTION_NAMES) +static bfd_boolean +bfd_coff_set_long_section_names_allowed (bfd *abfd, int enable) +{ + coff_backend_info (abfd)->_bfd_coff_long_section_names = enable; + return TRUE; +} +#else /* !defined (COFF_LONG_SECTION_NAMES) */ +static bfd_boolean +bfd_coff_set_long_section_names_disallowed (bfd *abfd, int enable) +{ + (void) abfd; + (void) enable; + return FALSE; +} +#endif /* defined (COFF_LONG_SECTION_NAMES) */ + /* Return a word with STYP_* (scnhdr.s_flags) flags set to represent the incoming SEC_* flags. The inverse of this function is styp_to_sec_flags(). NOTE: If you add to/change this routine, you @@ -1214,7 +1319,11 @@ Special entry points for gdb to swap in coff symbol table parts: . unsigned int _bfd_linesz; . unsigned int _bfd_filnmlen; . bfd_boolean _bfd_coff_long_filenames; +. . bfd_boolean _bfd_coff_long_section_names; +. bfd_boolean (*_bfd_coff_set_long_section_names) +. (bfd *, int); +. . unsigned int _bfd_coff_default_section_alignment_power; . bfd_boolean _bfd_coff_force_symnames_in_strings; . unsigned int _bfd_coff_debug_string_prefix_length; @@ -1351,6 +1460,8 @@ Special entry points for gdb to swap in coff symbol table parts: . (coff_backend_info (abfd)->_bfd_coff_long_filenames) .#define bfd_coff_long_section_names(abfd) \ . (coff_backend_info (abfd)->_bfd_coff_long_section_names) +.#define bfd_coff_set_long_section_names(abfd, enable) \ +. ((coff_backend_info (abfd)->_bfd_coff_set_long_section_names) (abfd, enable)) .#define bfd_coff_default_section_alignment_power(abfd) \ . (coff_backend_info (abfd)->_bfd_coff_default_section_alignment_power) .#define bfd_coff_swap_filehdr_in(abfd, i,o) \ @@ -3511,18 +3622,40 @@ coff_write_object_contents (bfd * abfd) #ifdef COFF_LONG_SECTION_NAMES /* Handle long section names as in PE. This must be compatible with the code in coff_write_symbols and _bfd_coff_final_link. */ - { - size_t len; + if (bfd_coff_long_section_names (abfd)) + { + size_t len; - len = strlen (current->name); - if (len > SCNNMLEN) - { - memset (section.s_name, 0, SCNNMLEN); - sprintf (section.s_name, "/%lu", (unsigned long) string_size); - string_size += len + 1; - long_section_names = TRUE; - } - } + len = strlen (current->name); + if (len > SCNNMLEN) + { + /* The s_name field is defined to be NUL-padded but need not be hooks/post-receive -- Repository for Project Archer.