This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
PATCH: PR 1025: binutils failed to build gcc 4.0.1 20050619
- From: "H. J. Lu" <hjl at lucon dot org>
- To: binutils at sources dot redhat dot com
- Cc: gcc at gcc dot gnu dot org
- Date: Mon, 20 Jun 2005 11:15:33 -0700
- Subject: PATCH: PR 1025: binutils failed to build gcc 4.0.1 20050619
I checked in the following patch to fix other targets.
H.J.
----
2005-06-20 H.J. Lu <hongjiu.lu@intel.com>
PR 1025
* elf-m10300.c (mn10300_elf_check_relocs): Handle indirect
symbol.
* elf32-arm.c (elf32_arm_check_relocs): Likewise.
* elf32-avr.c (elf32_avr_check_relocs): Likewise.
* elf32-cris.c (cris_elf_check_relocs): Likewise.
* elf32-d10v.c (elf32_d10v_check_relocs): Likewise.
* elf32-dlx.c (elf32_dlx_check_relocs): Likewise.
* elf32-fr30.c (fr30_elf_check_relocs): Likewise.
* elf32-frv.c (elf32_frv_check_relocs): Likewise.
* elf32-i370.c (i370_elf_check_relocs): Likewise.
* elf32-iq2000.c (iq2000_elf_check_relocs): Likewise.
* elf32-m32r.c (m32r_elf_check_relocs): Likewise.
* elf32-m68hc1x.c (elf32_m68hc11_check_relocs): Likewise.
* elf32-m68k.c (elf_m68k_check_relocs): Likewise.
* elf32-mcore.c (mcore_elf_check_relocs): Likewise.
* elf32-ms1.c (ms1_elf_check_relocs): Likewise.
* elf32-msp430.c (elf32_msp430_check_relocs): Likewise.
* elf32-openrisc.c (openrisc_elf_check_relocs): Likewise.
* elf32-ppc.c (ppc_elf_check_relocs): Likewise.
* elf32-s390.c (elf_s390_check_relocs): Likewise.
* elf32-sh.c (sh_elf_check_relocs): Likewise.
* elf32-v850.c (v850_elf_check_relocs): Likewise.
* elf32-vax.c (elf_vax_check_relocs): Likewise.
* elf64-mmix.c (mmix_elf_check_relocs): Likewise.
* elf64-ppc.c (ppc64_elf_check_relocs): Likewise.
* elf64-s390.c (elf_s390_check_relocs): Likewise.
* elf64-sh64.c (sh_elf64_check_relocs): Likewise.
* elfxx-mips.c (_bfd_mips_elf_check_relocs): Likewise.
* elfxx-sparc.c (_bfd_sparc_elf_check_relocs): Likewise.
--- bfd/elf-m10300.c.got 2005-05-07 06:58:08.000000000 -0700
+++ bfd/elf-m10300.c 2005-06-20 10:55:33.000000000 -0700
@@ -717,7 +717,12 @@ mn10300_elf_check_relocs (abfd, info, se
if (r_symndx < symtab_hdr->sh_info)
h = NULL;
else
- h = sym_hashes[r_symndx - symtab_hdr->sh_info];
+ {
+ h = sym_hashes[r_symndx - symtab_hdr->sh_info];
+ 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;
+ }
/* Some relocs require a global offset table. */
if (dynobj == NULL)
--- bfd/elf32-arm.c.got 2005-06-02 16:02:13.000000000 -0700
+++ bfd/elf32-arm.c 2005-06-20 10:42:56.000000000 -0700
@@ -4912,7 +4912,12 @@ elf32_arm_check_relocs (bfd *abfd, struc
if (r_symndx < symtab_hdr->sh_info)
h = NULL;
else
- h = sym_hashes[r_symndx - symtab_hdr->sh_info];
+ {
+ h = sym_hashes[r_symndx - symtab_hdr->sh_info];
+ 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;
+ }
eh = (struct elf32_arm_link_hash_entry *) h;
--- bfd/elf32-avr.c.got 2005-05-04 11:17:34.000000000 -0700
+++ bfd/elf32-avr.c 2005-06-20 10:43:42.000000000 -0700
@@ -523,7 +523,12 @@ elf32_avr_check_relocs (abfd, info, sec,
if (r_symndx < symtab_hdr->sh_info)
h = NULL;
else
- h = sym_hashes[r_symndx - symtab_hdr->sh_info];
+ {
+ h = sym_hashes[r_symndx - symtab_hdr->sh_info];
+ 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;
+ }
}
return TRUE;
--- bfd/elf32-cris.c.got 2005-05-05 07:44:34.000000000 -0700
+++ bfd/elf32-cris.c 2005-06-20 10:44:03.000000000 -0700
@@ -2479,7 +2479,12 @@ cris_elf_check_relocs (abfd, info, sec,
if (r_symndx < symtab_hdr->sh_info)
h = NULL;
else
- h = sym_hashes[r_symndx - symtab_hdr->sh_info];
+ {
+ h = sym_hashes[r_symndx - symtab_hdr->sh_info];
+ 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;
+ }
r_type = ELF32_R_TYPE (rel->r_info);
--- bfd/elf32-d10v.c.got 2005-05-04 11:17:34.000000000 -0700
+++ bfd/elf32-d10v.c 2005-06-20 10:44:17.000000000 -0700
@@ -327,7 +327,12 @@ elf32_d10v_check_relocs (abfd, info, sec
if (r_symndx < symtab_hdr->sh_info)
h = NULL;
else
- h = sym_hashes[r_symndx - symtab_hdr->sh_info];
+ {
+ h = sym_hashes[r_symndx - symtab_hdr->sh_info];
+ 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;
+ }
switch (ELF32_R_TYPE (rel->r_info))
{
--- bfd/elf32-dlx.c.got 2005-05-04 11:17:34.000000000 -0700
+++ bfd/elf32-dlx.c 2005-06-20 10:44:34.000000000 -0700
@@ -477,7 +477,12 @@ elf32_dlx_check_relocs (abfd, info, sec,
if (r_symndx < symtab_hdr->sh_info)
h = NULL;
else
- h = sym_hashes[r_symndx - symtab_hdr->sh_info];
+ {
+ h = sym_hashes[r_symndx - symtab_hdr->sh_info];
+ 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;
+ }
switch (ELF32_R_TYPE (rel->r_info))
{
--- bfd/elf32-fr30.c.got 2005-05-04 11:17:34.000000000 -0700
+++ bfd/elf32-fr30.c 2005-06-20 10:44:51.000000000 -0700
@@ -707,7 +707,12 @@ fr30_elf_check_relocs (abfd, info, sec,
if (r_symndx < symtab_hdr->sh_info)
h = NULL;
else
- h = sym_hashes[r_symndx - symtab_hdr->sh_info];
+ {
+ h = sym_hashes[r_symndx - symtab_hdr->sh_info];
+ 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;
+ }
switch (ELF32_R_TYPE (rel->r_info))
{
--- bfd/elf32-frv.c.got 2005-05-07 06:58:09.000000000 -0700
+++ bfd/elf32-frv.c 2005-06-20 10:45:05.000000000 -0700
@@ -6127,7 +6127,12 @@ elf32_frv_check_relocs (abfd, info, sec,
if (r_symndx < symtab_hdr->sh_info)
h = NULL;
else
- h = sym_hashes[r_symndx - symtab_hdr->sh_info];
+ {
+ h = sym_hashes[r_symndx - symtab_hdr->sh_info];
+ 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;
+ }
switch (ELF32_R_TYPE (rel->r_info))
{
--- bfd/elf32-i370.c.got 2005-05-07 06:58:09.000000000 -0700
+++ bfd/elf32-i370.c 2005-06-20 10:45:27.000000000 -0700
@@ -901,7 +901,12 @@ i370_elf_check_relocs (abfd, info, sec,
if (r_symndx < symtab_hdr->sh_info)
h = NULL;
else
- h = sym_hashes[r_symndx - symtab_hdr->sh_info];
+ {
+ h = sym_hashes[r_symndx - symtab_hdr->sh_info];
+ 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;
+ }
if (info->shared)
{
--- bfd/elf32-iq2000.c.got 2005-05-04 11:17:37.000000000 -0700
+++ bfd/elf32-iq2000.c 2005-06-20 10:45:48.000000000 -0700
@@ -427,7 +427,12 @@ iq2000_elf_check_relocs (bfd *abfd,
if (r_symndx < symtab_hdr->sh_info)
h = NULL;
else
- h = sym_hashes[r_symndx - symtab_hdr->sh_info];
+ {
+ h = sym_hashes[r_symndx - symtab_hdr->sh_info];
+ 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;
+ }
switch (ELF32_R_TYPE (rel->r_info))
{
--- bfd/elf32-m32r.c.got 2005-05-07 06:58:09.000000000 -0700
+++ bfd/elf32-m32r.c 2005-06-20 10:46:00.000000000 -0700
@@ -3947,7 +3947,12 @@ m32r_elf_check_relocs (abfd, info, sec,
if (r_symndx < symtab_hdr->sh_info)
h = NULL;
else
- h = sym_hashes[r_symndx - symtab_hdr->sh_info];
+ {
+ h = sym_hashes[r_symndx - symtab_hdr->sh_info];
+ 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;
+ }
/* Some relocs require a global offset table. */
if (htab->sgot == NULL)
--- bfd/elf32-m68hc1x.c.got 2005-05-04 11:17:44.000000000 -0700
+++ bfd/elf32-m68hc1x.c 2005-06-20 10:46:29.000000000 -0700
@@ -885,7 +885,12 @@ elf32_m68hc11_check_relocs (bfd *abfd, s
if (r_symndx < symtab_hdr->sh_info)
h = NULL;
else
- h = sym_hashes [r_symndx - symtab_hdr->sh_info];
+ {
+ h = sym_hashes [r_symndx - symtab_hdr->sh_info];
+ 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;
+ }
switch (ELF32_R_TYPE (rel->r_info))
{
--- bfd/elf32-m68k.c.got 2005-05-05 07:44:37.000000000 -0700
+++ bfd/elf32-m68k.c 2005-06-20 10:46:46.000000000 -0700
@@ -481,7 +481,12 @@ elf_m68k_check_relocs (abfd, info, sec,
if (r_symndx < symtab_hdr->sh_info)
h = NULL;
else
- h = sym_hashes[r_symndx - symtab_hdr->sh_info];
+ {
+ h = sym_hashes[r_symndx - symtab_hdr->sh_info];
+ 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;
+ }
switch (ELF32_R_TYPE (rel->r_info))
{
--- bfd/elf32-mcore.c.got 2005-05-07 06:58:09.000000000 -0700
+++ bfd/elf32-mcore.c 2005-06-20 10:47:00.000000000 -0700
@@ -639,7 +639,12 @@ mcore_elf_check_relocs (abfd, info, sec,
if (r_symndx < symtab_hdr->sh_info)
h = NULL;
else
- h = sym_hashes [r_symndx - symtab_hdr->sh_info];
+ {
+ h = sym_hashes [r_symndx - symtab_hdr->sh_info];
+ 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;
+ }
switch (ELF32_R_TYPE (rel->r_info))
{
--- bfd/elf32-ms1.c.got 2005-06-07 14:07:30.000000000 -0700
+++ bfd/elf32-ms1.c 2005-06-20 10:47:13.000000000 -0700
@@ -481,7 +481,12 @@ ms1_elf_check_relocs
if (r_symndx < symtab_hdr->sh_info)
h = NULL;
else
- h = sym_hashes[r_symndx - symtab_hdr->sh_info];
+ {
+ h = sym_hashes[r_symndx - symtab_hdr->sh_info];
+ 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;
+ }
}
return TRUE;
--- bfd/elf32-msp430.c.got 2005-05-04 11:17:44.000000000 -0700
+++ bfd/elf32-msp430.c 2005-06-20 10:47:28.000000000 -0700
@@ -288,7 +288,12 @@ elf32_msp430_check_relocs (bfd * abfd, s
if (r_symndx < symtab_hdr->sh_info)
h = NULL;
else
- h = sym_hashes[r_symndx - symtab_hdr->sh_info];
+ {
+ h = sym_hashes[r_symndx - symtab_hdr->sh_info];
+ 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;
+ }
}
return TRUE;
--- bfd/elf32-openrisc.c.got 2005-05-04 11:17:44.000000000 -0700
+++ bfd/elf32-openrisc.c 2005-06-20 10:47:38.000000000 -0700
@@ -528,7 +528,12 @@ openrisc_elf_check_relocs (abfd, info, s
if (r_symndx < symtab_hdr->sh_info)
h = NULL;
else
- h = sym_hashes[r_symndx - symtab_hdr->sh_info];
+ {
+ h = sym_hashes[r_symndx - symtab_hdr->sh_info];
+ 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;
+ }
switch (ELF32_R_TYPE (rel->r_info))
{
--- bfd/elf32-ppc.c.got 2005-05-25 06:51:25.000000000 -0700
+++ bfd/elf32-ppc.c 2005-06-20 10:47:57.000000000 -0700
@@ -2909,7 +2909,12 @@ ppc_elf_check_relocs (bfd *abfd,
if (r_symndx < symtab_hdr->sh_info)
h = NULL;
else
- h = sym_hashes[r_symndx - symtab_hdr->sh_info];
+ {
+ h = sym_hashes[r_symndx - symtab_hdr->sh_info];
+ 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;
+ }
/* If a relocation refers to _GLOBAL_OFFSET_TABLE_, create the .got.
This shows up in particular in an R_PPC_ADDR32 in the eabi
--- bfd/elf32-s390.c.got 2005-05-05 07:44:39.000000000 -0700
+++ bfd/elf32-s390.c 2005-06-20 10:48:12.000000000 -0700
@@ -991,7 +991,12 @@ elf_s390_check_relocs (abfd, info, sec,
if (r_symndx < symtab_hdr->sh_info)
h = NULL;
else
- h = sym_hashes[r_symndx - symtab_hdr->sh_info];
+ {
+ h = sym_hashes[r_symndx - symtab_hdr->sh_info];
+ 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;
+ }
/* Create got section and local_got_refcounts array if they
are needed. */
--- bfd/elf32-sh.c.got 2005-05-05 07:44:39.000000000 -0700
+++ bfd/elf32-sh.c 2005-06-20 10:50:13.000000000 -0700
@@ -6201,14 +6201,14 @@ sh_elf_check_relocs (bfd *abfd, struct b
else
{
h = sym_hashes[r_symndx - symtab_hdr->sh_info];
-#ifdef INCLUDE_SHMEDIA
while (h->root.type == bfd_link_hash_indirect
|| h->root.type == bfd_link_hash_warning)
{
+#ifdef INCLUDE_SHMEDIA
seen_stt_datalabel |= h->type == STT_DATALABEL;
+#endif
h = (struct elf_link_hash_entry *) h->root.u.i.link;
}
-#endif
}
r_type = sh_elf_optimized_tls_reloc (info, r_type, h == NULL);
--- bfd/elf32-v850.c.got 2005-06-17 15:26:44.000000000 -0700
+++ bfd/elf32-v850.c 2005-06-20 10:50:29.000000000 -0700
@@ -689,7 +689,12 @@ v850_elf_check_relocs (abfd, info, sec,
if (r_symndx < symtab_hdr->sh_info)
h = NULL;
else
- h = sym_hashes[r_symndx - symtab_hdr->sh_info];
+ {
+ h = sym_hashes[r_symndx - symtab_hdr->sh_info];
+ 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;
+ }
r_type = (enum v850_reloc_type) ELF32_R_TYPE (rel->r_info);
switch (r_type)
--- bfd/elf32-vax.c.got 2005-06-03 22:26:51.000000000 -0700
+++ bfd/elf32-vax.c 2005-06-20 10:50:40.000000000 -0700
@@ -579,7 +579,12 @@ elf_vax_check_relocs (bfd *abfd, struct
if (r_symndx < symtab_hdr->sh_info)
h = NULL;
else
- h = sym_hashes[r_symndx - symtab_hdr->sh_info];
+ {
+ h = sym_hashes[r_symndx - symtab_hdr->sh_info];
+ 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;
+ }
switch (ELF32_R_TYPE (rel->r_info))
{
--- bfd/elf64-mmix.c.got 2005-05-05 07:44:40.000000000 -0700
+++ bfd/elf64-mmix.c 2005-06-20 10:52:52.000000000 -0700
@@ -2014,7 +2014,12 @@ mmix_elf_check_relocs (abfd, info, sec,
if (r_symndx < symtab_hdr->sh_info)
h = NULL;
else
- h = sym_hashes[r_symndx - symtab_hdr->sh_info];
+ {
+ h = sym_hashes[r_symndx - symtab_hdr->sh_info];
+ 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;
+ }
switch (ELF64_R_TYPE (rel->r_info))
{
--- bfd/elf64-ppc.c.got 2005-06-06 08:55:00.000000000 -0700
+++ bfd/elf64-ppc.c 2005-06-20 10:53:44.000000000 -0700
@@ -4365,7 +4365,12 @@ ppc64_elf_check_relocs (bfd *abfd, struc
if (r_symndx < symtab_hdr->sh_info)
h = NULL;
else
- h = sym_hashes[r_symndx - symtab_hdr->sh_info];
+ {
+ h = sym_hashes[r_symndx - symtab_hdr->sh_info];
+ 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;
+ }
r_type = ELF64_R_TYPE (rel->r_info);
switch (r_type)
--- bfd/elf64-s390.c.got 2005-05-05 07:44:41.000000000 -0700
+++ bfd/elf64-s390.c 2005-06-20 10:54:49.000000000 -0700
@@ -945,7 +945,12 @@ elf_s390_check_relocs (abfd, info, sec,
if (r_symndx < symtab_hdr->sh_info)
h = NULL;
else
- h = sym_hashes[r_symndx - symtab_hdr->sh_info];
+ {
+ h = sym_hashes[r_symndx - symtab_hdr->sh_info];
+ 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;
+ }
/* Create got section and local_got_refcounts array if they
are needed. */
--- bfd/elf64-sh64.c.got 2005-05-07 06:58:12.000000000 -0700
+++ bfd/elf64-sh64.c 2005-06-20 10:55:08.000000000 -0700
@@ -2456,7 +2456,12 @@ sh_elf64_check_relocs (bfd *abfd, struct
if (r_symndx < symtab_hdr->sh_info)
h = NULL;
else
- h = sym_hashes[r_symndx - symtab_hdr->sh_info];
+ {
+ h = sym_hashes[r_symndx - symtab_hdr->sh_info];
+ 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;
+ }
/* Some relocs require a global offset table. */
if (dynobj == NULL)
--- bfd/elfxx-mips.c.got 2005-05-31 10:48:57.000000000 -0700
+++ bfd/elfxx-mips.c 2005-06-20 10:56:48.000000000 -0700
@@ -5850,6 +5850,10 @@ _bfd_mips_elf_check_relocs (bfd *abfd, s
h = ((struct mips_elf_link_hash_entry *)
sym_hashes[r_symndx - extsymoff]);
+ while (h->root.root.type == bfd_link_hash_indirect
+ || h->root.root.type == bfd_link_hash_warning)
+ h = (struct mips_elf_link_hash_entry *) h->root.root.u.i.link;
+
/* H is the symbol this stub is for. */
h->fn_stub = sec;
--- bfd/elfxx-sparc.c.got 2005-05-05 07:44:44.000000000 -0700
+++ bfd/elfxx-sparc.c 2005-06-20 10:57:24.000000000 -0700
@@ -1019,7 +1019,12 @@ _bfd_sparc_elf_check_relocs (bfd *abfd,
if (r_symndx < symtab_hdr->sh_info)
h = NULL;
else
- h = sym_hashes[r_symndx - symtab_hdr->sh_info];
+ {
+ h = sym_hashes[r_symndx - symtab_hdr->sh_info];
+ 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;
+ }
/* Compatibility with old R_SPARC_REV32 reloc conflicting
with R_SPARC_TLS_GD_HI22. */