summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorH.J. Lu <hjl@lucon.org>2000-05-23 14:05:50 +0000
committerH.J. Lu <hjl@lucon.org>2000-05-23 14:05:50 +0000
commitc20ff8d18b0d4cd6754ed935583e39b8a15ee2eb (patch)
tree1485a226fed9512a464b69eee710fb701c80d2bf
parentf84d428279c1d2c9dcee1546b737fb19d5d12984 (diff)
downloadgdb-c20ff8d18b0d4cd6754ed935583e39b8a15ee2eb.tar.gz
2000-05-23 H.J. Lu <hjl@gnu.org>
* elf32-i386.c (elf_i386_relocate_section): Don't allow the undefined symbol with the non-default visibility attributes. * elf-hppa.h (elf_hppa_relocate_section): Likewise. * elf32-arm.h (elf32_arm_relocate_section): Likewise. * elf32-i370.c (i370_elf_relocate_section): Likewise. * elf32-m68k.c (elf_m68k_relocate_section): Likewise. * elf32-mcore.c (mcore_elf_relocate_section): Likewise. * elf32-mips.c (mips_elf_calculate_relocation): Likewise. * elf32-ppc.c (ppc_elf_relocate_section): Likewise. * elf32-sparc.c (elf32_sparc_relocate_section): Likewise. * elf64-alpha.c (elf64_alpha_relocate_section): Likewise. * elf64-ia64.c (elf64_ia64_relocate_section): Likewise. * elf64-sparc.c (sparc64_elf_relocate_section): Likewise.
-rw-r--r--bfd/ChangeLog16
-rw-r--r--bfd/elf-hppa.h3
-rw-r--r--bfd/elf32-arm.h7
-rw-r--r--bfd/elf32-i370.c3
-rw-r--r--bfd/elf32-i386.c7
-rw-r--r--bfd/elf32-m68k.c7
-rw-r--r--bfd/elf32-mcore.c3
-rw-r--r--bfd/elf32-mips.c6
-rw-r--r--bfd/elf32-ppc.c7
-rw-r--r--bfd/elf32-sparc.c7
-rw-r--r--bfd/elf64-alpha.c7
-rw-r--r--bfd/elf64-ia64.c7
-rw-r--r--bfd/elf64-sparc.c7
13 files changed, 66 insertions, 21 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index e5b040dcf66..06166285322 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,19 @@
+2000-05-23 H.J. Lu <hjl@gnu.org>
+
+ * elf32-i386.c (elf_i386_relocate_section): Don't allow the
+ undefined symbol with the non-default visibility attributes.
+ * elf-hppa.h (elf_hppa_relocate_section): Likewise.
+ * elf32-arm.h (elf32_arm_relocate_section): Likewise.
+ * elf32-i370.c (i370_elf_relocate_section): Likewise.
+ * elf32-m68k.c (elf_m68k_relocate_section): Likewise.
+ * elf32-mcore.c (mcore_elf_relocate_section): Likewise.
+ * elf32-mips.c (mips_elf_calculate_relocation): Likewise.
+ * elf32-ppc.c (ppc_elf_relocate_section): Likewise.
+ * elf32-sparc.c (elf32_sparc_relocate_section): Likewise.
+ * elf64-alpha.c (elf64_alpha_relocate_section): Likewise.
+ * elf64-ia64.c (elf64_ia64_relocate_section): Likewise.
+ * elf64-sparc.c (sparc64_elf_relocate_section): Likewise.
+
2000-05-22 Richard Henderson <rth@cygnus.com>
* elf64-ia64.c (ia64_howto_table): Add PCREL60B, PCREL21BI,
diff --git a/bfd/elf-hppa.h b/bfd/elf-hppa.h
index e30f714adee..dab039b09ab 100644
--- a/bfd/elf-hppa.h
+++ b/bfd/elf-hppa.h
@@ -1341,7 +1341,8 @@ elf_hppa_relocate_section (output_bfd, info, input_bfd, input_section,
relocation = 0;
}
/* Allow undefined symbols in shared libraries. */
- else if (info->shared && !info->no_undefined)
+ else if (info->shared && !info->no_undefined
+ && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT)
{
if (info->symbolic)
(*info->callbacks->undefined_symbol)
diff --git a/bfd/elf32-arm.h b/bfd/elf32-arm.h
index fce233197fd..e655781bde6 100644
--- a/bfd/elf32-arm.h
+++ b/bfd/elf32-arm.h
@@ -1838,14 +1838,17 @@ elf32_arm_relocate_section (output_bfd, info, input_bfd, input_section,
}
else if (h->root.type == bfd_link_hash_undefweak)
relocation = 0;
- else if (info->shared && !info->symbolic && !info->no_undefined)
+ else if (info->shared && !info->symbolic
+ && !info->no_undefined
+ && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT)
relocation = 0;
else
{
if (!((*info->callbacks->undefined_symbol)
(info, h->root.root.string, input_bfd,
input_section, rel->r_offset,
- (!info->shared || info->no_undefined))))
+ (!info->shared || info->no_undefined
+ || ELF_ST_VISIBILITY (h->other)))))
return false;
relocation = 0;
}
diff --git a/bfd/elf32-i370.c b/bfd/elf32-i370.c
index c8bf94326cd..0715d86d081 100644
--- a/bfd/elf32-i370.c
+++ b/bfd/elf32-i370.c
@@ -1413,7 +1413,8 @@ i370_elf_relocate_section (output_bfd, info, input_bfd, input_section,
}
else if (h->root.type == bfd_link_hash_undefweak)
relocation = 0;
- else if (info->shared)
+ else if (info->shared
+ && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT)
relocation = 0;
else
{
diff --git a/bfd/elf32-i386.c b/bfd/elf32-i386.c
index 8434053f2df..53edaaf2543 100644
--- a/bfd/elf32-i386.c
+++ b/bfd/elf32-i386.c
@@ -1390,14 +1390,17 @@ elf_i386_relocate_section (output_bfd, info, input_bfd, input_section,
}
else if (h->root.type == bfd_link_hash_undefweak)
relocation = 0;
- else if (info->shared && !info->symbolic && !info->no_undefined)
+ else if (info->shared && !info->symbolic
+ && !info->no_undefined
+ && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT)
relocation = 0;
else
{
if (! ((*info->callbacks->undefined_symbol)
(info, h->root.root.string, input_bfd,
input_section, rel->r_offset,
- (!info->shared || info->no_undefined))))
+ (!info->shared || info->no_undefined
+ || ELF_ST_VISIBILITY (h->other)))))
return false;
relocation = 0;
}
diff --git a/bfd/elf32-m68k.c b/bfd/elf32-m68k.c
index 38e6e9cb395..b01523477b4 100644
--- a/bfd/elf32-m68k.c
+++ b/bfd/elf32-m68k.c
@@ -1479,14 +1479,17 @@ elf_m68k_relocate_section (output_bfd, info, input_bfd, input_section,
}
else if (h->root.type == bfd_link_hash_undefweak)
relocation = 0;
- else if (info->shared && !info->symbolic && !info->no_undefined)
+ else if (info->shared && !info->symbolic
+ && !info->no_undefined
+ && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT)
relocation = 0;
else
{
if (!(info->callbacks->undefined_symbol
(info, h->root.root.string, input_bfd,
input_section, rel->r_offset,
- (!info->shared || info->no_undefined))))
+ (!info->shared || info->no_undefined
+ || ELF_ST_VISIBILITY (h->other)))))
return false;
relocation = 0;
}
diff --git a/bfd/elf32-mcore.c b/bfd/elf32-mcore.c
index 7e0c30c6cd8..99e9c73596e 100644
--- a/bfd/elf32-mcore.c
+++ b/bfd/elf32-mcore.c
@@ -522,7 +522,8 @@ mcore_elf_relocate_section (output_bfd, info, input_bfd, input_section,
}
else if (h->root.type == bfd_link_hash_undefweak)
relocation = 0;
- else if (info->shared)
+ else if (info->shared
+ && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT)
relocation = 0;
else
{
diff --git a/bfd/elf32-mips.c b/bfd/elf32-mips.c
index 4892d5afd3d..1d258b04507 100644
--- a/bfd/elf32-mips.c
+++ b/bfd/elf32-mips.c
@@ -5917,7 +5917,8 @@ mips_elf_calculate_relocation (abfd,
and check to see if they exist by looking at their
addresses. */
symbol = 0;
- else if (info->shared && !info->symbolic && !info->no_undefined)
+ else if (info->shared && !info->symbolic && !info->no_undefined
+ && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT)
symbol = 0;
else if (strcmp (h->root.root.root.string, "_DYNAMIC_LINK") == 0)
{
@@ -5935,7 +5936,8 @@ mips_elf_calculate_relocation (abfd,
if (! ((*info->callbacks->undefined_symbol)
(info, h->root.root.root.string, input_bfd,
input_section, relocation->r_offset,
- (!info->shared || info->no_undefined))))
+ (!info->shared || info->no_undefined
+ || ELF_ST_VISIBILITY (h->other)))))
return bfd_reloc_undefined;
symbol = 0;
}
diff --git a/bfd/elf32-ppc.c b/bfd/elf32-ppc.c
index b7e8592ef7d..cf832426d9f 100644
--- a/bfd/elf32-ppc.c
+++ b/bfd/elf32-ppc.c
@@ -3091,7 +3091,9 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section,
}
else if (h->root.type == bfd_link_hash_undefweak)
relocation = 0;
- else if (info->shared && !info->symbolic && !info->no_undefined)
+ else if (info->shared && !info->symbolic
+ && !info->no_undefined
+ && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT)
relocation = 0;
else
{
@@ -3101,7 +3103,8 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section,
input_section,
rel->r_offset,
(!info->shared
- || info->no_undefined)))
+ || info->no_undefined
+ ELF_ST_VISIBILITY (h->other))))
return false;
relocation = 0;
}
diff --git a/bfd/elf32-sparc.c b/bfd/elf32-sparc.c
index e61a82fabeb..1c8d0ba275a 100644
--- a/bfd/elf32-sparc.c
+++ b/bfd/elf32-sparc.c
@@ -1213,14 +1213,17 @@ elf32_sparc_relocate_section (output_bfd, info, input_bfd, input_section,
}
else if (h->root.type == bfd_link_hash_undefweak)
relocation = 0;
- else if (info->shared && !info->symbolic && !info->no_undefined)
+ else if (info->shared && !info->symbolic
+ && !info->no_undefined
+ && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT)
relocation = 0;
else
{
if (! ((*info->callbacks->undefined_symbol)
(info, h->root.root.string, input_bfd,
input_section, rel->r_offset,
- (!info->shared || info->no_undefined))))
+ (!info->shared || info->no_undefined
+ || ELF_ST_VISIBILITY (h->other)))))
return false;
relocation = 0;
}
diff --git a/bfd/elf64-alpha.c b/bfd/elf64-alpha.c
index 4da9e925c63..c8fac5361ec 100644
--- a/bfd/elf64-alpha.c
+++ b/bfd/elf64-alpha.c
@@ -3475,14 +3475,17 @@ elf64_alpha_relocate_section (output_bfd, info, input_bfd, input_section,
}
else if (h->root.root.type == bfd_link_hash_undefweak)
relocation = 0;
- else if (info->shared && !info->symbolic && !info->no_undefined)
+ else if (info->shared && !info->symbolic
+ && !info->no_undefined
+ && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT)
relocation = 0;
else
{
if (!((*info->callbacks->undefined_symbol)
(info, h->root.root.root.string, input_bfd,
input_section, rel->r_offset,
- (!info->shared || info->no_undefined))))
+ (!info->shared || info->no_undefined
+ || ELF_ST_VISIBILITY (h->other)))))
return false;
relocation = 0;
}
diff --git a/bfd/elf64-ia64.c b/bfd/elf64-ia64.c
index ed9f8e3ec94..2fafeb18b29 100644
--- a/bfd/elf64-ia64.c
+++ b/bfd/elf64-ia64.c
@@ -3258,14 +3258,17 @@ elf64_ia64_relocate_section (output_bfd, info, input_bfd, input_section,
}
else if (h->root.type == bfd_link_hash_undefweak)
undef_weak_ref = true;
- else if (info->shared && !info->symbolic && !info->no_undefined)
+ else if (info->shared && !info->symbolic
+ && !info->no_undefined
+ && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT)
;
else
{
if (! ((*info->callbacks->undefined_symbol)
(info, h->root.root.string, input_bfd,
input_section, rel->r_offset,
- (!info->shared || info->no_undefined))))
+ (!info->shared || info->no_undefined
+ || ELF_ST_VISIBILITY (h->other)))))
return false;
ret_val = false;
continue;
diff --git a/bfd/elf64-sparc.c b/bfd/elf64-sparc.c
index 46e777552f2..c9e862677ac 100644
--- a/bfd/elf64-sparc.c
+++ b/bfd/elf64-sparc.c
@@ -2049,14 +2049,17 @@ sparc64_elf_relocate_section (output_bfd, info, input_bfd, input_section,
}
else if (h->root.type == bfd_link_hash_undefweak)
relocation = 0;
- else if (info->shared && !info->symbolic && !info->no_undefined)
+ else if (info->shared && !info->symbolic
+ && !info->no_undefined
+ && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT)
relocation = 0;
else
{
if (! ((*info->callbacks->undefined_symbol)
(info, h->root.root.string, input_bfd,
input_section, rel->r_offset,
- (!info->shared || info->no_undefined))))
+ (!info->shared || info->no_undefined
+ || ELF_ST_VISIBILITY (h->other)))))
return false;
relocation = 0;
}