From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5932 invoked by alias); 4 Sep 2012 12:13:19 -0000 Mailing-List: contact archer-commits-help@sourceware.org; run by ezmlm Sender: Precedence: bulk List-Post: List-Help: List-Subscribe: Received: (qmail 5876 invoked by uid 9514); 4 Sep 2012 12:13:14 -0000 Date: Tue, 04 Sep 2012 12:13:00 -0000 Message-ID: <20120904121313.5861.qmail@sourceware.org> From: pmuldoon@sourceware.org To: archer-commits@sourceware.org Subject: [SCM] archer-pmuldoon-python-backtrace: Merge remote-tracking branch 'gdb/master' into archer-pmuldoon-python-backtrace X-Git-Refname: refs/heads/archer-pmuldoon-python-backtrace X-Git-Reftype: branch X-Git-Oldrev: 88cfaa95b88070ff1a1514b5340262084d36fe68 X-Git-Newrev: e0f2184cc6cc333e8e5eadb6646f02e651c02bd9 X-SW-Source: 2012-q3/txt/msg00035.txt.bz2 List-Id: The branch, archer-pmuldoon-python-backtrace has been updated via e0f2184cc6cc333e8e5eadb6646f02e651c02bd9 (commit) via c0887f46d6b113e0c071e46c4e65fe636826eb71 (commit) via a44518e348ff53b72bb0411387ce19d7cad1e075 (commit) via 3806871900a3242c3e778b9d9a520efc2d51aba9 (commit) via 9e83e8776665b0c67b6cd40cd643c6be23484a82 (commit) via 3051e95635c4068b90a6da5a68fd8dcce2409597 (commit) via 5efb7ad002be63d9b2e7173461b89c5e0a578fc1 (commit) via 66f7499100532e14d0a4a534ad1d9c6bb9c55429 (commit) via 5309191f4d804dd91caaff1b8da91127db0c21a0 (commit) via 97ebed829f6907553eaa96944e1bcdb08899d3b4 (commit) via a6033018ace08a9c3e9b674c551b473f0167b592 (commit) via ad1305f111b8e618f0b92d3393592d0960d46cc6 (commit) via fc2564fa5c130576fa8b4777a3c2e3ca08e8a964 (commit) via ac5448b918f30c3520e66561b0f4f7d9f93df189 (commit) via c1ce427fb58e47e852daf97564888b104a5a737a (commit) via fecc5be2895ffb1a6e2c9009488a237c9f0f123b (commit) via baaf7f122ba7c1c63783dd64098e9d7eddd1863a (commit) via 99ffe49dadcbc3cc3df01f5ce7065ae92f261e7c (commit) via 1622ea9a5a5a8fc4a9d308631b6854d135d7cc38 (commit) via 24f532258d2e1e5a0218bd8d29371f9ae1a0c903 (commit) via 4bde8440e186c35f59fb1d87f78baeb013ebefb8 (commit) from 88cfaa95b88070ff1a1514b5340262084d36fe68 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email. - Log ----------------------------------------------------------------- commit e0f2184cc6cc333e8e5eadb6646f02e651c02bd9 Merge: 88cfaa9 c0887f4 Author: Phil Muldoon Date: Tue Sep 4 13:03:41 2012 +0100 Merge remote-tracking branch 'gdb/master' into archer-pmuldoon-python-backtrace Conflicts: gdb/mi/mi-cmds.c commit c0887f46d6b113e0c071e46c4e65fe636826eb71 Author: Andreas Krebbel Date: Mon Sep 3 12:03:46 2012 +0000 2012-09-03 Andreas Krebbel * elf32-s390.c (elf_s390_relocate_section): Handle PLTOFF for local and global ifunc symbols. * elf64-s390.c (elf_s390_relocate_section): Likewise. commit a44518e348ff53b72bb0411387ce19d7cad1e075 Author: Nick Clifton Date: Mon Sep 3 10:13:11 2012 +0000 PR sim/14540 * armsupp.c (ARMul_MRC): Return 0 if access to the MRC instruction is denied. commit 3806871900a3242c3e778b9d9a520efc2d51aba9 Author: Alan Modra Date: Mon Sep 3 00:00:04 2012 +0000 daily update commit 9e83e8776665b0c67b6cd40cd643c6be23484a82 Author: gdbadmin Date: Mon Sep 3 00:00:03 2012 +0000 *** empty log message *** commit 3051e95635c4068b90a6da5a68fd8dcce2409597 Author: khooyp Date: Sun Sep 2 22:57:41 2012 +0000 2012-09-02 Khoo Yit Phang Do not enable -lmcheck by default when Python is enabled with threading support. * configure.ac: (python_has_threads) New variable, by testing if WITH_THREAD is defined in Python.h. Move --enable-lmcheck after --with-python. Do not enable -lmcheck by default if python_has_threads=yes. Warn if --enable-lmcheck and python_has_threads=yes. * configure: Regenerate. commit 5efb7ad002be63d9b2e7173461b89c5e0a578fc1 Author: H.J. Lu Date: Sun Sep 2 12:17:24 2012 +0000 Add hdynamic to elf_link_hash_table for _DYNAMIC * elf-bfd.h (elf_link_hash_table): Add hdynamic for the _DYNAMIC symbol. * elflink.c (_bfd_elf_link_create_dynamic_sections): Set hdynamic. * elf-m10300.c (_bfd_mn10300_elf_finish_dynamic_symbol): Check hdynamic instead of "_DYNAMIC". * elf32-arm.c (elf32_arm_finish_dynamic_symbol): Likewise. * elf32-cr16.c (elf32_arm_finish_dynamic_symbol): Likewise. * elf32-cris.c (elf_cris_finish_dynamic_symbol): Likewise. * elf32-hppa.c (elf32_hppa_finish_dynamic_symbol): Likewise. * elf32-i386.c (elf_i386_convert_mov_to_lea): Likewise. * elf32-lm32.c (lm32_elf_finish_dynamic_symbol): Likewise. * elf32-m32r.c (m32r_elf_finish_dynamic_symbol): Likewise. * elf32-s390.c (elf_s390_finish_dynamic_symbol): Likewise. * elf32-sh.c (sh_elf_finish_dynamic_symbol): Likewise. * elf32-tic6x.c (elf32_tic6x_finish_dynamic_symbol): Likewise. * elf32-tilepro.c (tilepro_elf_finish_dynamic_symbol): Likewise. * elf32-vax.c (elf_vax_finish_dynamic_symbol): Likewise. * elf32-xtensa.c (elf_xtensa_finish_dynamic_symbol): Likewise. * elf64-aarch64.c elf64_aarch64_finish_dynamic_symbol(): Likewise. * elf64-alpha.c (elf64_alpha_finish_dynamic_symbol): Likewise. * elf64-ia64-vms.c (elf64_ia64_finish_dynamic_symbol): Likewise. * elf64-s390.c (elf_s390_finish_dynamic_symbol): Likewise. * elf64-sh64.c (sh64_elf64_finish_dynamic_symbol): Likewise. * elf64-x86-64.c (elf_x86_64_convert_mov_to_lea): Likewise. * elfnn-ia64.c (elfNN_ia64_finish_dynamic_symbol): Likewise. * elfxx-mips.c (_bfd_mips_elf_finish_dynamic_symbol): Likewise. * elfxx-sparc.c (_bfd_sparc_elf_finish_dynamic_symbol): Likewise. * elfxx-tilegx.c (tilegx_elf_finish_dynamic_symbol): Likewise. * elf32-microblaze.c (microblaze_elf_finish_dynamic_symbol): Check hdynamic, hgot, hplt instead of _DYNAMIC, _GLOBAL_OFFSET_TABLE_, _PROCEDURE_LINKAGE_TABLE_. * elf32-score.c (s3_bfd_score_elf_finish_dynamic_symbol): Likewise. * elf32-score7.c (s7_bfd_score_elf_finish_dynamic_symbol): Likewise. commit 66f7499100532e14d0a4a534ad1d9c6bb9c55429 Author: gdbadmin Date: Sun Sep 2 00:00:32 2012 +0000 *** empty log message *** commit 5309191f4d804dd91caaff1b8da91127db0c21a0 Author: Alan Modra Date: Sun Sep 2 00:00:04 2012 +0000 daily update commit 97ebed829f6907553eaa96944e1bcdb08899d3b4 Author: khooyp Date: Sat Sep 1 03:14:15 2012 +0000 2012-08-30 Khoo Yit Phang * MAINTAINERS (Write After Approval): Add "Khoo Yit Phang". commit a6033018ace08a9c3e9b674c551b473f0167b592 Author: H.J. Lu Date: Sat Sep 1 02:50:10 2012 +0000 Don't optimize relocation against _DYNAMIC bfd/ * elf32-i386.c (elf_i386_convert_mov_to_lea): Don't optimize _DYNAMIC. * elf64-x86-64.c (elf_x86_64_convert_mov_to_lea): Likewise. ld/testsuite/ * ld-i386/i386.exp: Run mov1a, mov1b. * ld-x86-64/x86-64.exp: Run mov1a, mov1b, mov1c, mov1d. * ld-i386/mov1.s: New file. * ld-i386/mov1a.d: Likewise. * ld-i386/mov1b.d: Likewise. * ld-x86-64/mov1.s: Likewise. * ld-x86-64/mov1a.d: Likewise. * ld-x86-64/mov1b.d: Likewise. * ld-x86-64/mov1c.d: Likewise. * ld-x86-64/mov1d.d: Likewise. commit ad1305f111b8e618f0b92d3393592d0960d46cc6 Author: gdbadmin Date: Sat Sep 1 00:00:33 2012 +0000 *** empty log message *** commit fc2564fa5c130576fa8b4777a3c2e3ca08e8a964 Author: Alan Modra Date: Sat Sep 1 00:00:05 2012 +0000 daily update commit ac5448b918f30c3520e66561b0f4f7d9f93df189 Author: H.J. Lu Date: Fri Aug 31 20:41:40 2012 +0000 Convert mov to lea in size_dynamic_sections bfd/ * elf32-i386.c (elf_i386_convert_mov_to_lea): New. (elf_i386_size_dynamic_sections): Use it on input sections. (elf_i386_relocate_section): Don't convert "mov foo@GOT(%reg), %reg" to "lea foo@GOTOFF(%reg), %reg" for local symbols here. * elf64-x86-64.c (elf_x86_64_convert_mov_to_lea): New. (elf_x86_64_size_dynamic_sections): Use it on input sections. (elf_x86_64_relocate_section): Don't convert "mov foo@GOTPCREL(%rip), %reg" to "lea foo@GOTOFF(%reg), %reg" for local symbols. ld/testsuite/ * ld-i386/i386.exp: Run lea1d, lea1f, lea1f. * ld-x86-64/x86-64.exp: Run lea1g, lea1h, lea1i, lea1j, lea1k, lea1l. * ld-ifunc/ifunc-13-i386.d: Remove R_386_RELATIVE entry. * ld-i386/lea1d.d: New file. * ld-i386/lea1e.d: Likewise. * ld-i386/lea1f.d: Likewise. * ld-x86-64/lea1g.d: Likewise. * ld-x86-64/lea1h.d: Likewise. * ld-x86-64/lea1i.d: Likewise. * ld-x86-64/lea1j.d: Likewise. * ld-x86-64/lea1k.d: Likewise. * ld-x86-64/lea1l.d: Likewise. commit c1ce427fb58e47e852daf97564888b104a5a737a Author: qiyao Date: Fri Aug 31 08:41:53 2012 +0000 gdb/ * mi/mi-cmds.c (mi_cmds): New macros DEF_MI_CMD_CLI DEF_MI_CMD_MI DEF_MI_CMD_CLI_1 and DEF_MI_CMD_CLI_1. Update some commands. * mi/mi-cmds.h (struct mi_cmd) : New field. * mi/mi-main.c (mi_cmd_execute): Set '*parse->cmd->suppress_notification' to 1. commit fecc5be2895ffb1a6e2c9009488a237c9f0f123b Author: qiyao Date: Fri Aug 31 08:30:20 2012 +0000 gdb/ * mi/mi-cmds.c (mi_cmds): Add 'static'. commit baaf7f122ba7c1c63783dd64098e9d7eddd1863a Author: H.J. Lu Date: Fri Aug 31 04:26:16 2012 +0000 Convert mov to lea for loading local function address bfd/ * elf32-i386.c (elf_i386_relocate_section): Convert "mov foo@GOT(%reg), %reg" to "lea foo@GOTOFF(%reg), %reg" for local symbols. * elf64-x86-64.c (elf_x86_64_relocate_section): Convert "mov foo@GOTPCREL(%rip), %reg" to "lea foo(%rip), %reg" for local symbols. ld/testsuite/ * ld-i386/i386.exp: Run lea1a, lea1b, lea1c. * ld-x86-64/x86-64.exp: Run lea1a, lea1b, lea1c, lea1d, lea1e, lea1f. * ld-i386/lea1.s: New file. * ld-i386/lea1a.d: Likewise. * ld-i386/lea1b.d: Likewise. * ld-i386/lea1c.d: Likewise. * ld-x86-64/lea1.s: Likewise. * ld-x86-64/lea1a.d: Likewise. * ld-x86-64/lea1b.d: Likewise. * ld-x86-64/lea1c.d: Likewise. * ld-x86-64/lea1d.d: Likewise. * ld-x86-64/lea1e.d: Likewise. * ld-x86-64/lea1f.d: Likewise. commit 99ffe49dadcbc3cc3df01f5ce7065ae92f261e7c Author: Alan Modra Date: Fri Aug 31 02:42:56 2012 +0000 PR ld/14464 * elf64-ppc.c (ppc64_elf_relocate_section): Map symbols defined by a linker script in .opd to corresponding input .opd section. commit 1622ea9a5a5a8fc4a9d308631b6854d135d7cc38 Author: Alan Modra Date: Fri Aug 31 00:00:04 2012 +0000 daily update commit 24f532258d2e1e5a0218bd8d29371f9ae1a0c903 Author: gdbadmin Date: Fri Aug 31 00:00:02 2012 +0000 *** empty log message *** commit 4bde8440e186c35f59fb1d87f78baeb013ebefb8 Author: khooyp Date: Thu Aug 30 18:59:53 2012 +0000 Add "Khoo Yit Phang" to gdb/MAINTAINERS. ----------------------------------------------------------------------- Summary of changes: bfd/ChangeLog | 82 +++++++++++++++++ bfd/elf-bfd.h | 3 + bfd/elf-m10300.c | 2 +- bfd/elf32-arm.c | 2 +- bfd/elf32-cr16.c | 2 +- bfd/elf32-cris.c | 2 +- bfd/elf32-hppa.c | 4 +- bfd/elf32-i386.c | 149 ++++++++++++++++++++++++++++++ bfd/elf32-lm32.c | 3 +- bfd/elf32-m32r.c | 3 +- bfd/elf32-microblaze.c | 6 +- bfd/elf32-s390.c | 10 ++- bfd/elf32-score.c | 3 +- bfd/elf32-score7.c | 3 +- bfd/elf32-sh.c | 2 +- bfd/elf32-tic6x.c | 2 +- bfd/elf32-tilepro.c | 2 +- bfd/elf32-vax.c | 2 +- bfd/elf32-xtensa.c | 2 +- bfd/elf64-aarch64.c | 2 +- bfd/elf64-alpha.c | 2 +- bfd/elf64-ia64-vms.c | 2 +- bfd/elf64-ppc.c | 27 ++++++ bfd/elf64-s390.c | 13 ++- bfd/elf64-sh64.c | 2 +- bfd/elf64-x86-64.c | 150 ++++++++++++++++++++++++++++++ bfd/elflink.c | 5 +- bfd/elfnn-ia64.c | 2 +- bfd/elfxx-mips.c | 2 +- bfd/elfxx-sparc.c | 2 +- bfd/elfxx-tilegx.c | 2 +- bfd/version.h | 2 +- gdb/ChangeLog | 28 ++++++ gdb/MAINTAINERS | 1 + gdb/configure | 163 ++++++++++++++++++++------------- gdb/configure.ac | 69 ++++++++++----- gdb/mi/mi-cmds.c | 237 ++++++++++++++++++++++++++---------------------- gdb/mi/mi-cmds.h | 6 + gdb/mi/mi-main.c | 13 +-- gdb/version.in | 2 +- sim/arm/ChangeLog | 6 + sim/arm/armsupp.c | 2 +- 42 files changed, 782 insertions(+), 242 deletions(-) First 500 lines of diff: diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 3ec6b2f..189d52d 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,85 @@ +2012-09-03 Andreas Krebbel + + * elf32-s390.c (elf_s390_relocate_section): Handle PLTOFF for + local and global ifunc symbols. + * elf64-s390.c (elf_s390_relocate_section): Likewise. + +2012-09-02 H.J. Lu + + * elf-bfd.h (elf_link_hash_table): Add hdynamic for the + _DYNAMIC symbol. + + * elflink.c (_bfd_elf_link_create_dynamic_sections): Set + hdynamic. + + * elf-m10300.c (_bfd_mn10300_elf_finish_dynamic_symbol): Check + hdynamic instead of "_DYNAMIC". + * elf32-arm.c (elf32_arm_finish_dynamic_symbol): Likewise. + * elf32-cr16.c (elf32_arm_finish_dynamic_symbol): Likewise. + * elf32-cris.c (elf_cris_finish_dynamic_symbol): Likewise. + * elf32-hppa.c (elf32_hppa_finish_dynamic_symbol): Likewise. + * elf32-i386.c (elf_i386_convert_mov_to_lea): Likewise. + * elf32-lm32.c (lm32_elf_finish_dynamic_symbol): Likewise. + * elf32-m32r.c (m32r_elf_finish_dynamic_symbol): Likewise. + * elf32-s390.c (elf_s390_finish_dynamic_symbol): Likewise. + * elf32-sh.c (sh_elf_finish_dynamic_symbol): Likewise. + * elf32-tic6x.c (elf32_tic6x_finish_dynamic_symbol): Likewise. + * elf32-tilepro.c (tilepro_elf_finish_dynamic_symbol): Likewise. + * elf32-vax.c (elf_vax_finish_dynamic_symbol): Likewise. + * elf32-xtensa.c (elf_xtensa_finish_dynamic_symbol): Likewise. + * elf64-aarch64.c elf64_aarch64_finish_dynamic_symbol(): Likewise. + * elf64-alpha.c (elf64_alpha_finish_dynamic_symbol): Likewise. + * elf64-ia64-vms.c (elf64_ia64_finish_dynamic_symbol): Likewise. + * elf64-s390.c (elf_s390_finish_dynamic_symbol): Likewise. + * elf64-sh64.c (sh64_elf64_finish_dynamic_symbol): Likewise. + * elf64-x86-64.c (elf_x86_64_convert_mov_to_lea): Likewise. + * elfnn-ia64.c (elfNN_ia64_finish_dynamic_symbol): Likewise. + * elfxx-mips.c (_bfd_mips_elf_finish_dynamic_symbol): Likewise. + * elfxx-sparc.c (_bfd_sparc_elf_finish_dynamic_symbol): Likewise. + * elfxx-tilegx.c (tilegx_elf_finish_dynamic_symbol): Likewise. + + * elf32-microblaze.c (microblaze_elf_finish_dynamic_symbol): Check + hdynamic, hgot, hplt instead of _DYNAMIC, _GLOBAL_OFFSET_TABLE_, + _PROCEDURE_LINKAGE_TABLE_. + * elf32-score.c (s3_bfd_score_elf_finish_dynamic_symbol): Likewise. + * elf32-score7.c (s7_bfd_score_elf_finish_dynamic_symbol): Likewise. + +2012-08-31 H.J. Lu + + * elf32-i386.c (elf_i386_convert_mov_to_lea): Don't optimize + _DYNAMIC. + * elf64-x86-64.c (elf_x86_64_convert_mov_to_lea): Likewise. + +2012-08-31 H.J. Lu + + * elf32-i386.c (elf_i386_convert_mov_to_lea): New. + (elf_i386_size_dynamic_sections): Use it on input sections. + (elf_i386_relocate_section): Don't convert + "mov foo@GOT(%reg), %reg" to "lea foo@GOTOFF(%reg), %reg" + for local symbols here. + + * elf64-x86-64.c (elf_x86_64_convert_mov_to_lea): New. + (elf_x86_64_size_dynamic_sections): Use it on input sections. + (elf_x86_64_relocate_section): Don't convert + "mov foo@GOTPCREL(%rip), %reg" to "lea foo(%rip), %reg" + for local symbols here. + +2012-08-30 H.J. Lu + + * elf32-i386.c (elf_i386_relocate_section): Convert + "mov foo@GOT(%reg), %reg" to "lea foo@GOTOFF(%reg), %reg" + for local symbols. + + * elf64-x86-64.c (elf_x86_64_relocate_section): Convert + "mov foo@GOTPCREL(%rip), %reg" to "lea foo(%rip), %reg" + for local symbols. + +2012-08-31 Alan Modra + + PR ld/14464 + * elf64-ppc.c (ppc64_elf_relocate_section): Map symbols defined + by a linker script in .opd to corresponding input .opd section. + 2012-08-28 Maciej W. Rozycki * elf32-ppc.c (ppc_elf_relocate_section): Assert that dynindx is diff --git a/bfd/elf-bfd.h b/bfd/elf-bfd.h index e57528e..1225036 100644 --- a/bfd/elf-bfd.h +++ b/bfd/elf-bfd.h @@ -498,6 +498,9 @@ struct elf_link_hash_table /* The _PROCEDURE_LINKAGE_TABLE_ symbol. */ struct elf_link_hash_entry *hplt; + /* The _DYNAMIC symbol. */ + struct elf_link_hash_entry *hdynamic; + /* A pointer to information used to merge SEC_MERGE sections. */ void *merge_info; diff --git a/bfd/elf-m10300.c b/bfd/elf-m10300.c index 709ea16..b44a4b4 100644 --- a/bfd/elf-m10300.c +++ b/bfd/elf-m10300.c @@ -5395,7 +5395,7 @@ _bfd_mn10300_elf_finish_dynamic_symbol (bfd * output_bfd, } /* Mark _DYNAMIC and _GLOBAL_OFFSET_TABLE_ as absolute. */ - if (streq (h->root.root.string, "_DYNAMIC") + if (h == elf_hash_table (info)->hdynamic || h == elf_hash_table (info)->hgot) sym->st_shndx = SHN_ABS; diff --git a/bfd/elf32-arm.c b/bfd/elf32-arm.c index a287fbb..633bb64 100644 --- a/bfd/elf32-arm.c +++ b/bfd/elf32-arm.c @@ -14003,7 +14003,7 @@ elf32_arm_finish_dynamic_symbol (bfd * output_bfd, /* Mark _DYNAMIC and _GLOBAL_OFFSET_TABLE_ as absolute. On VxWorks, the _GLOBAL_OFFSET_TABLE_ symbol is not absolute: it is relative to the ".got" section. */ - if (strcmp (h->root.root.string, "_DYNAMIC") == 0 + if (h == htab->root.hdynamic || (!htab->vxworks_p && h == htab->root.hgot)) sym->st_shndx = SHN_ABS; diff --git a/bfd/elf32-cr16.c b/bfd/elf32-cr16.c index 97fa569..46769f5 100644 --- a/bfd/elf32-cr16.c +++ b/bfd/elf32-cr16.c @@ -2698,7 +2698,7 @@ _bfd_cr16_elf_finish_dynamic_symbol (bfd * output_bfd, } /* Mark _DYNAMIC and _GLOBAL_OFFSET_TABLE_ as absolute. */ - if (strcmp (h->root.root.string, "_DYNAMIC") == 0 + if (h == elf_hash_table (info)->hdynamic || h == elf_hash_table (info)->hgot) sym->st_shndx = SHN_ABS; diff --git a/bfd/elf32-cris.c b/bfd/elf32-cris.c index c9316ee..33afc63 100644 --- a/bfd/elf32-cris.c +++ b/bfd/elf32-cris.c @@ -2288,7 +2288,7 @@ elf_cris_finish_dynamic_symbol (bfd *output_bfd, } /* Mark _DYNAMIC and _GLOBAL_OFFSET_TABLE_ as absolute. */ - if (strcmp (h->root.root.string, "_DYNAMIC") == 0 + if (h == elf_hash_table (info)->hdynamic || h == elf_hash_table (info)->hgot) sym->st_shndx = SHN_ABS; diff --git a/bfd/elf32-hppa.c b/bfd/elf32-hppa.c index dc3053c..7ec06c7 100644 --- a/bfd/elf32-hppa.c +++ b/bfd/elf32-hppa.c @@ -4442,9 +4442,7 @@ elf32_hppa_finish_dynamic_symbol (bfd *output_bfd, } /* Mark _DYNAMIC and _GLOBAL_OFFSET_TABLE_ as absolute. */ - if (eh_name (eh)[0] == '_' - && (strcmp (eh_name (eh), "_DYNAMIC") == 0 - || eh == htab->etab.hgot)) + if (eh == htab->etab.hdynamic || eh == htab->etab.hgot) { sym->st_shndx = SHN_ABS; } diff --git a/bfd/elf32-i386.c b/bfd/elf32-i386.c index 7d3652d..25e3a33 100644 --- a/bfd/elf32-i386.c +++ b/bfd/elf32-i386.c @@ -2536,6 +2536,152 @@ elf_i386_readonly_dynrelocs (struct elf_link_hash_entry *h, void *inf) return TRUE; } +/* Convert + mov foo@GOT(%reg), %reg + to + lea foo@GOTOFF(%reg), %reg + with the local symbol, foo. */ + +static bfd_boolean +elf_i386_convert_mov_to_lea (bfd *abfd, asection *sec, + struct bfd_link_info *link_info) +{ + Elf_Internal_Shdr *symtab_hdr; + Elf_Internal_Rela *internal_relocs; + Elf_Internal_Rela *irel, *irelend; + bfd_byte *contents; + struct elf_i386_link_hash_table *htab; + bfd_boolean changed_contents; + bfd_boolean changed_relocs; + bfd_signed_vma *local_got_refcounts; + + /* Don't even try to convert non-ELF outputs. */ + if (!is_elf_hash_table (link_info->hash)) + return FALSE; + + /* Nothing to do if there are no codes or no relocations. */ + if ((sec->flags & (SEC_CODE | SEC_RELOC)) != (SEC_CODE | SEC_RELOC) + || sec->reloc_count == 0) + return TRUE; + + symtab_hdr = &elf_tdata (abfd)->symtab_hdr; + + /* Load the relocations for this section. */ + internal_relocs = (_bfd_elf_link_read_relocs + (abfd, sec, NULL, (Elf_Internal_Rela *) NULL, + link_info->keep_memory)); + if (internal_relocs == NULL) + return FALSE; + + htab = elf_i386_hash_table (link_info); + changed_contents = FALSE; + changed_relocs = FALSE; + local_got_refcounts = elf_local_got_refcounts (abfd); + + /* Get the section contents. */ + if (elf_section_data (sec)->this_hdr.contents != NULL) + contents = elf_section_data (sec)->this_hdr.contents; + else + { + if (!bfd_malloc_and_get_section (abfd, sec, &contents)) + goto error_return; + } + + irelend = internal_relocs + sec->reloc_count; + for (irel = internal_relocs; irel < irelend; irel++) + { + unsigned int r_type = ELF32_R_TYPE (irel->r_info); + unsigned int r_symndx = ELF32_R_SYM (irel->r_info); + unsigned int indx; + struct elf_link_hash_entry *h; + + if (r_type != R_386_GOT32) + continue; + + /* Get the symbol referred to by the reloc. */ + if (r_symndx < symtab_hdr->sh_info) + { + Elf_Internal_Sym *isym; + + isym = bfd_sym_from_r_symndx (&htab->sym_cache, + abfd, r_symndx); + + /* STT_GNU_IFUNC must keep R_386_GOT32 relocation. */ + if (ELF_ST_TYPE (isym->st_info) != STT_GNU_IFUNC + && bfd_get_8 (input_bfd, + contents + irel->r_offset - 2) == 0x8b) + { + bfd_put_8 (output_bfd, 0x8d, + contents + irel->r_offset - 2); + irel->r_info = ELF32_R_INFO (r_symndx, R_386_GOTOFF); + if (local_got_refcounts != NULL + && local_got_refcounts[r_symndx] > 0) + local_got_refcounts[r_symndx] -= 1; + changed_contents = TRUE; + changed_relocs = TRUE; + } + continue; + } + + indx = r_symndx - symtab_hdr->sh_info; + h = elf_sym_hashes (abfd)[indx]; + BFD_ASSERT (h != NULL); + + while (h->root.type == bfd_link_hash_indirect + || h->root.type == bfd_link_hash_warning) + h = (struct elf_link_hash_entry *) h->root.u.i.link; + + /* STT_GNU_IFUNC must keep R_386_GOT32 relocation. We also avoid + optimizing _DYNAMIC since ld.so may use its link-time address. */ + if (h->def_regular + && h->type != STT_GNU_IFUNC + && h != htab->elf.hdynamic + && SYMBOL_REFERENCES_LOCAL (link_info, h) + && bfd_get_8 (input_bfd, + contents + irel->r_offset - 2) == 0x8b) + { + bfd_put_8 (output_bfd, 0x8d, + contents + irel->r_offset - 2); + irel->r_info = ELF32_R_INFO (r_symndx, R_386_GOTOFF); + if (h->got.refcount > 0) + h->got.refcount -= 1; + changed_contents = TRUE; + changed_relocs = TRUE; + } + } + + if (contents != NULL + && elf_section_data (sec)->this_hdr.contents != contents) + { + if (!changed_contents && !link_info->keep_memory) + free (contents); + else + { + /* Cache the section contents for elf_link_input_bfd. */ + elf_section_data (sec)->this_hdr.contents = contents; + } + } + + if (elf_section_data (sec)->relocs != internal_relocs) + { + if (!changed_relocs) + free (internal_relocs); + else + elf_section_data (sec)->relocs = internal_relocs; + } + + return TRUE; + + error_return: + if (contents != NULL + && elf_section_data (sec)->this_hdr.contents != contents) + free (contents); + if (internal_relocs != NULL + && elf_section_data (sec)->relocs != internal_relocs) + free (internal_relocs); + return FALSE; +} + /* Set the sizes of the dynamic sections. */ static bfd_boolean @@ -2586,6 +2732,9 @@ elf_i386_size_dynamic_sections (bfd *output_bfd, struct bfd_link_info *info) { struct elf_dyn_relocs *p; + if (!elf_i386_convert_mov_to_lea (ibfd, s, info)) + return FALSE; + for (p = ((struct elf_dyn_relocs *) elf_section_data (s)->local_dynrel); p != NULL; diff --git a/bfd/elf32-lm32.c b/bfd/elf32-lm32.c index 8d530a4..f40536c 100644 --- a/bfd/elf32-lm32.c +++ b/bfd/elf32-lm32.c @@ -1745,8 +1745,7 @@ lm32_elf_finish_dynamic_symbol (bfd *output_bfd, } /* Mark some specially defined symbols as absolute. */ - if (strcmp (h->root.root.string, "_DYNAMIC") == 0 - || h == htab->root.hgot) + if (h == htab->root.hdynamic || h == htab->root.hgot) sym->st_shndx = SHN_ABS; return TRUE; diff --git a/bfd/elf32-m32r.c b/bfd/elf32-m32r.c index e3e3bb0..70ddaab 100644 --- a/bfd/elf32-m32r.c +++ b/bfd/elf32-m32r.c @@ -3295,8 +3295,7 @@ m32r_elf_finish_dynamic_symbol (bfd *output_bfd, } /* Mark some specially defined symbols as absolute. */ - if (strcmp (h->root.root.string, "_DYNAMIC") == 0 - || h == htab->root.hgot) + if (h == htab->root.hdynamic || h == htab->root.hgot) sym->st_shndx = SHN_ABS; return TRUE; diff --git a/bfd/elf32-microblaze.c b/bfd/elf32-microblaze.c index 27b569e..c000424 100644 --- a/bfd/elf32-microblaze.c +++ b/bfd/elf32-microblaze.c @@ -2882,9 +2882,9 @@ microblaze_elf_finish_dynamic_symbol (bfd *output_bfd, } /* Mark some specially defined symbols as absolute. */ - if (strcmp (h->root.root.string, "_DYNAMIC") == 0 - || strcmp (h->root.root.string, "_GLOBAL_OFFSET_TABLE_") == 0 - || strcmp (h->root.root.string, "_PROCEDURE_LINKAGE_TABLE_") == 0) + if (h == htab->elf.hdynamic + || h == htab->elf.hgot + || h == htab->elf.hplt) sym->st_shndx = SHN_ABS; return TRUE; diff --git a/bfd/elf32-s390.c b/bfd/elf32-s390.c index 8d654d5..d6eedfa 100644 --- a/bfd/elf32-s390.c +++ b/bfd/elf32-s390.c @@ -2349,6 +2349,10 @@ elf_s390_relocate_section (bfd *output_bfd, switch (r_type) { + case R_390_PLTOFF16: + case R_390_PLTOFF32: + relocation -= htab->elf.sgot->output_section->vma; + break; case R_390_GOTPLT12: case R_390_GOTPLT16: case R_390_GOTPLT20: @@ -2625,9 +2629,9 @@ elf_s390_relocate_section (bfd *output_bfd, /* For local symbols or if we didn't make a PLT entry for this symbol resolve the symbol directly. */ - if ( h == NULL + if (h == NULL || h->plt.offset == (bfd_vma) -1 - || htab->elf.splt == NULL) + || (htab->elf.splt == NULL && !s390_is_ifunc_symbol_p (h))) { relocation -= htab->elf.sgot->output_section->vma; break; @@ -3703,7 +3707,7 @@ elf_s390_finish_dynamic_symbol (bfd *output_bfd, } /* Mark some specially defined symbols as absolute. */ - if (strcmp (h->root.root.string, "_DYNAMIC") == 0 + if (h == htab->elf.hdynamic || h == htab->elf.hgot || h == htab->elf.hplt) sym->st_shndx = SHN_ABS; diff --git a/bfd/elf32-score.c b/bfd/elf32-score.c index 01a602b..7b16ea2 100644 --- a/bfd/elf32-score.c +++ b/bfd/elf32-score.c @@ -3537,7 +3537,8 @@ s3_bfd_score_elf_finish_dynamic_symbol (bfd *output_bfd, /* Mark _DYNAMIC and _GLOBAL_OFFSET_TABLE_ as absolute. */ name = h->root.root.string; - if (strcmp (name, "_DYNAMIC") == 0 || strcmp (name, "_GLOBAL_OFFSET_TABLE_") == 0) + if (h == elf_hash_table (info)->hdynamic + || h == elf_hash_table (info)->hgot) sym->st_shndx = SHN_ABS; else if (strcmp (name, "_DYNAMIC_LINK") == 0) { diff --git a/bfd/elf32-score7.c b/bfd/elf32-score7.c index 3615a1e..30bfe39 100644 --- a/bfd/elf32-score7.c +++ b/bfd/elf32-score7.c @@ -3345,7 +3345,8 @@ s7_bfd_score_elf_finish_dynamic_symbol (bfd *output_bfd, /* Mark _DYNAMIC and _GLOBAL_OFFSET_TABLE_ as absolute. */ name = h->root.root.string; - if (strcmp (name, "_DYNAMIC") == 0 || strcmp (name, "_GLOBAL_OFFSET_TABLE_") == 0) + if (h == elf_hash_table (info)->hdynamic + || h == elf_hash_table (info)->hgot) sym->st_shndx = SHN_ABS; else if (strcmp (name, "_DYNAMIC_LINK") == 0) { diff --git a/bfd/elf32-sh.c b/bfd/elf32-sh.c index cbd00aa..df4affd 100644 --- a/bfd/elf32-sh.c +++ b/bfd/elf32-sh.c @@ -7157,7 +7157,7 @@ sh_elf_finish_dynamic_symbol (bfd *output_bfd, struct bfd_link_info *info, /* Mark _DYNAMIC and _GLOBAL_OFFSET_TABLE_ as absolute. On VxWorks, _GLOBAL_OFFSET_TABLE_ is not absolute: it is relative to the ".got" section. */ - if (strcmp (h->root.root.string, "_DYNAMIC") == 0 + if (h == htab->root.hdynamic || (!htab->vxworks_p && h == htab->root.hgot)) sym->st_shndx = SHN_ABS; diff --git a/bfd/elf32-tic6x.c b/bfd/elf32-tic6x.c index dbe2c16..ef0d155 100644 --- a/bfd/elf32-tic6x.c +++ b/bfd/elf32-tic6x.c @@ -1903,7 +1903,7 @@ elf32_tic6x_finish_dynamic_symbol (bfd * output_bfd, } /* Mark _DYNAMIC and _GLOBAL_OFFSET_TABLE_ as absolute. */ - if (strcmp (h->root.root.string, "_DYNAMIC") == 0 + if (h == elf_hash_table (info)->hdynamic || h == elf_hash_table (info)->hgot) sym->st_shndx = SHN_ABS; diff --git a/bfd/elf32-tilepro.c b/bfd/elf32-tilepro.c index aa2dfd6..cbb65c6 100644 --- a/bfd/elf32-tilepro.c +++ b/bfd/elf32-tilepro.c @@ -3787,7 +3787,7 @@ tilepro_elf_finish_dynamic_symbol (bfd *output_bfd, } /* Mark some specially defined symbols as absolute. */ - if (strcmp (h->root.root.string, "_DYNAMIC") == 0 + if (h == htab->elf.hdynamic || (h == htab->elf.hgot || h == htab->elf.hplt)) sym->st_shndx = SHN_ABS; diff --git a/bfd/elf32-vax.c b/bfd/elf32-vax.c index 6258d96..3fbc289 100644 --- a/bfd/elf32-vax.c +++ b/bfd/elf32-vax.c @@ -1908,7 +1908,7 @@ elf_vax_finish_dynamic_symbol (bfd *output_bfd, struct bfd_link_info *info, } /* Mark _DYNAMIC and _GLOBAL_OFFSET_TABLE_ as absolute. */ - if (strcmp (h->root.root.string, "_DYNAMIC") == 0 + if (h == elf_hash_table (info)->hdynamic || h == elf_hash_table (info)->hgot) sym->st_shndx = SHN_ABS; diff --git a/bfd/elf32-xtensa.c b/bfd/elf32-xtensa.c hooks/post-receive -- Repository for Project Archer.